feat:权限v1
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
package com.xiang.xservice.auth.api.api;
|
||||
|
||||
|
||||
import com.xiang.xservice.auth.api.dto.req.LoginRequest;
|
||||
import com.xiang.xservice.auth.api.dto.req.RegisterRequest;
|
||||
import com.xiang.xservice.auth.api.dto.resp.LoginResp;
|
||||
import com.xiang.xservice.auth.api.dto.resp.RegisterResp;
|
||||
import com.xiang.xservice.basic.common.resp.Result;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public interface TokenApi {
|
||||
|
||||
Result<LoginResp> login(@RequestBody @NotNull(message = "请求参数不能为空") @Valid LoginRequest request);
|
||||
|
||||
Result<RegisterResp> register(@RequestBody @Valid @NotNull(message = "请求参数不能为空") RegisterRequest request);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import lombok.Getter;
|
||||
public enum Code02RoleErrorCode implements BaseErrorCode {
|
||||
|
||||
ROLE_NOT_EXISTS("A1000201", "角色不存在"),
|
||||
USER_ROLE_NOT_EXISTS("A1000202", "用户角色权限不存在!")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -5,12 +5,23 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LoginRequest {
|
||||
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
private String username;
|
||||
|
||||
@NotBlank(message = "密码不能为空")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* todo 目前只支持用户名密码登录
|
||||
* 1. 用户名密码登录
|
||||
* 2. 手机号密码登录
|
||||
* 3. 邮箱密码登录
|
||||
*/
|
||||
private Integer loginType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user