package com.slodon.b2b2c.errors;

import java.util.HashMap;
import java.util.Map;

public class WxCodeError {
    public static Map<String,String> WX_CODE = new HashMap<>();

    static {
        new WxCodeError();
    }

    public WxCodeError() {
        initWxCode();
        initWxLiveCode();//直播错误码添加
        initWxLiveGoodsCode();//直播商品错误码添加
    }

    private void initWxLiveGoodsCode() {
        WX_CODE.put("300003", "价格输入不合规（如: 现价比原价大、传入价格非数字等）");
        WX_CODE.put("300004", "商品名称存在违规违法内容");
        WX_CODE.put("300005", "商品图片存在违规违法内容");
        WX_CODE.put("300007", "线上小程序版本不存在该链接");
        WX_CODE.put("300008", "添加商品失败");
        WX_CODE.put("300009", "商品审核撤回失败");
        WX_CODE.put("300010", "商品审核状态不对（如: 商品审核中）");
        WX_CODE.put("300011", "操作非法（API不允许操作非 API 创建的商品）");
        WX_CODE.put("300012", "没有提审额度（每天500次提审额度）");
        WX_CODE.put("300013", "提审失败");
        WX_CODE.put("300014", "审核中，无法删除（非零代表失败）");
        WX_CODE.put("300017", "商品未提审");
        WX_CODE.put("300018", "商品图片尺寸过大");
        WX_CODE.put("300021", "商品添加成功，审核失败");
    }

    private void initWxLiveCode() {
        WX_CODE.put("1","未创建直播间");
        WX_CODE.put("1003","商品 id 不存在");
        WX_CODE.put("47001","入参格式不符合规范");
        WX_CODE.put("200002","入参错误");
        WX_CODE.put("300001","禁止创建/更新商品 或 禁止编辑&更新房间");
        WX_CODE.put("300002","名称长度不符合规则");
        WX_CODE.put("300006","图片上传失败（如 mediaID过期）");
        WX_CODE.put("300022","此房间号不存在");
        WX_CODE.put("300023","房间状态 拦截（当前房间状态不允许此操作）");
        WX_CODE.put("300024","商品不存在");
        WX_CODE.put("300025","商品审核未通过");
        WX_CODE.put("300026","房间商品数量已经满额");
        WX_CODE.put("300027","导入商品失败");
        WX_CODE.put("300028","房间名称违规");
        WX_CODE.put("300029","主播昵称违规");
        WX_CODE.put("300030","主播微信号不合法");
        WX_CODE.put("300031","直播间封面图不合规");
        WX_CODE.put("300032","直播间分享图违规");
        WX_CODE.put("300033","添加商品超过直播间上限");
        WX_CODE.put("300034","主播微信昵称长度不符合要求");
        WX_CODE.put("300035","主播微信号不存在");
        WX_CODE.put("300036","主播微信号未实名认证");
        WX_CODE.put("300037","购物直播频道封面图不合规");
        WX_CODE.put("300038","未在小程序管理后台配置客服");
        WX_CODE.put("300039","主播副号微信号不合法");
        WX_CODE.put("300040","名称含有非限定字符（含有特殊字符）");
        WX_CODE.put("300041","创建者微信号不合法");
        WX_CODE.put("300042","推流中禁止编辑房间");
        WX_CODE.put("300043","每天只允许一场直播开启关注");
        WX_CODE.put("300044","商品没有讲解视频");
        WX_CODE.put("300045","讲解视频未生成");
        WX_CODE.put("300046","讲解视频生成失败");
        WX_CODE.put("300047","已有商品正在推送，请稍后再试");
        WX_CODE.put("300048","拉取商品列表失败");
        WX_CODE.put("300049","商品推送过程中不允许上下架");
        WX_CODE.put("300050","排序商品列表为空");
        WX_CODE.put("300051","解析 JSON 出错");
        WX_CODE.put("300052","已下架的商品无法推送");
        WX_CODE.put("300053","直播间未添加此商品");
        WX_CODE.put("500001","副号不合规");
        WX_CODE.put("500002","副号未实名");
        WX_CODE.put("500003","已经设置过副号了，不能重复设置");
        WX_CODE.put("500004","不能设置重复的副号");
        WX_CODE.put("500005","副号不能和主号重复");
        WX_CODE.put("600001","用户已被添加为小助手");
        WX_CODE.put("600002","找不到用户");
        WX_CODE.put("9410000","直播间列表为空");
        WX_CODE.put("9410001","获取房间失败");
        WX_CODE.put("9410002","获取商品失败");
        WX_CODE.put("9410003","获取回放失败");
    }

