今日任务:
完成登陆注册。
写了以下几个类和接口:
1:实体类Login,有三个私有属性 id, username,userpassword,并且给予了get,set方法,重写了equals方法和hashCode方法。
2:mapper类:继承JpaRepository和JpaSpecificationExecutor,编写登陆注册的sql语句以及三个抽象方法{登陆:findByUsernameAndUserpassword(),findAll();注册:findByUsername()}
3:接口LoginService:定义了四个抽象方法。{登陆:findAll(),findByUsernameAndUserpassword();注册:save(),findByUsername()}
4:实现类LoginServiceImpl:
继承LoginService,重写四个抽象方法。
5:控制器:MyController(登陆:通过判断数据库中是否有账号密码来进行登陆是否成功;注册:判断账号密码不能为空以及输入两次密码不能不相同,判断注册的账号是否与数据库中的账号重复。)
6:写了四个hml:
404.html, login.html, register.html, success.html
7:修改了一些配置文件,添加了一些依赖,修改了application.properties的url,修改了generatorConfig.xml的一些配置信息。
8:添加了AppTests类。
问题:
postman报了这个错误,
{
“info”: “参数错误 Required String parameter ‘username’ is not present”,
“data”: null,
“status”: -1
}
叽里呱啦实习第二十天
最新推荐文章于 2019-11-14 23:05:47 发布