1
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
package ad_userinfo_transferopen
|
||||
|
||||
// 用户是否开启内部转账功能
|
||||
const (
|
||||
Close = 1 // 关闭
|
||||
Open = 3 // 开启
|
||||
)
|
||||
@ -0,0 +1,6 @@
|
||||
package agent_account_source
|
||||
|
||||
const (
|
||||
UserRegister = 1 // 用户注册
|
||||
SystemRegister = 3 // 系统添加
|
||||
)
|
||||
@ -0,0 +1,7 @@
|
||||
package agent_account_status
|
||||
|
||||
const (
|
||||
Wait = 1 // 待审核
|
||||
Audited = 3 // 已通过
|
||||
Reject = 5 // 已拒绝
|
||||
)
|
||||
@ -0,0 +1,6 @@
|
||||
package agent_reward_category
|
||||
|
||||
const (
|
||||
Straight = 1 // 直客佣金
|
||||
Agent = 3 // 代理佣金
|
||||
)
|
||||
96
common/const/enum/businesstype/businesstype.go
Normal file
96
common/const/enum/businesstype/businesstype.go
Normal file
@ -0,0 +1,96 @@
|
||||
package businesstype
|
||||
|
||||
// BusinessType 操作业务
|
||||
type BusinessType int
|
||||
|
||||
const (
|
||||
// 注册登录业务
|
||||
Other BusinessType = 0 // 其他
|
||||
Register BusinessType = 1 // 注册
|
||||
Login BusinessType = 2 // 登入
|
||||
ResetPass BusinessType = 3 // 找回密码
|
||||
ChangePassword BusinessType = 4 // 更改密码
|
||||
ScanLogin BusinessType = 14 // 扫码登入
|
||||
|
||||
// 身份验证专用业务类型(请勿占用)
|
||||
OpenPhoneAuth BusinessType = 11
|
||||
ChangePhoneAuth BusinessType = 21
|
||||
ClosePhoneAuth BusinessType = 31
|
||||
OpenEmailAuth BusinessType = 12
|
||||
ChangeEmailAuth BusinessType = 22
|
||||
CloseEmailAuth BusinessType = 32
|
||||
OpenGoogleAuth BusinessType = 13
|
||||
ChangeGoogleAuth BusinessType = 23
|
||||
CloseGoogleAuth BusinessType = 33
|
||||
|
||||
//提现验证使用
|
||||
WithdrawAuth BusinessType = 201
|
||||
//userkey验证
|
||||
UserKeyAuth BusinessType = 202
|
||||
//地址浦
|
||||
AddAddress BusinessType = 203
|
||||
|
||||
// 以下请从 100 开始定义
|
||||
OtcCaptcha BusinessType = 100 // OTC 验证码
|
||||
AddPayAccount BusinessType = 101 // 新增收款账号
|
||||
EditPayAccount BusinessType = 102 // 编辑收款账号
|
||||
OTCSellerConfirmPay BusinessType = 103 // OTC 卖家已确认收款
|
||||
OTCSellerAppeal BusinessType = 104 // OTC 买家申诉
|
||||
OTCBuyerPaid BusinessType = 105 // OTC 买家已付款
|
||||
OTCBuyerAppeal BusinessType = 106 // OTC 买家申诉
|
||||
AgentEmailCode BusinessType = 107 // 代理商找回密码验证码
|
||||
)
|
||||
|
||||
// 业务类型中文映射
|
||||
var BusinessTypeMapCN = map[BusinessType]string{
|
||||
Other: "其它",
|
||||
Register: "注册",
|
||||
Login: "登录",
|
||||
ResetPass: "重置密码",
|
||||
ChangePassword: "修改登录密码",
|
||||
|
||||
OpenPhoneAuth: "开启手机验证",
|
||||
ChangePhoneAuth: "更改手机验证",
|
||||
ClosePhoneAuth: "关闭手机验证",
|
||||
OpenEmailAuth: "开启邮箱验证",
|
||||
ChangeEmailAuth: "更改邮箱验证",
|
||||
CloseEmailAuth: "关闭邮箱验证",
|
||||
OpenGoogleAuth: "开启谷歌验证",
|
||||
ChangeGoogleAuth: "更改谷歌验证",
|
||||
CloseGoogleAuth: "关闭谷歌验证",
|
||||
|
||||
WithdrawAuth: "提现验证",
|
||||
UserKeyAuth: "api验证",
|
||||
AddAddress: "新增地址浦验证",
|
||||
|
||||
OtcCaptcha: "OTC验证码",
|
||||
AddPayAccount: "新增收款账号",
|
||||
EditPayAccount: "编辑收款账号",
|
||||
}
|
||||
|
||||
// 业务类型英文映射
|
||||
var BusinessTypeMapEN = map[BusinessType]string{
|
||||
Other: "Other",
|
||||
Register: "Register",
|
||||
Login: "Login",
|
||||
ResetPass: "Reset Password",
|
||||
ChangePassword: "Change Login Password",
|
||||
|
||||
OpenPhoneAuth: "Enable mobile phone verification",
|
||||
ChangePhoneAuth: "Change phone verification",
|
||||
ClosePhoneAuth: "Turn off phone verification",
|
||||
OpenEmailAuth: "Enable mailbox verification",
|
||||
ChangeEmailAuth: "Change mailbox validation",
|
||||
CloseEmailAuth: "Turn off mailbox verification",
|
||||
OpenGoogleAuth: "Turn on Google Authentication",
|
||||
ChangeGoogleAuth: "Change Google Authentication",
|
||||
CloseGoogleAuth: "Turn off Google Authentication",
|
||||
|
||||
WithdrawAuth: "Withdraw Auth",
|
||||
UserKeyAuth: "UserKey Auth",
|
||||
AddAddress: "AddAddress Auth",
|
||||
|
||||
OtcCaptcha: "otc phone verification",
|
||||
AddPayAccount: "otc add payaccount",
|
||||
EditPayAccount: "otc edit payaccount",
|
||||
}
|
||||
8
common/const/enum/cointype/cointype.go
Normal file
8
common/const/enum/cointype/cointype.go
Normal file
@ -0,0 +1,8 @@
|
||||
package cointype
|
||||
|
||||
// cointype
|
||||
const (
|
||||
BTC int = 1 // BTC
|
||||
USDT int = 2 // USDT
|
||||
USD int = 3 // USD
|
||||
)
|
||||
10
common/const/enum/culatortype/calculatortype.go
Normal file
10
common/const/enum/culatortype/calculatortype.go
Normal file
@ -0,0 +1,10 @@
|
||||
package culatortype
|
||||
|
||||
// CulatorType 计算器
|
||||
const (
|
||||
Income int = 1 // 收益
|
||||
TargetPrice int = 2 // 目标价格
|
||||
FlatPrice int = 3 // 强平价格
|
||||
OpenEable int = 4 // 可开
|
||||
OpenPrice int = 5 // 开仓价格
|
||||
)
|
||||
39
common/const/enum/dealtype/dealtype.go
Normal file
39
common/const/enum/dealtype/dealtype.go
Normal file
@ -0,0 +1,39 @@
|
||||
package dealtype
|
||||
|
||||
// DealType 资金小类型:1买单,2卖单,3手续费,4划转(废弃),5已实现盈亏,6爆仓精算,7资金费用 13内部转入 14 内部转出 101现货划转合约 102 合约划转现货 103 现货转法币 104 法币转现货 105 币本位划转现货 106 现货划转到币本位
|
||||
// 说明: 13-106之间不能插入其他数值
|
||||
const (
|
||||
Buy int = 1 // 1买单
|
||||
Sell int = 2 // 2卖单
|
||||
BrokerAge int = 3 // 手续费
|
||||
Transfer int = 4 // 划转(废弃)
|
||||
Profited int = 5 // 已实现盈亏
|
||||
LossFee int = 6 // 爆仓精算
|
||||
FundFee int = 7 // 资金费用
|
||||
InTransfer int = 13 // 内部转入
|
||||
OutTransfer int = 14 // 内部转出
|
||||
VtsToFut int = 101 // 现货划转合约
|
||||
FutToVts int = 102 // 合约转现货
|
||||
VtsToOtc int = 103 // 现货转法币
|
||||
OtcToVts int = 104 // 法币转现货
|
||||
FutCoinToVts int = 105 // 币本位划转现货
|
||||
VtsToFutCoin int = 106 // 现货划转到币本位
|
||||
)
|
||||
|
||||
var Types = map[int]string{
|
||||
Buy: "买单",
|
||||
Sell: "卖单",
|
||||
BrokerAge: "手续费",
|
||||
Transfer: "划转",
|
||||
Profited: "已实现盈亏",
|
||||
LossFee: "爆仓精算",
|
||||
FundFee: "资金费用",
|
||||
InTransfer: "内部转入",
|
||||
OutTransfer: "内部转出",
|
||||
VtsToFut: "现货划转合约",
|
||||
FutToVts: "合约转现货",
|
||||
VtsToOtc: "现货转法币",
|
||||
OtcToVts: "法币转现货",
|
||||
FutCoinToVts: "币本位划转现货",
|
||||
VtsToFutCoin: "现货划转到币本位",
|
||||
}
|
||||
7
common/const/enum/enable/enable.go
Normal file
7
common/const/enum/enable/enable.go
Normal file
@ -0,0 +1,7 @@
|
||||
package enable
|
||||
|
||||
// 是否启用(通用)
|
||||
const (
|
||||
Disable = 1 // 禁用
|
||||
Enable = 3 // 启用
|
||||
)
|
||||
6
common/const/enum/fut_coin_type/fut_coin_type.go
Normal file
6
common/const/enum/fut_coin_type/fut_coin_type.go
Normal file
@ -0,0 +1,6 @@
|
||||
package fut_coin_type
|
||||
|
||||
const (
|
||||
USDT = 1 // U本位
|
||||
COIN = 2 // 币本位
|
||||
)
|
||||
7
common/const/enum/grid_buytype/grid_buytype.go
Normal file
7
common/const/enum/grid_buytype/grid_buytype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package grid_buytype
|
||||
|
||||
// 交易网格买卖类型
|
||||
const (
|
||||
Buy = 1 // 买
|
||||
Sell = 2 // 卖
|
||||
)
|
||||
7
common/const/enum/grid_createtype/grid_createtype.go
Normal file
7
common/const/enum/grid_createtype/grid_createtype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package grid_createtype
|
||||
|
||||
// 交易网格创建方式
|
||||
const (
|
||||
OneCreation = 1 // 一键创建
|
||||
ManualCreation = 2 // 手动创建
|
||||
)
|
||||
8
common/const/enum/grid_dealtype/grid_dealtype.go
Normal file
8
common/const/enum/grid_dealtype/grid_dealtype.go
Normal file
@ -0,0 +1,8 @@
|
||||
package grid_dealtype
|
||||
|
||||
// 交易网格资金流水类型
|
||||
const (
|
||||
Occupy = 1 // 策略占用
|
||||
Release = 2 // 策略释放
|
||||
Profit = 3 // 策略利润
|
||||
)
|
||||
7
common/const/enum/grid_netmode/grid_netmode.go
Normal file
7
common/const/enum/grid_netmode/grid_netmode.go
Normal file
@ -0,0 +1,7 @@
|
||||
package grid_netmode
|
||||
|
||||
// 现货交易网格模式
|
||||
const (
|
||||
EqualRatio = 1 // 等比
|
||||
EqualDifference = 2 // 等差
|
||||
)
|
||||
@ -0,0 +1,9 @@
|
||||
package grid_spotorder_status
|
||||
|
||||
// 现货交易网格委托单状态
|
||||
const (
|
||||
UnDeal = 1 // 未成交
|
||||
Partial = 2 // 部分成交
|
||||
Complete = 3 // 完成成交
|
||||
Cancel = 4 // 取消
|
||||
)
|
||||
@ -0,0 +1,13 @@
|
||||
package grid_spotpolicy_state
|
||||
|
||||
// 现货交易网格状态
|
||||
const (
|
||||
Wait = 1 // 等待触发
|
||||
Starting = 2 // 正在启动
|
||||
Start = 3 // 启动完成
|
||||
Stopping = 4 // 正在停止
|
||||
ManualStop = 5 // 手动停止
|
||||
ProfitStop = 6 // 止盈停止
|
||||
LossStop = 7 // 止损停止
|
||||
SignalStop = 8 // 信号触发停止
|
||||
)
|
||||
7
common/const/enum/grid_triggertype/grid_triggertype.go
Normal file
7
common/const/enum/grid_triggertype/grid_triggertype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package grid_triggertype
|
||||
|
||||
// 交易网格触发条件
|
||||
const (
|
||||
Immediately = 1 // 立即触发
|
||||
Price = 2 // 价格触发
|
||||
)
|
||||
@ -0,0 +1,9 @@
|
||||
package holddaylog_chart_daytype
|
||||
|
||||
// 1==24小时 3==7天 5==30天 7=3个月
|
||||
const (
|
||||
Hour_24 = 1 // 24小时
|
||||
Day_7 = 3 // 7天
|
||||
Day_30 = 5 // 30天
|
||||
Month_3 = 7 // 3个月
|
||||
)
|
||||
54
common/const/enum/kyctype/kyctype.go
Normal file
54
common/const/enum/kyctype/kyctype.go
Normal file
@ -0,0 +1,54 @@
|
||||
package kyctype
|
||||
|
||||
// IdCardLevel 身份等级
|
||||
type IdCardLevel int
|
||||
|
||||
const (
|
||||
// Junior 初级认证
|
||||
Junior IdCardLevel = 1
|
||||
|
||||
// Middle 中级认证
|
||||
Middle IdCardLevel = 2
|
||||
|
||||
// Senior 高级认证
|
||||
Senior IdCardLevel = 3
|
||||
)
|
||||
|
||||
// IdCardState 审核状态
|
||||
type IdCardState int
|
||||
|
||||
const (
|
||||
// UnAuth 待审核
|
||||
UnAuth IdCardState = 1
|
||||
|
||||
// AuthFailed 审核失败
|
||||
AuthFailed IdCardState = 2
|
||||
|
||||
// AuthSuccess 审核完成
|
||||
AuthSuccess IdCardState = 3
|
||||
)
|
||||
|
||||
// IdCardType 审核类型
|
||||
type IdCardType int
|
||||
|
||||
const (
|
||||
// IdCard 身份证
|
||||
IdCard IdCardType = 1
|
||||
|
||||
// Passport 护照
|
||||
Passport IdCardType = 2
|
||||
|
||||
// Drive 驾照
|
||||
Drive IdCardType = 3
|
||||
)
|
||||
|
||||
// VerifyType 审核类型
|
||||
type VerifyType int
|
||||
|
||||
const (
|
||||
// Third 第三方审核
|
||||
Third VerifyType = 1
|
||||
|
||||
// System 系统审核
|
||||
System VerifyType = 2
|
||||
)
|
||||
13
common/const/enum/language_map.go
Normal file
13
common/const/enum/language_map.go
Normal file
@ -0,0 +1,13 @@
|
||||
package enum
|
||||
|
||||
// 语言
|
||||
var LanguageMap = map[string]string{
|
||||
"en": "英语",
|
||||
"jp": "日本语",
|
||||
"kr": "韩语",
|
||||
"my": "马来西亚语",
|
||||
"th": "泰国语",
|
||||
"vn": "越南语",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-HK": "繁体中文",
|
||||
}
|
||||
24
common/const/enum/logtype/logtype.go
Normal file
24
common/const/enum/logtype/logtype.go
Normal file
@ -0,0 +1,24 @@
|
||||
package logtype
|
||||
|
||||
// LogType 日志类型
|
||||
type LogType int
|
||||
|
||||
const (
|
||||
Min LogType = iota // 最小值
|
||||
Login // 登入
|
||||
Logout // 登出
|
||||
Create // 新增
|
||||
Update // 编辑
|
||||
Delete // 删除
|
||||
ChangePwd // 修改密码
|
||||
Max // 最大值
|
||||
)
|
||||
|
||||
var LogTypeMap = map[LogType]string{
|
||||
Login: "登入",
|
||||
Logout: "登出",
|
||||
Create: "新增",
|
||||
Update: "编辑",
|
||||
Delete: "删除",
|
||||
ChangePwd: "修改密码",
|
||||
}
|
||||
7
common/const/enum/longshorttype/longshorttype.go
Normal file
7
common/const/enum/longshorttype/longshorttype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package longshorttype
|
||||
|
||||
// longshorttype
|
||||
const (
|
||||
Long = 1 // 做多
|
||||
Short = 2 // 做空
|
||||
)
|
||||
10
common/const/enum/ordertype/ordertype.go
Normal file
10
common/const/enum/ordertype/ordertype.go
Normal file
@ -0,0 +1,10 @@
|
||||
package ordertype
|
||||
|
||||
//订单类型:1限价,2限价止盈止损,3市价,4止盈止损市价单,5系统强平委托
|
||||
const (
|
||||
Limit = 1 //限价单,下单类型
|
||||
StopLimit = 2 //止盈止损限价单,下单类型
|
||||
Market = 3 //市价单,下单类型
|
||||
StopMarket = 4 //止盈止损市价单,下单类型
|
||||
Force = 5 //系统强平委托
|
||||
)
|
||||
@ -0,0 +1,8 @@
|
||||
package otc_advaduitstatus
|
||||
|
||||
// otc广告审核状态
|
||||
const (
|
||||
Pending = 1 // 待审核
|
||||
Pass = 3 // 审核通过
|
||||
Reject = 5 // 审核拒绝
|
||||
)
|
||||
7
common/const/enum/otc_advertisetype/otc_advertisetype.go
Normal file
7
common/const/enum/otc_advertisetype/otc_advertisetype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_advertisetype
|
||||
|
||||
// 广告类型
|
||||
const (
|
||||
Buy = 1 // 购买
|
||||
Sell = 3 // 出售
|
||||
)
|
||||
7
common/const/enum/otc_advstatus/otc_advstatus.go
Normal file
7
common/const/enum/otc_advstatus/otc_advstatus.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_advstatus
|
||||
|
||||
// otc广告状态
|
||||
const (
|
||||
Offline = 1 // 下线
|
||||
Online = 3 // 上线
|
||||
)
|
||||
10
common/const/enum/otc_appealprogress/otc_appealprogress.go
Normal file
10
common/const/enum/otc_appealprogress/otc_appealprogress.go
Normal file
@ -0,0 +1,10 @@
|
||||
package otc_appealprogress
|
||||
|
||||
//申诉进程
|
||||
const (
|
||||
WaitDefendantProcess = 1 // 等待被诉方处理
|
||||
WaitAppealProcess = 3 // 等待申诉方处理
|
||||
Revoked = 5 // 已撤销
|
||||
WaitCustomer = 7 // 等待客服处理
|
||||
Arbitrated = 9 // 已仲裁
|
||||
)
|
||||
19
common/const/enum/otc_appealreason/otc_appealreason.go
Normal file
19
common/const/enum/otc_appealreason/otc_appealreason.go
Normal file
@ -0,0 +1,19 @@
|
||||
package otc_appealreason
|
||||
|
||||
// 申诉原因
|
||||
const (
|
||||
Paid = 1 // 我已付款,卖家未放行
|
||||
PayMore = 3 // 我向卖家多转了钱
|
||||
NotPay = 5 // 我没有收到买家付款
|
||||
MoneyErr = 7 // 买家付款金额不对
|
||||
Other = 9 // 其他
|
||||
|
||||
)
|
||||
|
||||
var Types = map[int]string{
|
||||
Paid: "我已付款,卖家未放行",
|
||||
PayMore: "我向卖家多转了钱",
|
||||
NotPay: "我没有收到买家付款",
|
||||
MoneyErr: "买家付款金额不对",
|
||||
Other: "其他",
|
||||
}
|
||||
8
common/const/enum/otc_appealstatus/otc_appealstatus.go
Normal file
8
common/const/enum/otc_appealstatus/otc_appealstatus.go
Normal file
@ -0,0 +1,8 @@
|
||||
package otc_appealstatus
|
||||
|
||||
// otc仲裁状态
|
||||
const (
|
||||
Not = 1 // 未仲裁
|
||||
BuyerWin = 3 // 买家胜,放行
|
||||
SellerWin = 5 // 卖家胜,取消订单
|
||||
)
|
||||
6
common/const/enum/otc_auditlevel/otc_auditlevel.go
Normal file
6
common/const/enum/otc_auditlevel/otc_auditlevel.go
Normal file
@ -0,0 +1,6 @@
|
||||
package otc_auditlevel
|
||||
|
||||
// 商家认证等级
|
||||
const (
|
||||
Certified = 3 // 认证商家
|
||||
)
|
||||
@ -0,0 +1,8 @@
|
||||
package otc_chatlogsourcetype
|
||||
|
||||
// 消息来源
|
||||
const (
|
||||
Android = 1
|
||||
Ios = 3
|
||||
Pc = 5
|
||||
)
|
||||
7
common/const/enum/otc_chatlogstatus/otc_chatlogstatus.go
Normal file
7
common/const/enum/otc_chatlogstatus/otc_chatlogstatus.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_chatlogstatus
|
||||
|
||||
// 聊天发送状态
|
||||
const (
|
||||
Fail = 1 // 发送失败
|
||||
Success = 3 // 发送成功
|
||||
)
|
||||
8
common/const/enum/otc_chattype/otc_chattype.go
Normal file
8
common/const/enum/otc_chattype/otc_chattype.go
Normal file
@ -0,0 +1,8 @@
|
||||
package otc_chattype
|
||||
|
||||
// 通讯软件类型
|
||||
const (
|
||||
Telegram = 1
|
||||
Wechat = 3
|
||||
QQ = 5
|
||||
)
|
||||
7
common/const/enum/otc_complaint/otc_complaint.go
Normal file
7
common/const/enum/otc_complaint/otc_complaint.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_complaint
|
||||
|
||||
// otc申诉方
|
||||
const (
|
||||
Buyer = 1 // 买方
|
||||
Seller = 3 // 卖方
|
||||
)
|
||||
8
common/const/enum/otc_consult/otc_consult.go
Normal file
8
common/const/enum/otc_consult/otc_consult.go
Normal file
@ -0,0 +1,8 @@
|
||||
package otc_consult
|
||||
|
||||
// otc协商结果
|
||||
const (
|
||||
Not = 1 // 未协商
|
||||
Unable = 3 // 无法协商
|
||||
Negotiated = 5 // 协商解决
|
||||
)
|
||||
20
common/const/enum/otc_holdlogdealtype/otc_holdlogdealtype.go
Normal file
20
common/const/enum/otc_holdlogdealtype/otc_holdlogdealtype.go
Normal file
@ -0,0 +1,20 @@
|
||||
package otc_holdlogdealtype
|
||||
|
||||
// otc 资金类型
|
||||
const (
|
||||
Buy = 1 // 买入
|
||||
Sell = 3 // 卖出
|
||||
Frozen = 7 // 冻结
|
||||
AppendBond = 9 // 追加保证金
|
||||
UnFreeze = 11 // 解冻
|
||||
Deduct = 13 // 扣除保证金
|
||||
VtsToOtc = 103 // 现货转法币
|
||||
OtcToVts = 104 // 法币转现货
|
||||
Buckle = 105 // 划扣
|
||||
SaleAdviserAdd = 201 // 出售广告添加
|
||||
SaleAdviserEdit = 203 // 出售广告编辑
|
||||
MerchantUnVerify = 205 // 商家解除认证 保证金将解除冻结
|
||||
MerchantAdd = 207 // 法币商家新增
|
||||
MerchantEdit = 209 // 法币商家编辑
|
||||
MerchantFrozenBond = 210 // 法币商家冻结保证金
|
||||
)
|
||||
7
common/const/enum/otc_holdstatus/otc_holdstatus.go
Normal file
7
common/const/enum/otc_holdstatus/otc_holdstatus.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_holdstatus
|
||||
|
||||
// otc 账户状态
|
||||
const (
|
||||
Frozen = 1 // 冻结
|
||||
Normal = 3 // 正常
|
||||
)
|
||||
8
common/const/enum/otc_linktype/otc_linktype.go
Normal file
8
common/const/enum/otc_linktype/otc_linktype.go
Normal file
@ -0,0 +1,8 @@
|
||||
package otc_linktype
|
||||
|
||||
// 紧急联系人类型
|
||||
const (
|
||||
Family = 1 // 家人
|
||||
Friend = 3 // 朋友
|
||||
Colleague = 5 // 同事
|
||||
)
|
||||
@ -0,0 +1,7 @@
|
||||
package otc_merchantout_status
|
||||
|
||||
const (
|
||||
Wait = 1 // 待处理
|
||||
Passed = 3 // 已通过
|
||||
Rejected = 5 // 不通过
|
||||
)
|
||||
11
common/const/enum/otc_merchantstatus/otc_merchantstatus.go
Normal file
11
common/const/enum/otc_merchantstatus/otc_merchantstatus.go
Normal file
@ -0,0 +1,11 @@
|
||||
package otc_merchantstatus
|
||||
|
||||
// otc商家状态:1 申请中,3 不通过,5 正常,7 已禁用,9 已解除认证
|
||||
const (
|
||||
Applying = 1 // 申请中
|
||||
Fail = 3 // 不通过
|
||||
Normal = 5 // 正常
|
||||
Disabled = 7 // 已禁用
|
||||
Revoked = 9 // 已解除认证
|
||||
BondNoEnough = 11 // 保证金不足
|
||||
)
|
||||
7
common/const/enum/otc_msgtype/otc_msgtype.go
Normal file
7
common/const/enum/otc_msgtype/otc_msgtype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_msgtype
|
||||
|
||||
// otc 聊天消息类型
|
||||
const (
|
||||
Text = 1 // 文本
|
||||
Image = 3 // 图片
|
||||
)
|
||||
9
common/const/enum/otc_orderstatus/otc_orderstatus.go
Normal file
9
common/const/enum/otc_orderstatus/otc_orderstatus.go
Normal file
@ -0,0 +1,9 @@
|
||||
package otc_orderstatus
|
||||
|
||||
const (
|
||||
UnPay = 1 // 未付款
|
||||
WaitMoney = 3 // 待放币
|
||||
Complete = 5 // 已完成
|
||||
Complain = 7 // 申诉中
|
||||
Cancel = 9 // 已取消
|
||||
)
|
||||
7
common/const/enum/otc_ordertype/otc_ordertype.go
Normal file
7
common/const/enum/otc_ordertype/otc_ordertype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_ordertype
|
||||
|
||||
// 订单方向
|
||||
const (
|
||||
Buy = 1 // 买
|
||||
Sell = 3 // 卖
|
||||
)
|
||||
7
common/const/enum/otc_pricetype/otc_pricetype.go
Normal file
7
common/const/enum/otc_pricetype/otc_pricetype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_pricetype
|
||||
|
||||
//定价方式
|
||||
const (
|
||||
Fix = 1 // 固定价格
|
||||
Float = 3 // 浮动价格
|
||||
)
|
||||
10
common/const/enum/otc_progress/otc_progress.go
Normal file
10
common/const/enum/otc_progress/otc_progress.go
Normal file
@ -0,0 +1,10 @@
|
||||
package otc_progress
|
||||
|
||||
// otc申诉进程
|
||||
const (
|
||||
WaitSellerHandle = 1 // 等待卖家处理
|
||||
WaitBuyerHandle = 3 // 等待买家处理
|
||||
Revoked = 5 // 已撤销申诉
|
||||
WaitCustomer = 7 // 等待客服处理
|
||||
Arbitrated = 9 // 已仲裁
|
||||
)
|
||||
7
common/const/enum/otc_rateway/otc_rateway.go
Normal file
7
common/const/enum/otc_rateway/otc_rateway.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_rateway
|
||||
|
||||
//浮动方式
|
||||
const (
|
||||
Up = 1 // 上浮
|
||||
Down = 3 // 下浮
|
||||
)
|
||||
7
common/const/enum/otc_tradetype/otc_tradetype.go
Normal file
7
common/const/enum/otc_tradetype/otc_tradetype.go
Normal file
@ -0,0 +1,7 @@
|
||||
package otc_tradetype
|
||||
|
||||
// 交易区
|
||||
const (
|
||||
Fast = 1 // 快捷区
|
||||
Self = 3 // 自选区
|
||||
)
|
||||
7
common/const/enum/showhide/showhide.go
Normal file
7
common/const/enum/showhide/showhide.go
Normal file
@ -0,0 +1,7 @@
|
||||
package showhide
|
||||
|
||||
// 是否隐藏账号(通用)
|
||||
const (
|
||||
Hide = 1 // 隐藏
|
||||
Show = 3 // 显示
|
||||
)
|
||||
25
common/const/enum/smstemplate/sms_template.go
Normal file
25
common/const/enum/smstemplate/sms_template.go
Normal file
@ -0,0 +1,25 @@
|
||||
package smstemplate
|
||||
|
||||
// 短信模板 Key 命名规则:SmsTemplate_BusinessType_Language
|
||||
const (
|
||||
// 通用业务模板 - 中文
|
||||
SmsTemplate_1_CN = "您正在进行【${business}】,验证码:${code},5分钟内有效,请勿泄露给任何人。如非本人操作请立即联系官方客服。"
|
||||
// 通用业务模板 - 英文
|
||||
SmsTemplate_1_EN = "Are you doing [${business}] Verification code: ${code}, valid within 5 minutes, please do not disclose it to anyone."
|
||||
// 卖家已确认收款_CN
|
||||
SmsTemplate_2_CN = "订单号 ${ordersn},卖家已确认收款,订单已完成,请前往账户查收资产。"
|
||||
// 卖家已确认收款_EN
|
||||
SmsTemplate_2_EN = "Order number ${ordersn}, the seller has confirmed the payment, the order has been completed, please go to the account to check the assets."
|
||||
// 卖家申诉_CN
|
||||
SmsTemplate_3_CN = "订单号 ${ordersn},卖家已发起申诉,请尽快前往处理该订单申诉。"
|
||||
// 卖家申诉_EN
|
||||
SmsTemplate_3_EN = "Order number ${ordersn}, the seller has initiated an appeal, please go to the appeal as soon as possible."
|
||||
// 买家已付款_CN
|
||||
SmsTemplate_4_CN = "订单号 ${ordersn},买家已付款,请查收款项进行放行。"
|
||||
// 买家已付款_EN
|
||||
SmsTemplate_4_EN = "Order number ${ordersn}, the buyer has paid, please check the payment for release."
|
||||
// 买家申诉_CN
|
||||
SmsTemplate_5_CN = "订单号 ${ordersn},买家已发起申诉,请尽快处理该订单申诉。"
|
||||
// 买家申诉_EN
|
||||
SmsTemplate_5_EN = "Order number ${ordersn}, the buyer has initiated an appeal, please handle the order appeal as soon as possible."
|
||||
)
|
||||
10
common/const/enum/transfertype/transfertype.go
Normal file
10
common/const/enum/transfertype/transfertype.go
Normal file
@ -0,0 +1,10 @@
|
||||
package transfertype
|
||||
|
||||
const (
|
||||
Vts2Fut = 1 // 现货划转合约
|
||||
Fut2Vts = 2 // 合约划转现货
|
||||
Vts2Otc = 3 // 现货划转Otc
|
||||
Otc2Vts = 4 // Otc划转现货
|
||||
FutCoin2Vts = 5 // 币本位划转现货
|
||||
Vts2FutCoin = 6 // 现货划转到币本位
|
||||
)
|
||||
7
common/const/enum/usefree/usefreee.go
Normal file
7
common/const/enum/usefree/usefreee.go
Normal file
@ -0,0 +1,7 @@
|
||||
package usefree
|
||||
|
||||
// usefree
|
||||
const (
|
||||
Available = 1 // 可用
|
||||
Frozen = 2 // 冻结
|
||||
)
|
||||
@ -0,0 +1,8 @@
|
||||
package vts_alertset_frequency
|
||||
|
||||
// frequency 提醒频率
|
||||
const (
|
||||
OnlyOnce = 1 // 仅提醒一次
|
||||
OnceDay = 2 // 每日提醒一次
|
||||
Always = 3 // 持续提醒(每当价格达到该值,则提醒一次)
|
||||
)
|
||||
@ -0,0 +1,7 @@
|
||||
package vts_alertset_state
|
||||
|
||||
// state 设置状态
|
||||
const (
|
||||
Normal = 1 // 正常
|
||||
Stop = 2 // 停止(比如频率是只提醒一次,提醒一次完就修改为2)
|
||||
)
|
||||
11
common/const/enum/vts_alertset_type/vts_alertset_type.go
Normal file
11
common/const/enum/vts_alertset_type/vts_alertset_type.go
Normal file
@ -0,0 +1,11 @@
|
||||
package vts_alertset_type
|
||||
|
||||
// alerttype 预警类型
|
||||
const (
|
||||
RisesAbove = 1 //1 价格涨到
|
||||
DropTo = 2 //2 价格跌到
|
||||
ChangeOver = 3 //3 涨幅达到
|
||||
ChangeUnder = 4 //4 跌幅达到
|
||||
H24ChangeOver = 5 //5 h24小时涨幅
|
||||
H24ChangeUnder = 6 //6 h24小时跌幅
|
||||
)
|
||||
43
common/const/enum/warehousetype/warehousetype.go
Normal file
43
common/const/enum/warehousetype/warehousetype.go
Normal file
@ -0,0 +1,43 @@
|
||||
package warehousetype
|
||||
|
||||
// WareHouse
|
||||
const (
|
||||
Isolated = 1 // 逐仓
|
||||
Cross = 2 // 全仓
|
||||
)
|
||||
|
||||
// DirectHouse 持仓模式
|
||||
const (
|
||||
OneWayMode = 1 // 单向持仓
|
||||
HedgeMode = 2 // 双向持仓
|
||||
)
|
||||
|
||||
// 下单持仓类型 1开多 2平多 3开空 4平空
|
||||
const (
|
||||
BuyLong = iota + 1 // 开多
|
||||
SellLog // 平多
|
||||
SellShort // 开空
|
||||
BuyShort // 平空
|
||||
)
|
||||
|
||||
const (
|
||||
BOTH = "both"
|
||||
LONG = "long"
|
||||
SHORT = "short"
|
||||
)
|
||||
|
||||
var (
|
||||
PosSide = []string{BOTH, LONG, SHORT} // 持仓方向集合
|
||||
)
|
||||
|
||||
const (
|
||||
Buy = 1 // 下单方向买
|
||||
Sell = 2 // 下单方向卖
|
||||
)
|
||||
const (
|
||||
PositionTypeOpen = 1 // 开仓
|
||||
PositionTypeCloseOpen = 2 // 反向开仓
|
||||
PositionTypeClose = 3 // 平仓
|
||||
PositionTypeForce = 4 // 系统强平
|
||||
PositionTypeSysClose = 5 // 系统平仓
|
||||
)
|
||||
7
common/const/enum/yesno/yesno.go
Normal file
7
common/const/enum/yesno/yesno.go
Normal file
@ -0,0 +1,7 @@
|
||||
package yesno
|
||||
|
||||
// 是否(通用)
|
||||
const (
|
||||
No = 1 // 否
|
||||
Yes = 3 // 是
|
||||
)
|
||||
62
common/const/rediskey/redis_key.go
Normal file
62
common/const/rediskey/redis_key.go
Normal file
@ -0,0 +1,62 @@
|
||||
package rediskey
|
||||
|
||||
const (
|
||||
IPPositionCache = "_IPPositionCache" // IP 归属地缓存
|
||||
AppLoginUserToken = "_AppLoginUserToken_%d" // App登录用户的Token {uid}
|
||||
AgentLoginUserToken = "_AgentLoginUserToken_%d" // PC端代理商登录用户的Token
|
||||
AgentEmailCode = "_AgentEmailCode_%d"
|
||||
AdminLoginUserToken = "_AdminLoginUserToken_%d" // 后台登录用户的Token {uid}
|
||||
PCLoginUserToken = "_PCLoginUserToken_%d" // PC端登录token
|
||||
UserLoginPwdErrFre = "_UserLoginPwdErrFre_%d" // 用户登录密码错误次数 {uid}
|
||||
UserCaptchaSendFre = "_UserCaptchaSendFre_%v_%d" // 用户验证码发送频次 {uid|ip}_{business}
|
||||
UserLoginWsClient = "_UserLoginWsClient" // websocket连接的客户端
|
||||
ScanLoginSecret = "_ScanLoginSecret_%v" // 扫码登录秘钥
|
||||
StatusCodeLanguage = "_StatusCodeLanguage_%v" // 状态码语言包_en
|
||||
PCRegisterEmail = "_PCRegister_%v" // 用户注册时邮箱key
|
||||
PCRegisterMobile = "_PCRegisterMobile_%v" // 用户注册时手机key
|
||||
SpotSymbolTicker = "_SpotSymbolTicker_" // 现货交易对行情
|
||||
FutSymbolTicker = "_FutSymbolTicker_" // 合约交易对行情
|
||||
PreOrderScriptList = "_ProOrderScriptList_" // 脚本执行list
|
||||
PreSpotOrderList = "_PreSpotOrderList_:%s" // 待触发的现货订单集合{交易所类型 exchange_type}
|
||||
PreFutOrderList = "_PreFutOrderList_:%s" // 待触发的订单集合 {交易所类型 exchange_type}
|
||||
|
||||
API_USER = "api_user:%v" // api用户
|
||||
SystemSetting = "system_setting" //系统设置
|
||||
ApiGroup = "api_group:%v" //api用户组 {id}
|
||||
ApiGroupAll = "api_group:"
|
||||
|
||||
ApiUserActiveList = "api_user_active_list" //已启用待连接websocket的api
|
||||
ApiUserDeleteList = "api_user_delete_list" //已删除待删除的api
|
||||
|
||||
FutStopTrigger = "fut_trigger_stop_lock:%v_%s" //合约止损触发锁
|
||||
SpotStopTrigger = "spot_trigger_stop_lock:%v_%s" //现货止损触发锁
|
||||
|
||||
SpotAddPositionTrigger = "spot_addposition_trigger:%v_%s" //现货加仓触发 {apiuserid|symbol}
|
||||
FutAddPositionTrigger = "fut_addposition_trigger:%v_%s" //合约加仓触发 {apiuserid|symbol}
|
||||
SpotTrigger = "spot_trigger_lock:%v_%s" //现货触发 {apiuserid|symbol}
|
||||
FutTrigger = "fut_trigger_lock:%v_%s" //合约触发 {apiuserid|symbol}
|
||||
|
||||
SpotCallBack = "spot_callback:%s" //现货回调 {ordersn}
|
||||
FutCallBack = "fut_callback:%s" //合约回调 {ordersn}
|
||||
|
||||
//需要清理键值---------BEGIN---------------
|
||||
|
||||
UserHolding = "api_user_hold:%v" //用户持仓币种 {主单apiid} 不是交易对
|
||||
|
||||
SpotHedgeClosePosition = "spot_hedge_close_position:%v_%s" //现货对冲平仓 {mainorderid|symbol}
|
||||
FuturesHedgeClosePosition = "futures_hedge_close_position:%v_%s" //合约对冲平仓 {mainorderid|symbol}
|
||||
|
||||
SpotStopLossList = "spot_stoploss_list" //现货止损待触发列表
|
||||
FuturesStopLossList = "futures_stoploss_list" //合约止损待触发列表
|
||||
|
||||
SpotAddPositionList = "spot_add_position_list" //现货加仓待触发
|
||||
FuturesAddPositionList = "futures_add_position_list" //合约加仓待触发
|
||||
StoplossMarkt = "stop_loss_markt" //对冲保险单(市价) 对冲单成交之后、清除
|
||||
|
||||
HoldeA = "holde_a:%v" //持仓A {主单id}
|
||||
HoldeB = "holde_b:%v" //持仓B {主单id}
|
||||
|
||||
HedgeClosePosition = "hedge_close_position:%v" //对冲平仓记录 {主单id}
|
||||
//需要清理键值---------END-----------------
|
||||
|
||||
)
|
||||
28
common/const/userlockkey/userlockkey.go
Normal file
28
common/const/userlockkey/userlockkey.go
Normal file
@ -0,0 +1,28 @@
|
||||
package userlockkey
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var (
|
||||
preOrder = "Order-" //分布式锁现货委托单+划转前缀
|
||||
|
||||
preFutOrder = "futOrder-" //分布式锁u本位--合约委托单+划转前缀
|
||||
|
||||
preFutCoinOrder = "futCoinOrder-" //分布式锁币本位--合约委托单+划转前缀
|
||||
)
|
||||
|
||||
// GetUserLockKey 分布式锁现货 用户 key
|
||||
func GetUserLockKey(userId int) string {
|
||||
return preOrder + strconv.Itoa(userId)
|
||||
}
|
||||
|
||||
// GetUserFutLockKey u本位--分布式锁合约 用户 key
|
||||
func GetUserFutLockKey(userId int) string {
|
||||
return preFutOrder + strconv.Itoa(userId)
|
||||
}
|
||||
|
||||
// GetUserFutCoinLockKey 币本位--分布式锁合约 用户 key
|
||||
func GetUserFutCoinLockKey(userId int) string {
|
||||
return preFutCoinOrder + strconv.Itoa(userId)
|
||||
}
|
||||
Reference in New Issue
Block a user