fun.fengwk.upms.share.UpmsErrorCodes Maven / Gradle / Ivy
package fun.fengwk.upms.share;
import fun.fengwk.convention4j.api.code.DomainConventionErrorCodeEnumAdapter;
import fun.fengwk.convention4j.api.code.HttpStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author fengwk
*/
@Getter
@AllArgsConstructor
public enum UpmsErrorCodes implements DomainConventionErrorCodeEnumAdapter {
CLIENT_ALREADY_EXISTS(HttpStatus.CONFLICT),
CLIENT_NOT_EXISTS(HttpStatus.NOT_FOUND),
INVALID_NAMESPACE(HttpStatus.BAD_REQUEST),
NAMESPACE_ALREADY_EXISTS(HttpStatus.CONFLICT),
INVALID_NAMESPACE_DESCRIPTION(HttpStatus.BAD_REQUEST),
NAMESPACE_NOT_EXISTS(HttpStatus.NOT_FOUND),
INVALID_USERNAME(HttpStatus.BAD_REQUEST),
INVALID_NICKNAME(HttpStatus.BAD_REQUEST),
USERNAME_ALREADY_EXISTS(HttpStatus.CONFLICT),
NICKNAME_ALREADY_EXISTS(HttpStatus.CONFLICT),
INVALID_USER_EMAIL(HttpStatus.BAD_REQUEST),
USER_EMAIL_ALREADY_EXISTS(HttpStatus.CONFLICT),
INVALID_USER_MOBILE(HttpStatus.BAD_REQUEST),
USER_MOBILE_ALREADY_EXISTS(HttpStatus.CONFLICT),
USER_NOT_EXISTS(HttpStatus.NOT_FOUND),
INVALID_BAN_USER_TIME_RANGE(HttpStatus.BAD_REQUEST),
INVALID_PERMISSION_CODE(HttpStatus.BAD_REQUEST),
INVALID_PERMISSION_NAME(HttpStatus.BAD_REQUEST),
INVALID_PERMISSION_DESCRIPTION(HttpStatus.BAD_REQUEST),
PERMISSION_NOT_EXISTS(HttpStatus.NOT_FOUND),
PERMISSION_ALREADY_EXISTS(HttpStatus.CONFLICT),
INVALID_ROLE_CODE(HttpStatus.BAD_REQUEST),
INVALID_ROLE_NAME(HttpStatus.BAD_REQUEST),
INVALID_ROLE_DESCRIPTION(HttpStatus.BAD_REQUEST),
ROLE_NOT_EXISTS(HttpStatus.NOT_FOUND),
ROLE_ALREADY_EXISTS(HttpStatus.CONFLICT),
USER_STATUS_EXCEPTION(HttpStatus.UNAUTHORIZED),
PASSWORD_ERROR(HttpStatus.UNAUTHORIZED),
;
private final HttpStatus httpStatus;
@Override
public String getDomain() {
return "UPMS";
}
}