@@ -19,6 +19,7 @@ public enum MessageCode {
|
||||
FILE_DELETE(2, "File was deleted"),
|
||||
USER_NOT_HAD_PERMISSION(2, "User not have permission for file"),
|
||||
USER_NOT_VERIFIED(2, "User not verified"),
|
||||
LAW_CASE_NOT_FOUND(4, "Law case not found"),
|
||||
PERMISSION_NOT_FOUND(2, "Permission not found"),
|
||||
USER_NOT_FOUND(2, "User not found"),
|
||||
FILE_DOWNLOAD_ERROR_NOT_CORRECT_FIELD(2, "Not correct field"),
|
||||
@@ -26,8 +27,10 @@ public enum MessageCode {
|
||||
IMAGE_FOUND_ERROR(2, "Image found error"),
|
||||
INVALID_JSON_BODY(2, "Invalid fields in JSON object"),
|
||||
INCOMPLETE_UPLOAD(2, "Not load all chunks"),
|
||||
USER_NOT_HAVE_TOKEN(2, "Not have tokens"),
|
||||
MSG_ID_NOT_FOUND(4, "Message id not found"),
|
||||
FILE_ENTITY_ERROR(2, "File entity error"),
|
||||
NOT_VALID_FIELD(2, "Not valid field"),
|
||||
ACCESS_DENIED(2, "Access denied"),
|
||||
AUTH_EMAIL_NOT_FOUND(4, "Email not found"),
|
||||
AUTH_EMAIL_OR_TOKEN_NOT_FOUND(4, "Email or Token not found "),
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package ru.soune.nocopy.dto.complaint;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class BaseResponse {
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
@JsonProperty("message")
|
||||
private String message;
|
||||
|
||||
@JsonProperty("data")
|
||||
private Object data;
|
||||
|
||||
@JsonProperty("error_code")
|
||||
private String errorCode;
|
||||
|
||||
public static BaseResponse success(Object data) {
|
||||
return BaseResponse.builder()
|
||||
.status("SUCCESS")
|
||||
.data(data)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static BaseResponse error(String message, String errorCode) {
|
||||
return BaseResponse.builder()
|
||||
.status("ERROR")
|
||||
.message(message)
|
||||
.errorCode(errorCode)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package ru.soune.nocopy.dto.complaint;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class LawCasePageResponse {
|
||||
private List<LawCaseResponse> content;
|
||||
private int pageNumber;
|
||||
private int pageSize;
|
||||
private long totalElements;
|
||||
private int totalPages;
|
||||
private boolean last;
|
||||
private boolean first;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package ru.soune.nocopy.dto.complaint;
|
||||
|
||||
import lombok.Data;
|
||||
import ru.soune.nocopy.entity.complaint.LawCasePriority;
|
||||
import ru.soune.nocopy.entity.complaint.LawCaseType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class LawCaseRequest {
|
||||
private Long id;
|
||||
//required
|
||||
private String name;
|
||||
//required
|
||||
private String description;
|
||||
private BigDecimal amount;
|
||||
private String priority = LawCasePriority.MIDDLE.toString();
|
||||
private String type;
|
||||
private String lawyer;
|
||||
private String token;
|
||||
private Integer pageSize = 10;
|
||||
private Integer pageNumber = 0;
|
||||
private String sortBy = "createdAt";
|
||||
private String sortDir = "asc";
|
||||
private String action;
|
||||
private LawCaseType filterType;
|
||||
private String filterLawyer;
|
||||
private LawCasePriority filterPriority;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package ru.soune.nocopy.dto.complaint;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import ru.soune.nocopy.entity.complaint.LawCase;
|
||||
import ru.soune.nocopy.entity.complaint.LawCasePriority;
|
||||
import ru.soune.nocopy.entity.complaint.LawCaseType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class LawCaseResponse {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String description;
|
||||
private BigDecimal amount;
|
||||
private LawCasePriority priority;
|
||||
private LawCaseType type;
|
||||
private String lawyer;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
private int pageNumber;
|
||||
private int pageSize;
|
||||
private long totalElements;
|
||||
private int totalPages;
|
||||
private List<LawCaseResponse> content;
|
||||
|
||||
public static LawCaseResponse fromEntity(LawCase lawCase) {
|
||||
return LawCaseResponse.builder()
|
||||
.id(lawCase.getId())
|
||||
.name(lawCase.getName())
|
||||
.description(lawCase.getDescription())
|
||||
.amount(lawCase.getAmount())
|
||||
.priority(lawCase.getPriority())
|
||||
.type(lawCase.getType())
|
||||
.lawyer(lawCase.getLawyer())
|
||||
.createdAt(lawCase.getCreatedAt())
|
||||
.updatedAt(lawCase.getUpdatedAt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package ru.soune.nocopy.dto.complaint;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class PaginatedResponse<T> {
|
||||
private List<T> content;
|
||||
private long totalElements;
|
||||
private int totalPages;
|
||||
private int pageNumber;
|
||||
private int pageSize;
|
||||
private boolean first;
|
||||
private boolean last;
|
||||
}
|
||||
Reference in New Issue
Block a user