Documentation ¶
Index ¶
- Constants
- func GetCreateIPLimitKey(ip string, itemID int64) (key string)
- func GetCreateMIDLimitKey(mid int64, itemID int64) (key string)
- func GetGeetestCountKey() (key string)
- func GetIPBlackKey(customerId int64, clientIP string) (key string)
- func GetIPChangeKey(mid int64) (key string)
- func GetMIDBlackKey(customerId int64, mid int64) (key string)
- func GetSalesLimitKey(mid int64) (key string)
- func GetUserVoucherKey(mid int64, voucher string, voucherType int64) (key string)
- type AddLog
- type AddQus
- type AddReturn
- type AddrInfo
- type Answer
- type AnswerAdd
- type ArgAddQus
- type ArgAddQusBank
- type ArgBankList
- type ArgBankSearch
- type ArgBaseBank
- type ArgBaseQus
- type ArgCheckAnswer
- type ArgCheckQus
- type ArgGetBankBind
- type ArgGetBindItems
- type ArgGetQuestion
- type ArgGetQus
- type ArgGetQusBank
- type ArgPage
- type ArgQuestionBankBind
- type ArgQuestionBankBindToDb
- type ArgQuestionBankBinds
- type ArgQuestionBankUnbind
- type ArgQusList
- type ArgUpdateQus
- type ArgUpdateQusBank
- type BuyerInfo
- type DeviceInfo
- type ExtShield
- type GetQuestionItem
- type IPListDetail
- type ItemInfo
- type ListDetail
- type Page
- type QuestBkPic
- type Question
- type QuestionAll
- type QuestionBank
- type QuestionBankBind
- type QusBankCnt
- type QusBankSt
- type ReqData
- type RespList
- type ShieldData
- type ShieldIPList
- type UIDListDetail
Constants ¶
const ( //RedisSalesLimitKey 售卖时间限制,mid:SALESLIMIT:ANTI RedisSalesLimitKey = "%d:SALESLIMIT:ANTI" //RedisIPChangeKey 用户ip变更,mid:IPCHANGELIMIT:ANTI RedisIPChangeKey = "%d:IPCHANGELIMIT:ANTI" //RedisCreateMIDLimitKey 同一mid下单次数限制,mid:itemId:MID:CREATELIMIT:ANTI RedisCreateMIDLimitKey = "%d:%d:MID:CREATELIMIT:ANTI" //RedisCreateIPLimitKey 同一mid下单次数限制,ip:itemId:IP:CREATELIMIT:ANTI RedisCreateIPLimitKey = "%s|%d:IP:CREATELIMIT:ANTI" //RedisUserVoucherKey 用户凭证key,mid:voucher:voucherType:VOUCHER:ANTI RedisUserVoucherKey = "%d:%s:%d:VOUCHER:ANTI" RedisUserVoucherKeyTimeOut = 600 //RedisGeetestCountKey 拉起极验的总数 RedisGeetestCountKey = "%d:ANTI:GEETEST:COUNT" RedisGeetestCountKeyTimeOut = 3600 //RedisMIDBlackKey mid黑名单key RedisMIDBlackKey = "ANTI:MID:BLACK:%d:%d" //RedisIPBlackKey ip黑名单key RedisIPBlackKey = "ANTI:IP:BLACK:%d:%s" )
缓存key
const ( //GeetestCaptchaID 极验的id GeetestCaptchaID = "3378262dc41a29fef92707dc5709d53d" //GeetestPrivateKey 极验的key GeetestPrivateKey = "de7f98dec5551fa0cca52c51b09bd1f1" )
const ( DeledStatus = 1 // 已删除 PAGESIZE = 20 // 每页条数 STARTINDEX = 20 // 开始页码 MULTIPLECHOICE = 2 //多选 )
常量
const ( //ServerOutage 服务不可用 ServerOutage = 0 //ServerNormal 服务正常 ServerNormal = 1 //RankNormal 正常 RankNormal = 0 //RankAbnormal 不正常 RankAbnormal = 1 //RankDoubt 可疑 RankDoubt = 2 //MethodPass 通过 MethodPass = 0 //MethodBan 禁止 MethodBan = 1 //MethodGeetest 极验 MethodGeetest = 2 //MethodQuestion 答题 MethodQuestion = 3 //VoucherTypePull 凭证拉起 VoucherTypePull = 1 //VoucherTypeCheck 凭证验证 VoucherTypeCheck = 2 CheckPass = "验证通过" CheckSaleErr = "未到售卖时间" CheckMidEnough = "mid下单次数达到上限" CheckIPEnough = "IP下单次数达到上限" CheckIPChange = "用户网络环境变更" RiskLevelSuperHigh = 1 RiskLevelHigh = 2 RiskLevelMiddle = 3 RiskLevelLight = 4 RiskLevelNormal = 5 )
风险常量
Variables ¶
This section is empty.
Functions ¶
func GetCreateIPLimitKey ¶
GetCreateIPLimitKey 获取ip创单限制key
func GetCreateMIDLimitKey ¶
GetCreateMIDLimitKey 获取mid创单限制key
func GetIPBlackKey ¶
GetIPBlackKey 获取mid黑名单key
func GetMIDBlackKey ¶
GetMIDBlackKey 获取mid黑名单key
Types ¶
type AddQus ¶
type AddQus struct { QsID int64 `json:"qid" validate:""` Type int8 `json:"question_type" validate:"required"` AnType int8 `json:"answer_type" validate:"required,min=1,max=4"` Name string `json:"question_name" validate:"required,min=1,gte=1"` BId int64 `json:"qb_id" validate:"required,min=1,gte=1"` Dif int8 `json:"difficulty" validate:"required,min=1,gte=1"` Answers []Answer }
AddQus 添加题目
type AddrInfo ¶
type AddrInfo struct { ID int64 `json:"id"` Name string `json:"name"` Phone string `json:"phone"` ProvID int64 `json:"provId"` Prov string `json:"prov"` CityID int64 `json:"cityId"` City string `json:"city"` AreaID int64 `json:"areaId"` Area string `json:"area"` Addr string `json:"addr"` }
AddrInfo 收货地址
type Answer ¶
type Answer struct { QsID int64 `json:"qid"` AnswerContent string `json:"answer_content"` IsCorrect int8 `json:"is_correct"` AnswerID int64 `json:"answer_id"` }
Answer stuct
type ArgAddQus ¶
type ArgAddQus struct { ArgBaseQus QsID string `json:"qid" validate:""` }
ArgAddQus 添加题目
type ArgAddQusBank ¶
type ArgAddQusBank struct { QBName string `json:"qb_name" validate:"required"` CdTime int64 `json:"cd_time" validate:"required,min=1,gte=1"` MaxRetryTime int64 `json:"max_retry_time" validate:"required,min=1,gte=1"` }
ArgAddQusBank 添加题库
type ArgBankSearch ¶
type ArgBankSearch struct {
Name string `form:"name" validate:"required"`
}
ArgBankSearch 搜索
type ArgBaseBank ¶
type ArgBaseBank struct {
QsBId int64 `json:"qb_id" validate:"required"`
}
ArgBaseBank 基本题库
type ArgBaseQus ¶
type ArgBaseQus struct { Type int8 `json:"question_type" validate:"required,min=1,max=4"` AnType int8 `json:"answer_type" validate:"required,min=1,max=4"` Name string `json:"question_name" validate:"required,min=1,gte=1"` BId int64 `json:"qb_id" validate:"required,min=1,gte=1"` Dif int8 `json:"difficulty" validate:"required,min=1,max=3"` Answer []Answer `json:"answer" validate:"required"` }
ArgBaseQus 基本题目信息
type ArgCheckAnswer ¶
type ArgCheckAnswer struct { ArgGetQuestion QsID int64 `json:"qid" validate:"required"` Answers []int64 `json:"answers"` X int `json:"x"` Y int `json:"y"` }
ArgCheckAnswer 答案检查
type ArgCheckQus ¶
ArgCheckQus 题库检查
type ArgGetBankBind ¶
type ArgGetBankBind struct { TargetItems []string `json:"target_items" validate:"required"` TargetItemType int8 `json:"target_item_type" validate:"required"` Source int8 `json:"source" validate:"required"` }
ArgGetBankBind 查询关联题库信息
type ArgGetBindItems ¶
ArgGetBindItems 绑定
type ArgGetQuestion ¶
type ArgGetQuestion struct { UID string `form:"uid" json:"uid" validate:"required"` TargetItem string `form:"target_item" json:"target_item" validate:"required"` TargetItemType int8 `form:"target_item_type" json:"target_item_type" validate:"required"` Source int8 `form:"source" json:"source" validate:"required"` Platform int8 `form:"platform" json:"platform" validate:"required"` ComponentID int `form:"component_id" json:"component_id" validate:"required"` }
ArgGetQuestion 随机获取一道题
type ArgGetQus ¶
type ArgGetQus struct { QsID int64 `form:"qid" validate:"required"` Stat int64 `form:"status" validate:"min=0"` }
ArgGetQus 题目
type ArgGetQusBank ¶
type ArgGetQusBank struct { QsBId int64 `form:"qb_id" validate:"required"` Stat int64 `form:"idel" validate:"min=0"` }
ArgGetQusBank 题库
type ArgPage ¶
type ArgPage struct { PageNo int `form:"page" validate:"required,min=1,gte=1"` PageSize int `form:"page_size" validate:"required,min=1,gte=1"` }
ArgPage 分页
type ArgQuestionBankBind ¶
type ArgQuestionBankBind struct { QsBId int64 `json:"qb_id" form:"qb_id" validate:"required"` Source int8 `json:"source" validate:"required"` TargetItemType int8 `json:"target_item_type" validate:"required"` UseInTime int64 `json:"use_in_time" validate:"required"` TargetItems string `json:"target_items" validate:"required"` }
ArgQuestionBankBind 关联题库/修改关联
type ArgQuestionBankBindToDb ¶
type ArgQuestionBankBindToDb struct { QsBId int64 Source int8 TargetItemType int8 UseInTime int64 TargetItems []string }
ArgQuestionBankBindToDb to do
type ArgQuestionBankBinds ¶
type ArgQuestionBankBinds struct {
BandBinds []ArgQuestionBankBind `json:"bind_info" validate:"required"`
}
ArgQuestionBankBinds to do
type ArgQuestionBankUnbind ¶
type ArgQuestionBankUnbind struct { TargetItems []int64 `json:"target_items" validate:"required"` TargetItemType int8 `json:"target_item_type" validate:"required"` Source int8 `json:"source" validate:"required"` }
ArgQuestionBankUnbind 关联题库/修改关联
type ArgQusList ¶
ArgQusList 题目列表
type ArgUpdateQus ¶
type ArgUpdateQus struct { ArgBaseQus QsID int64 `json:"qid" validate:"required"` }
ArgUpdateQus 更新题目
type ArgUpdateQusBank ¶
type ArgUpdateQusBank struct { QsBId int64 `json:"qb_id" validate:"required"` QBName string `json:"qb_name"` CdTime int64 `json:"cd_time" validate:"min=1,gte=1"` MaxRetryTime int64 `json:"max_retry_time" validate:"min=1,gte=1"` }
ArgUpdateQusBank 更新题库
type BuyerInfo ¶
type BuyerInfo struct { ID int64 `json:"id"` Name string `json:"name"` PersonalID string `json:"personalId"` IDCardFront string `json:"idCardFront"` IDCardBack string `json:"idCardBack"` }
BuyerInfo 购买人
type DeviceInfo ¶
type DeviceInfo struct { UA string `json:"ua"` Info string `json:"info"` Type string `json:"type"` Platform string `json:"platform"` Build string `json:"build"` }
DeviceInfo 设备信息
type ExtShield ¶
type ExtShield struct { OrderID int64 `json:"orderId"` RiskLevel int64 `json:"riskLevel"` ShieldResult int64 `json:"shieldResult"` ShieldMsg string `json:"shieldMsg"` Source string `json:"source"` }
ExtShield .
type GetQuestionItem ¶
type GetQuestionItem struct { *Question Answers []*Answer `json:"answers"` QuestBkPic *QuestBkPic `json:"qspic"` AllCnt int64 `json:"total"` AnTime int64 `json:"answer_cnt"` }
GetQuestionItem 获取题目接口返回数据
type ItemInfo ¶
type ItemInfo struct { ID int64 `json:"id"` Name string `json:"name"` SaleTime int64 `json:"saleTime"` Count int64 `json:"count"` Money int64 `json:"money"` }
ItemInfo 商品
type Page ¶
type Page struct { Total int64 `json:"total"` PageNo int `json:"page_no" default:"1"` PageSize int `json:"page_size" default:"20"` }
Page page
type QuestBkPic ¶
QuestBkPic 坐标
type Question ¶
type Question struct { QsID int64 `json:"qid"` QsType int8 `json:"question_type"` AnswerType int8 `json:"answer_type"` QsName string `json:"question_name"` QsDif int8 `json:"difficulty"` QsBId int64 `json:"qb_id"` IsDeleted uint8 `json:"is_deleted"` }
Question 题目返回数据
type QuestionAll ¶
QuestionAll 题目所有
type QuestionBank ¶
type QuestionBank struct { //ID int64 `json:"id"` QsBId int64 `json:"qb_id"` QBName string `json:"qb_name"` CdTime int64 `json:"cd_time"` MaxRetryTime int64 `json:"max_retry_time"` IsDeleted int8 `json:"is_deleted"` }
QuestionBank stuct
type QuestionBankBind ¶
type QuestionBankBind struct { ID int64 `json:"id"` TargetItem string `json:"target_item" validate:"required"` TargetItemType int8 `json:"target_item_type" validate:"required"` QsBId int64 `json:"bank_id" validate:"required"` UseInTime int64 `json:"use_in_time" validate:"required"` Source int8 `json:"source" validate:"required"` IsDeleted int8 `json:"is_deleted"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` QuestionBank *QuestionBank `json:"question_bank,omitempty"` }
QuestionBankBind 绑定题库字段
type QusBankCnt ¶
type QusBankCnt struct { ID int64 `json:"id"` TotalCnt int64 `json:"total_cnt"` EasyCnt sql.NullInt64 `json:"easy_cnt"` NormalCnt sql.NullInt64 `json:"normal_cnt"` HardCnt sql.NullInt64 `json:"hard_cnt"` }
QusBankCnt 统计类
type QusBankSt ¶
type QusBankSt struct { QuestionBank ID int64 `json:"id"` TotalCnt int64 `json:"total_cnt"` EasyCnt int64 `json:"easy_cnt"` NormalCnt int64 `json:"normal_cnt"` HardCnt int64 `json:"hard_cnt"` }
QusBankSt 返回
type ReqData ¶
type ReqData struct { ItemID []int64 `json:"itemId"` AddrID int64 `json:"addrId"` BuyerID int64 `json:"buyerId"` }
ReqData 业务方信息
type ShieldData ¶
type ShieldData struct { CustomerID int64 `json:"customerId"` UID string `json:"uid"` TraceID string `json:"traceId"` Timestamp int64 `json:"timestamp"` UserClientIp string `json:"userClientIp"` DeviceID string `json:"deviceId"` SourceIP string `json:"sourceIp"` InterfaceName string `json:"interfaceName"` PayChannel string `json:"payChannel"` ReqData *ReqData `json:"reqData"` ExtShield *ExtShield `json:"extShield"` }
ShieldData .
type ShieldIPList ¶
ShieldIPList .