Documentation
¶
Index ¶
- type APIError
- type AlipayParams
- type AppInfo
- type AreaInfo
- type BackpayRecord
- type DataRechargeData
- type DataRechargeQueryData
- type DataRechargeQueryResp
- type DataRechargeResp
- type DataRechargeUserDataPackages
- type EnterpriseCertInfoBinding
- type EnterpriseCertMaterial
- type EnterpriseCertMaterialBinding
- type FriendBrief
- type FriendList
- type GrabRecord
- type GrabStatus
- type InvoiceAddress
- type OfficialAccInfo
- type PayPhoneRecord
- type PhoneRechargeBalance
- type PhoneRechargeData
- type PhoneRechargeQueryData
- type PhoneRechargeQueryResp
- type PhoneRechargeResp
- type QQUserInfo
- type RankItem
- type RedPacket
- type RedpacketExpire
- type RedpacketInfo
- type RedpktRecord
- type RedpktStatistics
- type RmtNoticeItem
- type S2C_EnterpriseCertInfo
- type S2C_QiniuDlUrl
- type S2C_QiniuUpToken
- type S2C_RankList
- type S2C_RcToken
- type S2C_ReceivedList
- type S2C_RedpacketList
- type S2C_RedpketRecieveInfo
- type S2C_RedpketSendInfo
- type S2C_RedpktRecord
- type S2C_RedpktSendList
- type S2C_RedpktStatistics
- type S2C_SysNoticeList
- type S2C_ToBeReleasedList
- type S2C_TokenArray
- type S2C_UserData
- type ScanRecord
- type ScanningInfo
- type ScanningItem
- type ScanningList
- type ScanningRedpkt
- type SendRedpacket
- type SendRedpacketBinding
- type SendScannigBinding
- type ShareInfo
- type SysNoticeItem
- type ToBeReleasedRedpkt
- type TokenInfo
- type TradeInfo
- type User
- type UserExpireList
- type UserPrivate
- type UserPublic
- type UserRedpacket
- type WechatBackPayResult
- type WechatPayParams
- type WechatPayResult
- type WeiboUserInfo
- type WeixinUserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Code uint32 `json:"code" description:"错误码"`
Msg string `json:"msg" description:"错误描述"`
}
api 错误返回
type AlipayParams ¶
type AlipayParams struct {
AlipayPid string `json:"alipaypid"` // 支付宝pid
AlipayAcc string `json:"alipayacc"` // 支付宝账号
NotifyUrl string `json:"notifyurl"` // 支付宝回调
}
server-->client 支付宝支付参数
type AppInfo ¶
type AppInfo struct {
Size string `bson:"size" json:"size"` // 游戏或app大小
Name string `bson:"name" json:"name"` // 游戏或app名字
IconUrl string `bson:"icon_url" json:"icon_url"` // app图标链接
Keyword string `bson:"keyword" json:"keyword"` // 关键字
UrlScheme string `bson:"url_scheme" json:"url_scheme"` // ios调用url
BundleId string `bson:"bundle_id" json:"bundle_id"` // 游戏唯一标识符
Price int `bson:"price" json:"price"` // appstore 价格 0=免费
Platform int `bson:"platform" json:"platform"` // 投放平台 0=全部 1=iphone 2=ipad 3=Android
}
刷榜类红包的信息
type AreaInfo ¶
type AreaInfo struct {
Country string `bson:"country" json:"country"` // 国家
Province string `bson:"province" json:"province"` // 省份
City string `bson:"city" json:"city"` // 市
District string `bson:"district" json:"district"` // 区
}
地理信息
type BackpayRecord ¶
type BackpayRecord struct {
Id_ bson.ObjectId `bson:"_id"` // 记录id
UserId string `bson:"user_id"` // 用户id
Type int `bson:"type"` // 记录类型,1=汇款,2=银联,3=支付宝,4=微信
Account string `bson:"account"` // 汇款/银联:卡号,支付宝:账号,微信:没用
Name string `bson:"name"` // 汇款/银联:户名,支付宝:实名,微信:实名
BankName string `bson:"bank_name"` // 汇款/银联:开户银行,支付宝:没用
Fee int64 `bson:"fee"` // 金额
Time int64 `bson:"time"` // 提现时间
Status int `bson:"status"` // 状态,0=未处理,1=处理成功,处理失败
}
*
* struct tag 说明: * bson tag 不为"-",表示对mongodb的有效字段 * json tag 不为"-",表示对客户端的有效字段(对客户端开放) * redis tag 不为"-",表示对redis的有效字段(该字段缓存到redis中) * /////////////////////////////////////////////////////// 玩家提现记录
type DataRechargeData ¶
type DataRechargeData struct {
Ordercash float64 `json:"Ordercash"` // 商品价格
Cardname string `json:"Cardname"` // 商品名称
SporderId string `json:"SporderId"` // APIX订单号
UserOrderId string `json:"UserOrderId"` // 商家订单号
Phone string `json:"Phone"` // 手机号
State string `json:"State"` // 订单状态(0为充值中,1为成功,其他为失败)
}
server-->client 流量充值返回
type DataRechargeQueryData ¶
type DataRechargeQueryData struct {
ProviderId int `json:"ProviderId"`
ProviderName string `json:"ProviderName"`
UserDataPackages []DataRechargeUserDataPackages `json:"UserDataPackages"`
}
type DataRechargeQueryResp ¶
type DataRechargeQueryResp struct {
Code int `json:"Code"`
Msg string `json:"Msg"`
Data DataRechargeQueryData `json:"Data"`
}
type DataRechargeResp ¶
type DataRechargeResp struct {
Code int `json:"Code"` // 0 表示请求成功 其他为失败
Msg string `json:"Msg"` // 表示请求成功或者失败信息
Data DataRechargeData `json:"Data"`
}
type DataRechargeUserDataPackages ¶
type DataRechargeUserDataPackages struct {
PkgId int `json:"PkgId"`
DataValue string `json:"DataValue"`
Price float64 `json:"Price"`
Cost float64 `json:"Cost"`
Scope int `json:"Scope"`
LimitTimes string `json:"LimitTimes"`
Support4G int `json:"Support4G"`
EffectStartTime int `json:"EffectStartTime"`
EffectTime int `json:"EffectTime"`
}
server-->client 查询流量套餐商品信息返回
type EnterpriseCertMaterial ¶
type EnterpriseCertMaterial struct {
Id_ bson.ObjectId `bson:"_id"`
UserId string `bson:"user_id"` // 用户id
Name string `bson:"name"` // 认证名称
EnterpriseName string `bson:"enterprise_name"` // 企业名称
OperateName string `bson:"operate_name"` // 运营者身份证姓名
OperatePlace string `bson:"operate_place"` // 运营者职务
OperateId string `bson:"operate_id"` // 运营者身份证
OfficialWebsite string `bson:"official_website"` // 官网
Weibo string `bson:"weibo"` // 微博
Weixin string `bson:"weixin"` // 微信公众号
BusinessLicense string `bson:"business_license"` // 企业法人营业执照
TrademarkCert string `bson:"trademark_cert"` // 商标注册证
OperateIdPhoto string `bson:"operate_id_photo"` // 手持身份证照片
Status uint8 `bson:"status"` // 认证状态(0=未认证,1=认证通过,2=认证失败)
Reason string `bson:"reason"` // 审核结果(失败原因)
}
企业认证材料
type EnterpriseCertMaterialBinding ¶
type EnterpriseCertMaterialBinding struct {
Name string `json:"name" binding:"required"` // 认证昵称
EnterpriseName string `json:"enterprise_name" binding:"required"` // 企业名称
OperateName string `json:"operate_name" binding:"required"` // 运营者身份证姓名
OperatePlace string `json:"operate_place" binding:"required"` // 运营者职务
OperateId string `json:"operate_id" binding:"required"` // 运营者身份证
OfficialWebsite string `json:"official_website,omitempty"` // 官网
Weibo string `json:"weibo,omitempty"` // 微博
Weixin string `json:"weixin,omitempty"` // 微信公众号
BusinessLicense string `json:"business_license" binding:"required"` // 企业法人营业执照
TrademarkCert string `json:"trademark_cert,omitempty"` // 商标注册证
OperateIdPhoto string `json:"operate_id_photo" binding:"required"` // 手持身份证照片
}
type FriendBrief ¶
type FriendBrief struct {
UserId string `bson:"userid" json:"userid"` // 用户id
Name string `bson:"name,omitempty" json:"name"` // 用户名
Portrait string `bson:"portrait,omitempty" json:"portrait"` // 头像url
Star int `bson:"star,omitempty" json:"star"` // 是否是特别关注
Black int `bson:"black,omitempty" json:"black"` // 是否被拉黑
Time int64 `bson:"time,omitempty" json:"-"` // 成为好友的时间
}
好友简介
type FriendList ¶
type FriendList struct {
Friends []*FriendBrief `bson:"friends" json:"friends"` // 好友列表
}
好友列表
type GrabRecord ¶
type GrabRecord struct {
Id_ bson.ObjectId `bson:"_id" json:"-"` //抢红包记录id
UserId string `bson:"userid" json:"-"` //用户id
UserName string `bson:"user_name" json:"-"` //用户昵称
UserProvince string `bson:"user_province" json:"-"` //用户所在省份
UserSex int `bson:"user_sex" json:"-"` //用户性别 0=女 1=男 2=未知
RedpacketId string `bson:"redpacket_id" json:"redpacket_id"` //红包id
RedpacketType int `bson:"redpacket_type" json:"redpacket_type"` //红包类型
RedpacketName string `bson:"redpacket_name" json:"redpacket_name"` //红包名称
GrabMoney uint32 `bson:"grab_money" json:"grab_money"` //抢到的金额 分分钱
GrabTime int64 `bson:"grab_time" json:"grab_time"` //抢红包的时间
GrabDate string `bson:"grab_date" json:"-"` //抢红包的日期
}
领取红包记录
type GrabStatus ¶
type GrabStatus struct {
Status int `json:"status"` // 抢红包的状态 1=分享或下载
Expire int64 `json:"expire"` // 到期时间
Device string `json:"device"` // 设备id
}
/////////////////////////////////////////////////////// redis 用户抢红包的状态
type InvoiceAddress ¶
type InvoiceAddress struct {
Title string `bson:"title" json:"title"` // 发票抬头
Addressee string `bson:"addressee" json:"addressee"` // 收件人
Tel string `bson:"tel" json:"tel"` // 联系电话
Address string `bson:"address" json:"address"` // 联系地址
}
/////////////////////////////////////////////////////// 发票地址
type OfficialAccInfo ¶
type OfficialAccInfo struct {
Name string `bson:"name" json:"name"` // 公众号名字
Url string `bson:"url" json:"url"` // 文章链接
Title string `bson:"title" json:"title"` // 文章标题
}
公众号类红包的信息
type PayPhoneRecord ¶
type PayPhoneRecord struct {
Id_ bson.ObjectId `bson:"_id"` // 索引号
TradeNo string `bosn:"trade_no"` // 订单号
UserId string `bson:"userid"` // 用户id
Type int `bson:"type"` // 充值类型 1=话费,2=流量
Fee int `bson:"fee"` // 支付费用
Status int `bson:"status"` // 订单状态 1=已经完成,0=未完成
CreatTime int64 `bson:"create_time"` // 订单生成时间
}
充值记录
type PhoneRechargeBalance ¶
type PhoneRechargeBalance struct {
Balance float64 `json:"Balance"` // 余额
}
type PhoneRechargeData ¶
type PhoneRechargeData struct {
Cardid string `json:"Cardid"` // 商品编号
Cardnum float64 `json:"Cardnum"` // 商品面值(充值金额)
Ordercash float64 `json:"Ordercash"` // 商品价格
Cardname string `json:"Cardname"` // 商品名称
SporderId string `json:"SporderId"` // APIX订单号
UserOrderId string `json:"UserOrderId"` // 商家订单号
Phone string `json:"Phone"` // 手机号
State string `json:"State"` // 订单状态(0为充值中,1为成功,其他为失败)
}
server-->client 话费充值返回
type PhoneRechargeQueryData ¶
type PhoneRechargeQueryData struct {
Cardid string `json:"Cardid"` // 商品编号
Cardname string `json:"Cardname"` // 商品名称
Inprice float64 `json:"Inprice"` // 商品价格
GameArea string `json:"GameArea"` // 商品归属地
}
server-->client 查询话费充值商品信息返回
type PhoneRechargeQueryResp ¶
type PhoneRechargeQueryResp struct {
Code int `json:"Code"` // 0 表示请求成功 其他为失败
Msg string `json:"Msg"` // 表示请求成功或者失败信息
Data PhoneRechargeQueryData `json:"Data"`
}
type PhoneRechargeResp ¶
type PhoneRechargeResp struct {
Code int `json:"Code"` // 0 表示请求成功 其他为失败
Msg string `json:"Msg"` // 表示请求成功或者失败信息
Data PhoneRechargeData `json:"Data"`
}
type QQUserInfo ¶
type RankItem ¶
type RankItem struct {
Rank int `json:"rank"` // 名次
Score int `json:"score"` // 分值
Id string `json:"id"` // 用户id
Name string `json:"name"` // 用户昵称
}
排行榜信息
type RedPacket ¶
type RedPacket struct {
Id_ bson.ObjectId `bson:"_id" redis:"-"` //红包id
SenderId string `bson:"sender_id"` //红包发送者id
CreateTime int64 `bson:"create_time"` //红包创建时间
BeginTime int64 `bson:"begin_time"` //红包开领时间
EndTime int64 `bson:"end_time"` //红包下架时间
Verify int `bson:"verify"` //红包审核状态 0=审核中,1=已通过,2=未通过
Year string `bson:"year"` //红包创建年份
TradeStatus int `bson:"trade_status"` //红包的付款状态 1=已付款,0=等待付款
Rebate int `bson:"rebate"` //红包提成 10%
PerMoney uint32 `bson:"per_money"` //红包单个金额
Total int `bson:"total"` //红包总个数
Remainder int `bson:"remainder"` //红包剩余个数
Area AreaInfo `bson:"area,omitempty"` //区域
Invoice int `bson:"invoice"` //是否需要发票
Address InvoiceAddress `bson:"address,omitempty"` //发票邮寄地址
Type int `bson:"type"` //红包类型 [看注释]
App AppInfo `bson:"app,omitempty"` //app、游戏刷量类信息
OfficialAcc OfficialAccInfo `bson:"official_acc,omitempty"` //公众号关注分享类信息
Statistics RedpktStatistics `bson:"statistics"` //分布统计
}
红包 红包类型:1=分享;2=游戏;3=app刷量;4=公众号
type RedpacketExpire ¶
type RedpacketExpire struct {
Id string `json:"id"` // 红包id
Type int `json:"type"` // 红包类型
Screenshot int64 `json:"screenshot"` // 6小时截图到期时间戳
Download int64 `json:"download"` // 30分钟下载到期时间
IsGrab int `json:"is_grab"` // 是否已经抢到红包
}
红包到期时间列表
type RedpacketInfo ¶
type RedpacketInfo struct {
Id string `json:"id"` //红包id
BeginTime int64 `json:"begin_time"` //红包开始时间
EndTime int64 `json:"end_time"` //红包结束时间
PerMoney uint32 `json:"per_money"` //每个红包的金额
Number int `json:"number"` //红包剩余个数
UserId string `json:"user_id"` //红包发送者id
UserName string `json:"user_name"` //发送者名字
Portrait string `json:"portrait"` //发送者图像
IsAuth uint8 `json:"is_auth"` //是否是认证商户
Type int `json:"type"` //红包类型
Area AreaInfo `json:"area,omitempty"` //区域
App *AppInfo `json:"app,omitempty"` //app、游戏刷量类信息
OfficialAcc *OfficialAccInfo `json:"official_acc,omitempty"` //公众号关注分享类信息
}
/////////////////////////////////////////////////////// 返回给客户端 红包信息
type RedpktRecord ¶
type RedpktStatistics ¶
type RmtNoticeItem ¶
type RmtNoticeItem struct {
UId string `json:"uid"` // 推送目标id
Text string `json:"text"` // 推送文本
Time int64 `json:"time"` // 推送时间
}
远程推送节点
type S2C_EnterpriseCertInfo ¶
type S2C_QiniuDlUrl ¶
七牛私有空间下载链接
type S2C_QiniuUpToken ¶
type S2C_QiniuUpToken struct {
UploadToken string `json:"upload_token"`
Expires int `json:"expires"`
}
/////////////////////////////////////////////////////// 七牛的上传凭证
type S2C_RankList ¶
type S2C_RankList struct {
Type int `json:"type"` // 排行榜类型 1=红包榜 2=好友榜 3=等级榜 4=老板榜
List []RankItem `json:"list"` // 排行榜列表
Self int `json:"self"` // 自己的排名 0=未上榜,统一表示99999+
}
发送给客户端的排行榜列表
type S2C_RedpacketList ¶
type S2C_RedpacketList struct {
Count uint32 `description:"该时段红包个数"`
List []*RedpacketInfo `description:"红包列表"`
}
红包列表
type S2C_RedpketRecieveInfo ¶
收到的红包信息
type S2C_RedpketSendInfo ¶
type S2C_RedpketSendInfo struct {
Total int `json:"total"` // 总支出
Amount int `json:"amount"` // 红包的个数
}
发出的红包信息
type S2C_RedpktRecord ¶
type S2C_RedpktRecord struct {
Id string `json:"id"` // 红包id
List []*RedpktRecord `json:"list,omitempty"` // 领取记录
}
红包领取记录
type S2C_RedpktSendList ¶
type S2C_RedpktSendList struct {
List []*SendRedpacket `json:"list,omitempty"`
}
用户发送的红包记录
type S2C_RedpktStatistics ¶
type S2C_RedpktStatistics struct {
Id string `json:"id"`
RedpktStatistics `json:"statistics,omitempty"` // 统计数据
}
type S2C_SysNoticeList ¶
type S2C_SysNoticeList struct {
List []SysNoticeItem `json:"list,omitempty"`
}
///////////////////////////////////////////////////////
type S2C_ToBeReleasedList ¶
type S2C_ToBeReleasedList struct {
List []*ToBeReleasedRedpkt `json:"list"`
}
用户待发布的红包列表
type S2C_TokenArray ¶
type S2C_TokenArray struct {
AccessToken TokenInfo `json:"access_token" description:"access token信息"`
RefreshToken TokenInfo `json:"refresh_token" description:"refresh token信息"`
}
/////////////////////////////////////////////////////// 返回给客户端 token数组
type S2C_UserData ¶
type S2C_UserData struct {
UserPublic
UserId string `json:"id"` // 用户id
Oauth [5]int `json:"oauth,omitempty"` // 第三方账号绑定标示
}
/////////////////////////////////////////////////////// 发给客户端个人数据
type ScanRecord ¶
type ScanRecord struct {
Id_ bson.ObjectId `bson:"_id"` // 扫红包记录id
RedpktId string `bson:"redpkt_id"` // 扫红包的id
UserId string `bson:"user_id"` // 用户id
UserName string `bson:"user_name"` // 用户名,为了不再去查询用户表
Money uint32 `bson:"money"` // 抢到的钱,分分钱为单位
Time int64 `bson:"time"` // 扫描红包时间戳
}
扫描红包 记录
type ScanningInfo ¶
type ScanningInfo struct {
Id bson.ObjectId `bson:"_id"`
Name string `bson:"item_name"`
Pic []string `bson:"pic_urls"`
Balance uint32 `bson:"balance"`
}
扫红包列表查询结果
type ScanningItem ¶
type ScanningItem struct {
Id string `json:"id" description:"扫红包商品id"`
Name string `json:"name" description:"商品名称"`
Pic string `json:"pic" description:"商品图片"`
Balance uint32 `json:"balance" description:"红包余额"`
}
///////////////////////////////////////////////////////
type ScanningList ¶
type ScanningList struct {
Count uint32 `json:"count" description:"列表长度"`
List []*ScanningItem `json:"list" description:"扫红包列表"`
}
扫红包列表
type ScanningRedpkt ¶
type ScanningRedpkt struct {
Id_ bson.ObjectId `bson:"_id"` // 扫红包的id
ItemName string `bson:"item_name"` // 商品名称
BarCode string `bson:"bar_code"` // 商品条形码
Tag string `bson:"tag"` // 商品的分类标签
PicUrls [3]string `bson:"pic_urls"` // 商品图片
Description string `bson:"description"` // 促销描述信息
SendTime int64 `bson:"send_time"` // 发扫红包的时间
StartDate uint32 `bson:"start_date"` // 开始日期
StopDate uint32 `bson:"stop_date"` // 结束日期
DailyMoney uint32 `bson:"daily_money"` // 每日发的钱
TotalMoney uint32 `bson:"total_money"` // 总金额,没有扣提成的
Balance uint32 `bson:"balance"` // 余额,这里为总金额扣除了提成后的金额
LastdayMoney uint32 `bson:"lastday_money"` // 最后一天要发的金额(除不尽的情况)
Isend bool `bson:"isend"` // 该扫红包活动已经结束
GenDate uint32 `bson:"gen_date"` // 最后一次生成红包的日期
}
/////////////////////////////////////////////////////// 提成以及结算 提成百分比为 10%,总金额*10%=实际发给用户红包的总额 如果红包有剩余,结算时返回剩余的红包金额+剩余红包扣除的提成,即 剩余红包/(1-提成百分比) 发布的扫描红包
type SendRedpacket ¶
type SendRedpacketBinding ¶
type SendRedpacketBinding struct {
Type int `json:"type" binding:"required" ` //红包类型 1-4
PerMoney uint32 `json:"permoney" binding:"required"` //每个红包的金额金额
TotalNum int `json:"totalnum" binding:"required"` //红包总个数
BeginTime int64 `json:"begintime" binding:"required"` //红包开领时间
Area AreaInfo `json:"area,omitempty"` //红包发送区域
Invoice int `json:"invoice"` //是否需要发票
Address InvoiceAddress `json:"address"` //发票快递地址
App AppInfo `json:"app,omitempty"` //app、游戏刷量类信息
OfficialAcc OfficialAccInfo `json:"official_acc,omitempty"` //公众号关注分享类信息
}
发红包
type SendScannigBinding ¶
type SendScannigBinding struct {
Barcode string `json:"barcode" binding:"required" description:"条形码"`
Itemname string `json:"itemname" binding:"required" description:"商品名称"`
Tag string `json:"tag" binding:"required" description:"商品分类"`
Desc string `json:"desc" binding:"required" description:"促销信息"`
Startdate uint32 `json:"start_date" binding:"required" description:"红包发送日期"`
Stopdate uint32 `json:"stop_date" binding:"required" description:"红包结束日期"`
TotalMoney uint32 `json:"total_money" binding:"required" description:"红包总金额"`
}
发布扫红包
type SysNoticeItem ¶
type SysNoticeItem struct {
Text string `json:"text"` // 通知文本
Time int64 `json:"time"` // 通知时间
Flag int `json:"flag"` // 是否已读
}
系统通知节点
type ToBeReleasedRedpkt ¶
type ToBeReleasedRedpkt struct {
Id string `json:"id"` //红包id
CreateTime int64 `json:"create_time"` //红包创建时间
BeginTime int64 `json:"begin_time"` //红包开领时间
Verify int `json:"verify"` //审核状态
TradeStatus int `json:"trade_status"` //付款状态
Title string `json:"title"` //红包标题
}
待发布红包
type TokenInfo ¶
type TokenInfo struct {
Token string `description:"token字符串"`
Expiresin uint32 `description:"token的有效期,以s为单位"`
}
/////////////////////////////////////////////////////// appserver 的token
type TradeInfo ¶
type TradeInfo struct {
Id_ bson.ObjectId `bson:"_id"` // 索引号
TradeNo string `bosn:"trade_no"` // 订单号(红包号)
UserId string `bson:"userid"` // 用户id
Fee int `bson:"fee"` // 支付费用
Status int `bson:"status"` // 订单状态 1=已经完成,0=未完成
CreatTime int64 `bson:"create_time"` // 订单生成时间
}
订单记录
type User ¶
type User struct {
Id_ bson.ObjectId `bson:"_id" redis:"-"` //id,唯一账号id
UserPrivate `bson:",inline" redis:",inline"`
UserPublic `bson:",inline" redis:",inline"`
UserRedpacket `bson:",inline" redis:",inline"`
Friends []*FriendBrief `bson:"friends" redis:"friends"` //好友列表
}
用户完整信息(mongodb)
type UserExpireList ¶
type UserExpireList struct {
List []*RedpacketExpire `json:"list"` // 到期时间戳列表
}
用户的红包到期列表
type UserPrivate ¶
type UserPrivate struct {
Password string `bson:"password" redis:"-"` //密码
Salt string `bson:"salt" redis:"-"` //盐
AccessToken string `bson:"accesstoken" redis:"-"` //当前使用的access token
RefreshToken string `bson:"refreshtoken" redis:"-"` //当前使用的refresh token
RcToken string `bson:"rctoken" redis:"-"` //用户的融云token
WeixinOpenId string `bson:"weixin_openid" redis:"weixin_openid"` //微信openid(对客户端隐藏)
WeiboOpenId string `bson:"weibo_openid" redis:"weibo_openid"` //新浪微博openid(对客户端隐藏)
QQOpenId string `bson:"qq_openid" redis:"qq_openid"` //腾讯QQ openid(对客户端隐藏)
LoginCount int `bson:"login_count" redis:"login_count"` //用户的登陆次数(累加)
IsGm bool `bson:"is_gm" redis:"is_gm"` // 是否为gm
}
*
* struct tag 说明: * bson tag 不为"-",表示对mongodb的有效字段 * json tag 不为"-",表示对客户端的有效字段(对客户端开放) * redis tag 不为"-",表示对redis的有效字段(该字段缓存到redis中) * /////////////////////////////////////////////////////// 用户的私密信息
type UserPublic ¶
type UserPublic struct {
Phone string `bson:"phone" json:"phone" redis:"phone"` //手机号码,暂只支持国内手机号码 "13877778888"
Account string `bson:"account" json:"account" redis:"account"` //红包账号,只能以英文字母开头且只能包含英文字母和数字
UpdateTime int64 `bson:"update_time" json:"update_time" redis:"update_time"` //更新信息时间
Portrait string `bson:"portrait" json:"portrait" redis:"portrait"` //头像url(七牛云图片url)
NickName string `bson:"nickname" json:"nickname" redis:"nickname"` //昵称,可重复
Sex uint8 `bson:"sex" json:"sex" redis:"sex"` //性别(0=女,1=男)
Area AreaInfo `bson:"area" json:"area" redis:"area"` //地区
Cert uint8 `bson:"cert" json:"cert" redis:"cert"` //商户认证(0=未认证,1=审核中,2=已认证)
Signature string `bson:"signature" json:"signature" redis:"signature"` //个性签名,30个字
Money int64 `bson:"money" json:"money" redis:"money"` //当前余额(分为单位,需要除以100)
TempMoney int64 `bson:"temp_money" json:"temp_money" redis:"temp_money"` //待确认金额
Point int `bson:"point" json:"point" redis:"point"` //总积分
Level int `bson:"level" json:"level" redis:"level"` //等级
}
用户个人信息
type UserRedpacket ¶
type UserRedpacket struct {
Income int `bson:"income" redis:"income"` //总收益(对客户端隐藏)
Outcome map[string][]int `bson:"outcome" redis:"outcome"` //总支出(对客户端隐藏)
DailyGrab []int64 `bson:"daily_grab" redis:"daily_grab"` //每日抢红包次数和时间戳[次数,时间戳]
OAlimit []int64 `bson:"oa_limit" redis:"oa_limit"` //公众号类红包抢的次数限制
}
用户红包数据
type WechatBackPayResult ¶
type WechatBackPayResult struct {
ReturnCode string `xml:"return_code"`
ReturnMsg *string `xml:"return_msg,omitempty"`
MchAppid *string `xml:"mch_appid,omitempty"`
Mchid *string `xml:"mchid,omitempty"`
DeviceInfo *string `xml:"device_info,omitempty"`
NonceStr *string `xml:"nonce_str,omitempty"`
ResultCode *string `xml:"result_code,omitempty"`
ErrCode *string `xml:"err_code,omitempty"`
ErrCodeDes *string `xml:"err_code_des,omitempty"`
PartnerTradeNo *string `xml:"partner_trade_no,omitempty"`
PaymentNo *string `xml:"payment_no,omitempty"`
PaymentTime *string `xml:"payment_time,omitempty"`
}
api server-->server
type WechatPayParams ¶
type WechatPayParams struct {
AppId string `json:"appid"` // appid
MchId string `json:"mchid"` // mchid
NotifyUrl string `json:"notifyurl"` // 微信支付回调
PayKey string `json:"paykey"` // 支付key
}
server-->client 微信支付参数
type WechatPayResult ¶
type WechatPayResult struct {
ReturnCode string `xml:"return_code"` // 错误码,SUCCESS/FAIL
ReturnMsg string `xml:"return_msg"` // 错误信息
}
server-->api server 微信支付回调结果