package enums

type CommonErrorResult int

const (
	SUCCESSFUL      = 0
	REQUEST_ERROR   = 100
	SYS_ERROR   = 400
	REGISTER_FAIL   = 1001
	USER_LOGIN_FAIL = 1006
	CHECK_SMS_FAIL  = 1002
	REGISTER_PHONE_AGAIN = 1004
	REGISTER_ORGCODE_NOTEXISTS = 1005
	ETH_ACCESS_CREATE_ERROR = 1007
	GET_USER_INFO_ERROR = 1008
	ERROR_MSG_INFO = 1010
	ORM_INSER_ERROR = 2001
	ETH_DIAL_ERROR = 3001
	GENERE_FALID      = 4202

	MAX_FHL_BLOCK       = "max_fhl_block:"       //最大块号
	USE_FHL_BLOCK       = "use_fhl_block:"       //当前处理块号
	USE_SWAP_NFT       = "use_swap_nft:"       //当前处理块号
	USE_WITHDRAWAL       = "use_withdrawal:"       //用户提取

	USDRIDO = "Transfer" //转账
	GDLIDO = "Approval" //授权
	WITHDRAWAL = "newWithdraw" //提取
	NEWDEPOSIT = "newDeposit" //下注
	//WITHDRAWCONTRACT = "0x868c9fFfcA5483931219B624e4F6A3033Dfe7a3b"  //取款合约
	WITHDRAWCONTRACT = "0x5620CA8Ed0636d967c511bBB47a48460a9327f84"  //测试取款合约
	USDTMINTCONTRACT = "0x5620CA8Ed0636d967c511bBB47a48460a9327f84"//usdt正式申购
	//USDTMINTCONTRACT = "0x3Aa22DA9B16D9BBCf60A45aC598508fB3F05e92c" //测试申购合约事件
	//
	AMOUNTCONTRACT = "0xb544f5Cef94fE0B2C3BB3a4886ea8918Bbe444f5"  //获取价格
	VERIFYCONTRACT = "0x8e437A9a89E16ED807Ab1841C029e5e9C4A82c74"
	USDT = "0xa6ea066bae96432414ac62818e62e2ecaa570de3"   //usdt合约
	//GDLCONTRACT = "0x9830c7dbcff54eb564ef952e2e5634787fc1c5d8" //代币合约地址
	KTOCONTRACT = "0x3850D46C0442A86AaDd41D99f635e316c8788269"  //kto合约地址
	DIGIT = "0x8128156737e199741741741DDDDaAF70c665e95b43D010"       //签名验证的盐
)

func (c CommonErrorResult) String() string {
	switch (c) {
	case SUCCESSFUL:
		return "操作成功"
	case SYS_ERROR:
		return "系统异常"
	case REQUEST_ERROR:
		return "请重新登录"
	case REGISTER_FAIL:
		return "注册失败"
	case USER_LOGIN_FAIL:
		return "用户名或密码错误"
	case CHECK_SMS_FAIL:
		return "验证码错误或失效"
	case REGISTER_PHONE_AGAIN:
		return "该账户已被使用"
	case REGISTER_ORGCODE_NOTEXISTS:
		return "邀请码不存在"
	case ERROR_MSG_INFO:
		return "自定义错误返回"
	case ETH_ACCESS_CREATE_ERROR:
		return "钱包创建失败，稍后再试"
	case ORM_INSER_ERROR:
		return "数据创建出现错误"
	case GET_USER_INFO_ERROR:
		return "获取用户信息失败"
	case ETH_DIAL_ERROR:
		return "eth Dial not connect"
	case GENERE_FALID:
		return "GenerateKey is faild"
	default:
		return "UNKNOWN"
	}
}

