package com.ruoyi.cai.enums;

import com.ruoyi.cai.enums.systemconfig.*;
import com.ruoyi.common.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;

/**
 * 系统动态配置枚举
 * <p>created on 2022/8/18 17:15</p>
 *
 * @author ZL
 */
public enum SystemConfigEnum {
    RANK_LOVE_DAY_AWARD("138,108,88,58,38,28,28,28,28,28,28", "魅力榜日榜奖励", SystemConfigGroupEnum.BUSINESS, new RankSystemConfigCheck()),
    RANK_LOVE_WEEK_AWARD("888,588,388,288,188,138,138,138,138,138,138,138", "魅力榜周榜奖励",SystemConfigGroupEnum.BUSINESS, new RankSystemConfigCheck()),
    RANK_INVITE_DAY_AWARD("138,108,88,58,38,28,28,28,28,28,28", "邀请榜日榜奖励",SystemConfigGroupEnum.BUSINESS,new RankSystemConfigCheck()),
    RANK_INVITE_WEEK_AWARD("888,588,388,288,188,138,138,138,138,138,138,138", "邀请榜周榜奖励",SystemConfigGroupEnum.BUSINESS,new RankSystemConfigCheck()),
    REGISTER_AWARD("88", "注册奖励",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    FAST_PAY_AWARD("300", "首充奖励",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    GUARD_PRICE("1314", "守护价格",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    DEFAULT_ANCHOR_PRICE("200","主播默认价格",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    DEFAULT_ANCHOR_GUARD_PRICE("0.5","主播默认守护提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DEFAULT_ANCHOR_GIFT_PRICE("0.5","主播默认礼物提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DEFAULT_ANCHOR_VIDEO_PRICE("0.5","主播默认视频提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DAY_MAX_DYNAMIC("10", "每日运行发布的最大动态数",SystemConfigGroupEnum.BUSINESS,new NumberSystemConfigCheck()),
    DEFAULT_VIDEO_INCOME_RATE("0.07", "默认分销好友视频提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DEFAULT_GIFT_INCOME_RATE("0.07", "默认分销好友礼物提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DEFAULT_GUARD_INCOME_RATE("0.07", "默认分销好友守护提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DEFAULT_PAY_INCOME_RATE("0.07", "默认分销好友充值提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    DEFAULT_UNION_GIFT_INCOME_RATE("0.01", "默认工会礼物提成",SystemConfigGroupEnum.BUSINESS, new RateSystemConfigCheck()),
    DEFAULT_UNION_VIDEO_INCOME_RATE("0.01", "默认工会视频提成",SystemConfigGroupEnum.BUSINESS, new RateSystemConfigCheck()),
    DEFAULT_UNION_ONE_INCOME_RATE("0.07", "默认工会一级提成",SystemConfigGroupEnum.BUSINESS, new RateSystemConfigCheck()),
    TODAY_GREET_MAX("100", "每日主播群打招呼次数",SystemConfigGroupEnum.BUSINESS,new NumberSystemConfigCheck()),
    GREET_INTERVAL_MIN("30", "群打招呼的间隔时间（分钟）",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    SENSITIVE_ENABLE("1", "是否开启手机号脱敏",SystemConfigGroupEnum.SYSTEM),
    SMS_CODE_ADMIN("", "万能验证码",SystemConfigGroupEnum.SYSTEM),
    PASSWORD_ADMIN("", "公用密码",SystemConfigGroupEnum.SYSTEM),
    SYSTEM_CUSTOMER_SERVICE("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15", "系统客服",SystemConfigGroupEnum.SYSTEM),
    WS_SOCKET_URL("ws://localhost:8080/ws?token=%s&room_id=%s", "ws通讯地址",SystemConfigGroupEnum.SYSTEM),
    ;


    @Getter
    private final String defaultValue;
    @Getter
    private final String desc;
    @Getter
    private final SystemConfigGroupEnum group;
    @Setter
    @Getter
    private ISystemConfigCheck check = null;

    SystemConfigEnum(String defaultValue, String desc, SystemConfigGroupEnum group) {
        this.defaultValue = defaultValue;
        this.desc = desc;
        this.group = group;
    }

    SystemConfigEnum(String defaultValue, String desc, SystemConfigGroupEnum group, ISystemConfigCheck check) {
        this.defaultValue = defaultValue;
        this.desc = desc;
        this.group = group;
        this.check = check;
    }

    public String getKey() {
        return this.name();
    }
}
