package com.bonus.common.biz.enums;

import lombok.Getter;

/**
 * @author bonus
 */

@Getter
public enum HttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    //失败
    FAIL(400, "操作失败,请联系管理员"),
    // SQL查询数据为空
    QUERY_DATA_NULL(404, "查询数据为空"),
    // 登录
    NEED_LOGIN(401, "需要登录后操作"),
    TO_PARAM_NULL(1007, "参数为空"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    SYSTEM_ERROR(500, "出现错误"),
    USERNAME_EXIST(501, "用户名已存在"),
    PHONENUMBER_EXIST(502, "手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    CONTENT_NOT_NULL(506, "评论内容不能为空"),
    FILE_TYPE_ERROR(507, "文件类型错误"),
    USERNAME_NOT_NULL(508, "用户名不能为空"),
    NICKNAME_NOT_NULL(509, "昵称不能为空"),
    PASSWORD_NOT_NULL(510, "密码不能为空"),
    EMAIL_NOT_NULL(511, "邮箱不能为空"),
    NICKNAME_EXIST(512, "昵称已存在"),
    LOGIN_ERROR(505, "用户名或密码错误"),
    NAME_DUPLICATE(1000, "名称重复，请重新输入"),
    INVALID_LONGITUDE_FORMAT(1001, "经度格式不正确"),
    INVALID_LATITUDE_FORMAT(1002, "纬度格式不正确"),
    INVALID_PHONE_FORMAT(1003, "手机号格式不正确"),
    REPEATE_ERROR(600, "不允许重复提交，请稍候再试"),
    INVALID_PHONE_NUMBER_FORMAT(501, "手机号格式不正确"),
    UPDATE_TO_DATABASE(500, "操作失败，请联系管理员"),
    DEPART_IS_RELATED_TEAM(1004, "该项目部下有关联班组，不允许删除");

    private final int code;
    private final String msg;

    HttpCodeEnum(int code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }

}
