package com.fs.app.enums;

import lombok.Getter;

@Getter
public enum ErrorCode {
    // 系统级错误
    SYSTEM_ERROR(10000, "系统异常"),

    // 参数相关错误
    PARAM_EMPTY(10001, "参数不能为空"),
    PARAM_FORMAT_ERROR(10002, "参数格式错误"),

    // 用户相关错误
    USER_NOT_LOGIN(20001, "用户未登录"),
    USER_NOT_EXIST(20002, "用户不存在"),
    PHONE_ALREADY_BOUND(20003, "手机号已绑定"),
    PHONE_ALREADY_USED(20004, "手机号已被使用"),

    // 微信相关错误
    WX_SERVICE_NOT_FOUND(30001, "微信服务未找到"),
    WX_SESSION_FAILED(30002, "微信会话获取失败"),
    WX_DECRYPT_FAILED(30003, "微信数据解密失败"),
    WX_PHONE_EMPTY(30004, "微信手机号为空"),
    WX_API_ERROR(30005, "微信接口调用失败"),

    // 数据库相关错误
    DB_UPDATE_FAILED(40001, "数据更新失败"),

    // 成功
    SUCCESS(0, "成功");

    private final int code;
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
