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

cn.woodwhales.common.model.enums.RespCodeEnum Maven / Gradle / Ivy

There is a newer version: 3.8.3
Show newest version
package cn.woodwhales.common.model.enums;

import cn.woodwhales.common.model.result.BaseRespResult;

/**
 * @author woodwhales on 2020-08-25
 * 通用响应枚举
 */
public enum RespCodeEnum implements BaseRespResult {

    /**
     * 响应成功
     */
    SUCCESS(0, "操作成功"),

    /**
     * 响应失败
     */
    ERROR(-1, "操作失败"),
    ;

    /**
     * 响应状态码
     */
    private final Integer code;

    /**
     * 响应描述
     */
    private final String message;

    RespCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy