template.result_code_enum.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of primo-generator-mybatis-plus-maven-plugin Show documentation
Show all versions of primo-generator-mybatis-plus-maven-plugin Show documentation
自动生成增删改查代码插件,通过Maven插件配置,一键生成单表的所有CRUD操作
package ${package.ResultCodeEnum};
/**
* 响应码枚举,参考HTTP状态码的语义
*
* @author ${author}
* @since ${date}
*/
public enum ResultCodeEnum {
/**
* 成功
*/
SUCCESS(200, "SUCCESS"),
/**
* 失败
*/
FAIL(400, "FAIL"),
/**
* 未认证(签名错误)
*/
UNAUTHORIZED(401, "UNAUTHORIZED"),
/**
* 参数错误
*/
PARAMETER_ERROR(402, "PARAMETER_ERROR"),
/**
* 接口不存在
*/
NOT_FOUND(404, "NOT_FOUND"),
/**
* 服务器内部错误
*/
INTERNAL_SERVER_ERROR(500, "INTERNAL_SERVER_ERROR"),
;
private final Integer code;
private final String message;
ResultCodeEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy