package com.campus.activity.common;

import lombok.Getter;

@Getter
public enum ResultCode {

    SUCCESS(200, "success"),
    ERROR(500, "服务器内部错误"),
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未认证或Token已过期"),
    FORBIDDEN(403, "无权限访问"),
    NOT_FOUND(404, "资源不存在"),
    CONFLICT(409, "业务冲突"),

    USER_NOT_FOUND(1001, "用户不存在"),
    USER_ALREADY_EXISTS(1002, "用户已存在"),
    PASSWORD_ERROR(1003, "密码错误"),
    USERNAME_OR_PASSWORD_ERROR(1004, "用户名或密码错误"),
    STUDENT_ID_ALREADY_EXISTS(1005, "学号已存在"),

    ACTIVITY_NOT_FOUND(2001, "活动不存在"),
    ACTIVITY_ALREADY_STARTED(2002, "活动已开始，无法取消报名"),
    ACTIVITY_TIME_CONFLICT(2003, "活动时间冲突"),
    ACTIVITY_FULL(2004, "活动报名人数已满"),

    REGISTRATION_NOT_FOUND(3001, "报名记录不存在"),
    ALREADY_REGISTERED(3002, "您已报名该活动"),
    NOT_REGISTERED(3003, "您未报名该活动"),

    CHECKIN_FAILED(4001, "签到失败"),
    ALREADY_CHECKED_IN(4002, "已签到"),
    CHECKIN_TIME_EXPIRED(4003, "签到时间已过期"),

    REVIEW_ALREADY_EXISTS(5001, "您已评价该活动"),
    REVIEW_NOT_FOUND(5002, "评价记录不存在"),
    NOT_PARTICIPATED(5003, "您未参加该活动，无法评价");

    private final Integer code;
    private final String message;

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