add admin user logic
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package ru.soune.nocopy.adminpanel.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class ActionResponse {
|
||||
@JsonProperty("action")
|
||||
private String action;
|
||||
|
||||
@JsonProperty("available_actions")
|
||||
private List<String> availableActions;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package ru.soune.nocopy.adminpanel.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AdminUserRequest {
|
||||
@JsonProperty("action")
|
||||
private String action;
|
||||
|
||||
@JsonProperty("admin_id")
|
||||
private Long adminId;
|
||||
|
||||
@JsonProperty("full_name")
|
||||
private String fullName;
|
||||
|
||||
@JsonProperty("email")
|
||||
private String email;
|
||||
|
||||
@JsonProperty("password")
|
||||
private String password;
|
||||
|
||||
@JsonProperty("is_super_admin")
|
||||
private Boolean isSuperAdmin;
|
||||
|
||||
@JsonProperty("is_active")
|
||||
private Boolean isActive;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package ru.soune.nocopy.adminpanel.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class AdminUserResponse {
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
@JsonProperty("full_name")
|
||||
private String fullName;
|
||||
|
||||
@JsonProperty("email")
|
||||
private String email;
|
||||
|
||||
@JsonProperty("is_active")
|
||||
private Boolean isActive;
|
||||
|
||||
@JsonProperty("is_super_admin")
|
||||
private Boolean isSuperAdmin;
|
||||
|
||||
@JsonProperty("created_at")
|
||||
private String createdAt;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package ru.soune.nocopy.adminpanel.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
|
||||
public class BaseRequest {
|
||||
@JsonProperty("version")
|
||||
Integer version;
|
||||
|
||||
@JsonProperty("msg_id")
|
||||
Integer msgId;
|
||||
|
||||
@JsonProperty("token")
|
||||
String token;
|
||||
|
||||
@JsonProperty("message_body")
|
||||
Object messageBody;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package ru.soune.nocopy.adminpanel.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
|
||||
public class BaseResponse {
|
||||
@JsonProperty("msg_id")
|
||||
private Integer msgId;
|
||||
|
||||
@JsonProperty("message_code")
|
||||
private Integer messageCode;
|
||||
|
||||
@JsonProperty("message_desc")
|
||||
private String messageDesc;
|
||||
|
||||
@JsonProperty("message_body")
|
||||
private Object messageBody;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package ru.soune.nocopy.adminpanel.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class LoginResponse {
|
||||
@JsonProperty("success")
|
||||
private Boolean success;
|
||||
|
||||
@JsonProperty("token")
|
||||
private String token;
|
||||
|
||||
@JsonProperty("admin")
|
||||
private AdminUserResponse admin;
|
||||
}
|
||||
Reference in New Issue
Block a user