All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.result_code_enum.vm Maven / Gradle / Ivy

Go to download

自动生成增删改查代码插件,通过Maven插件配置,一键生成单表的所有CRUD操作

There is a newer version: 3.0.4
Show newest version
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