package com.ruoyi.xq.enums.common;

import com.ruoyi.xq.manager.systemconfig.*;
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", "魅力榜日榜前10名奖励", SystemConfigGroupEnum.BUSINESS, new NumberListSystemConfigCheck(10)),
    RANK_LOVE_WEEK_AWARD("888,588,388,288,188,138,138,138,138,138,138,138", "魅力榜周榜前10名奖励",SystemConfigGroupEnum.BUSINESS, new NumberListSystemConfigCheck(10)),
    RANK_INVITE_DAY_AWARD("138,108,88,58,38,28,28,28,28,28,28", "邀请榜日榜前10名奖励",SystemConfigGroupEnum.BUSINESS,new NumberListSystemConfigCheck(10)),
    RANK_INVITE_WEEK_AWARD("888,588,388,288,188,138,138,138,138,138,138,138", "邀请榜周榜前10名奖励",SystemConfigGroupEnum.BUSINESS,new NumberListSystemConfigCheck(10)),
    INVITE_BIND_RATE("1000", "邀请绑定成功率[0-1000]数字越大成功率越高",SystemConfigGroupEnum.BUSINESS, new RangeIntegerSystemConfigCheck(0,1000)),
    SHARE_URL("https://h5.qx96688.com/index/invite/index", "分享链接",SystemConfigGroupEnum.BUSINESS),
    ANCHOR_AVATAR_IGNORE_AUDIT("0", "开启主播头像免审核",SystemConfigGroupEnum.BUSINESS, new BooleanSystemConfigCheck()),
    ANCHOR_ALBUM_AVATAR_IGNORE_AUDIT("0", "开启主播相册免审核",SystemConfigGroupEnum.BUSINESS, new BooleanSystemConfigCheck()),
    NO_ANCHOR_AVATAR_IGNORE_AUDIT("0", "开启非主播头像免审核",SystemConfigGroupEnum.BUSINESS, new BooleanSystemConfigCheck()),
    NO_ANCHOR_ALBUM_AVATAR_IGNORE_AUDIT("0", "开启非主播头像免审核",SystemConfigGroupEnum.BUSINESS, new BooleanSystemConfigCheck()),
    REGISTER_AWARD("88", "注册奖励",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    FAST_PAY_AWARD("300", "首充奖励",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    GUARD_PRICE("1314", "守护价格",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    WINDOW_GIFT_THRESHOLD("10", "礼物飘窗阈值",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    WINDOW_RECHARGE_THRESHOLD("10", "充值飘窗阈值",SystemConfigGroupEnum.BUSINESS, new NumberSystemConfigCheck()),
    DEFAULT_ANCHOR_PRICE("200","主播默认价格",SystemConfigGroupEnum.BUSINESS, new RangeIntegerSystemConfigCheck(150,1500)),
    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()),
    IM_ANCHOR_INCOME_RATE("0.5", "聊天主播提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    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.3", "默认分销好友充值提成",SystemConfigGroupEnum.BUSINESS,new RateSystemConfigCheck()),
    @Deprecated
    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()),
    OPEN_ALI_PAY("1", "是否开启支付宝支付",SystemConfigGroupEnum.BUSINESS,new BooleanSystemConfigCheck()),
    OPEN_WX_PAY("1", "是否开启微信支付",SystemConfigGroupEnum.BUSINESS,new BooleanSystemConfigCheck()),
    ALI_PAY_FIRST("1", "支付宝支付显示是否在前面",SystemConfigGroupEnum.BUSINESS,new BooleanSystemConfigCheck()),
    OPEN_WITHDRAW("1", "是否开启提现功能",SystemConfigGroupEnum.BUSINESS,new BooleanSystemConfigCheck()),
    HOME_RECOMMEND_FOLLOWS_LIMIT("20", "首页随机推荐关注用户数量",SystemConfigGroupEnum.BUSINESS,new NumberSystemConfigCheck()),
    WITHDRAW_RULE_REMARK("平台50元起提现，最快2小时到账（每天不限次数），22点后提现次日中午10点到账", "提现规则说明",SystemConfigGroupEnum.BUSINESS),
    SENSITIVE_ENABLE("1", "是否开启手机号脱敏",SystemConfigGroupEnum.SYSTEM,new BooleanSystemConfigCheck()),
    YUNXIN_ONLINE_ENABLE("1", "是否开启云信监控在线状态",SystemConfigGroupEnum.SYSTEM,new BooleanSystemConfigCheck()),
    SMS_CODE_ADMIN("", "万能验证码",SystemConfigGroupEnum.SYSTEM),
    PASSWORD_ADMIN("", "公用密码",SystemConfigGroupEnum.SYSTEM),
    COS_DOMAIN("http://nono-1257812345.cos.ap-shanghai.myqcloud.com/", "文件系统域名前缀",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();
    }
}
