add: 登录
This commit is contained in:
4
src/main/java/com/dota/nexus/entity/LoginDTO.java
Normal file
4
src/main/java/com/dota/nexus/entity/LoginDTO.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
public record LoginDTO(String username, String password) {
|
||||
}
|
||||
@@ -27,8 +27,12 @@ public class R {
|
||||
return new R(200, "ok", data);
|
||||
}
|
||||
|
||||
public static R error(String msg){
|
||||
return new R(500, msg);
|
||||
}
|
||||
|
||||
public static R error(){
|
||||
return new R(500, "服务端发生未知错误");
|
||||
return error("服务端发生未知错误");
|
||||
}
|
||||
|
||||
public static R unauthorized() {
|
||||
|
||||
14
src/main/java/com/dota/nexus/entity/User.java
Normal file
14
src/main/java/com/dota/nexus/entity/User.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class User extends Entity{
|
||||
private String name;
|
||||
|
||||
private String password;
|
||||
|
||||
private String nickname;
|
||||
}
|
||||
Reference in New Issue
Block a user