commit
This commit is contained in:
parent
33e66e6ef0
commit
bf5fe7d4b9
@ -18,6 +18,12 @@ import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 管理员操作控制器示例
|
||||
* Create by callmeyan
|
||||
* @module demo/point_sys_api/admin
|
||||
* @folder demo/point_sys_api/api
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/user")
|
||||
@Slf4j
|
||||
@ -34,6 +40,13 @@ public class UserAdminController {
|
||||
userStoreMap.put("test", UserAdminInfo.create(2, "test", "123123"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @status released
|
||||
* @folder demo/point_sys_api/api/admin
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("login")
|
||||
public UserAdminInfo login(@Validated @RequestBody UserAdminInfo user) {
|
||||
|
@ -13,11 +13,23 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class UserAdminInfo implements Serializable {
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private int id;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@NotEmpty(message = "账号不允许为空")
|
||||
private String account;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotEmpty(message = "密码不允许为空")
|
||||
private String password;
|
||||
/**
|
||||
* 登录信息凭证
|
||||
*/
|
||||
private String token;
|
||||
public static UserAdminInfo create(int id,String acc,String pwd){
|
||||
return new UserAdminInfo(id,acc,pwd,null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user