    private void initWxCode(){
        WX_CODE.put("-1","系统繁忙");
        WX_CODE.put("0","请求成功");
        WX_CODE.put("40001","验证失败");
        WX_CODE.put("40002","不合法的凭证类型");
        WX_CODE.put("40003","不合法的OpenID");
        WX_CODE.put("40004","不合法的媒体文件类型");
        WX_CODE.put("40005","不合法的文件类型");
        WX_CODE.put("40006","不合法的文件大小");
        WX_CODE.put("40007","不合法的媒体文件id");
        WX_CODE.put("40008","不合法的消息类型");
        WX_CODE.put("40009","不合法的图片文件大小");
        WX_CODE.put("40010","不合法的语音文件大小");
        WX_CODE.put("40011","不合法的视频文件大小");
        WX_CODE.put("40012","不合法的缩略图文件大小");
        WX_CODE.put("40013","不合法的APPID");
        WX_CODE.put("40014","不合法的access_token");
        WX_CODE.put("40015","不合法的菜单类型");
        WX_CODE.put("40016","不合法的按钮个数");
        WX_CODE.put("40017","不合法的按钮个数");
        WX_CODE.put("40018","不合法的按钮名字长度");
        WX_CODE.put("40019","不合法的按钮KEY长度");
        WX_CODE.put("40020","不合法的按钮URL长度");
        WX_CODE.put("40021","不合法的菜单版本号");
        WX_CODE.put("40022","不合法的子菜单级数");
        WX_CODE.put("40023","不合法的子菜单按钮个数");
        WX_CODE.put("40024","不合法的子菜单按钮类型");
        WX_CODE.put("40025","不合法的子菜单按钮名字长度");
        WX_CODE.put("40026","不合法的子菜单按钮KEY长度");
        WX_CODE.put("40027","不合法的子菜单按钮URL长度");
        WX_CODE.put("40028","不合法的自定义菜单使用用户");
        WX_CODE.put("41001","缺少access_token参数");
        WX_CODE.put("41002","缺少appid参数");
        WX_CODE.put("41003","缺少refresh_token参数");
        WX_CODE.put("41004","缺少secret参数");
        WX_CODE.put("41005","缺少多媒体文件数据");
        WX_CODE.put("41006","缺少media_id参数");
        WX_CODE.put("41007","缺少子菜单数据");
        WX_CODE.put("42001","access_token超时");
        WX_CODE.put("43001","需要GET请求");
        WX_CODE.put("43002","需要POST请求");
        WX_CODE.put("43003","需要HTTPS请求");
        WX_CODE.put("44001","多媒体文件为空");
        WX_CODE.put("44002","POST的数据包为空");
        WX_CODE.put("44003","图文消息内容为空");
        WX_CODE.put("45001","多媒体文件大小超过限制");
        WX_CODE.put("45002","消息内容超过限制");
        WX_CODE.put("45003","标题字段超过限制");
        WX_CODE.put("45004","描述字段超过限制");
        WX_CODE.put("45005","链接字段超过限制");
        WX_CODE.put("45006","图片链接字段超过限制");
        WX_CODE.put("45007","语音播放时间超过限制");
        WX_CODE.put("45008","图文消息超过限制");
        WX_CODE.put("45009","接口调用超过限制");
        WX_CODE.put("45010","创建菜单个数超过限制");
        WX_CODE.put("46001","不存在媒体数据");
        WX_CODE.put("46002","不存在的菜单版本");
        WX_CODE.put("46003","不存在的菜单数据");
        WX_CODE.put("40029","登录多次导致code重复/appid和secret对应不上，不是同一个小程序");
    }

}
