Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"associate_banner.go",
"associate_bind.go",
"associate_ele_api.go",
"associate_model.go",
"associate_old.go",
"associate_open.go",
"associate_order.go",
"associate_panel.go",
"associate_params.go",
"bp.go",
"coupon.go",
"dialog.go",
"http.go",
"jointly.go",
"mail_api.go",
"model.go",
"notify.go",
"oldvip.go",
"order.go",
"panel.go",
"params.go",
"pay.go",
"platform.go",
"point.go",
"privilege.go",
"resource.go",
"rpc.go",
"tips.go",
"user.go",
"vip.go",
"welfare.go",
],
embed = [":model_go_proto"],
importpath = "go-common/app/service/main/vip/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/admin/main/vip/model:go_default_library",
"//app/service/main/coupon/api:go_default_library",
"//app/service/main/coupon/model:go_default_library",
"//library/time:go_default_library",
"//vendor/github.com/satori/go.uuid:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
proto_library(
name = "model_proto",
srcs = ["vip.proto"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "model_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_proto"],
importpath = "go-common/app/service/main/vip/model",
proto = ":model_proto",
tags = ["automanaged"],
deps = [
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
],
)

View File

@@ -0,0 +1,31 @@
package model
// associate_platform
const (
AssociatePlatformNone int8 = iota
AssociatePlatformAndroidPink
AssociatePlatformIphonePink
AssociatePlatformIpadPink
)
// AssociatePlatform get platfrom.
func AssociatePlatform(platfrom, device, mobiApp string) int8 {
switch {
case platfrom == "ios" && device == "phone" && mobiApp == "iphone":
return AssociatePlatformIphonePink
case platfrom == "ios" && device == "pad" && mobiApp == "iphone":
return AssociatePlatformIpadPink
case platfrom == "android" && mobiApp == "android":
return AssociatePlatformAndroidPink
default:
return AssociatePlatformNone
}
}
// AssociateVipResp associate vip resp
type AssociateVipResp struct {
Title string `json:"title"`
Remark string `json:"remark"`
Link string `json:"link"`
AssociatePlatform int8 `json:"associate_platform"`
}

View File

@@ -0,0 +1,27 @@
package model
// BindInfo struct.
type BindInfo struct {
Account *BindAccount `json:"account"`
Outer *BindOuter `json:"outer"`
}
// BindAccount bind account.
type BindAccount struct {
Mid int64 `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
}
// BindOuter outer bind info.
type BindOuter struct {
Tel string `json:"tel"`
BindState int32 `json:"bind_state"`
}
// ArgOpenBindByMid args.
type ArgOpenBindByMid struct {
Mid int64
AppID int64
OutOpenID string
}

View File

@@ -0,0 +1,98 @@
package model
// ArgEleAccessToken ele access token args.
type ArgEleAccessToken struct {
AuthCode string `json:"auth_code"`
}
// EleAccessTokenResp ele access token resp.
type EleAccessTokenResp struct {
OpenID string `json:"open_id"`
}
// ArgEleReceivePrizes receive prizes args.
type ArgEleReceivePrizes struct {
ElemeOpenID string `json:"eleme_open_id"`
BliOpenID string `json:"bli_open_id"`
SourceID string `json:"source_id"`
}
// EleReceivePrizesResp receive prizes resp.
type EleReceivePrizesResp struct {
Amount float64 `json:"amount"`
SumCondition float64 `json:"sum_condition"`
Description string `json:"description"`
}
// ArgEleUnionUpdateOpenID union update open id args.
type ArgEleUnionUpdateOpenID struct {
ElemeOpenID string `json:"eleme_open_id"`
BliOpenID string `json:"bli_open_id"`
}
// EleUnionUpdateOpenIDResp union update resp.
type EleUnionUpdateOpenIDResp struct {
Status int32 `json:"status"`
Message string `json:"message"`
}
// ArgEleBindUnion ele salary bind vip args.
type ArgEleBindUnion struct {
ElemeOpenID string `json:"eleme_open_id"`
BliOpenID string `json:"bli_open_id"`
VipType int32 `json:"vip_type"`
SourceID string `json:"source_id"`
UserIP string `json:"user_ip"`
}
// EleBindUnionResp ele bind union resp.
type EleBindUnionResp struct {
Status int32 `json:"status"`
Message string `json:"message"`
}
// ArgEleCanPurchase ele can purchase args.
type ArgEleCanPurchase struct {
ElemeOpenID string `json:"eleme_open_id"`
BliOpenID string `json:"bli_open_id"`
UserIP string `json:"user_ip"`
VipType int32 `json:"vip_type"`
}
// EleCanPurchaseResp ele can purchase resp.
type EleCanPurchaseResp struct {
CanPurchase bool `json:"can_purchase"`
Status int32 `json:"status"`
Message string `json:"message"`
}
// ArgEleUnionMobile ele union mobile.
type ArgEleUnionMobile struct {
ElemeOpenID string `json:"eleme_open_id"`
BliOpenID string `json:"bli_open_id"`
}
// EleUnionMobileResp ele get union mobile resp.
type EleUnionMobileResp struct {
Status int32 `json:"status"`
Message string `json:"message"`
BlurMobile string `json:"blur_mobile"`
}
// EleRedPackagesResp ele red packages.
type EleRedPackagesResp struct {
Name string `json:"name"`
Amount float64 `json:"amount"`
SumCondition float64 `json:"sum_condition"`
}
// EleSpecailFoodsResp ele specail foods resp.
type EleSpecailFoodsResp struct {
RestaurantName string `json:"restaurant_name"`
FoodName string `json:"food_name"`
FoodURL string `json:"food_url"`
Discount float64 `json:"discount"`
Amount float64 `json:"amount"`
OriginalAmount float64 `json:"original_amount"`
RatingPoint float64 `json:"rating_point"`
}

View File

@@ -0,0 +1,42 @@
package model
// associate bind state.
const (
AssociateBindStateNone int32 = iota
AssociateBindStateNotPurchase
AssociateBindStatePurchased
)
// associate prize type.
const (
AssociatePrizeTypeCode int8 = iota + 1
AssociatePrizeTypeEleBag
)
// associate appid.
const (
EleAppID = 32
)
// month type.
const (
UnionOneMonth int32 = 1
UnionOneYear int32 = 12
)
// ele vip type
const (
EleMonthVip int32 = 2
EleYearVip int32 = 4
)
// eleme grant remark.
const (
ElemeGrantRemark = "宅e块联合会员"
)
// EleGrantVipDays eleme grant vip days.
var EleGrantVipDays = map[int32]int64{
1: 31,
12: 366,
}

View File

@@ -0,0 +1,16 @@
package model
import "go-common/library/time"
// VipOrderActivityRecord vip order activity record.
type VipOrderActivityRecord struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
OrderNO string `json:"order_no"`
ProductID string `json:"product_id"`
Months int32 `json:"months"`
PanelType string `json:"panel_type"`
AssociateState int8 `json:"associate_state"`
Ctime time.Time
Mtime time.Time
}

View File

@@ -0,0 +1,33 @@
package model
// ArgRegisterOpenID add open_id args.
type ArgRegisterOpenID struct {
Mid int64
AppID int64
}
// RegisterOpenIDResp register openid resp.
type RegisterOpenIDResp struct {
OpenID string
}
// ArgOpenAuthCallBack callback args.
type ArgOpenAuthCallBack struct {
Mid int64
ThirdCode string
AppID int64
}
// ArgUserInfoByOpenID args.
type ArgUserInfoByOpenID struct {
AppID int64
OpenID string
IP string
}
// UserInfoByOpenIDResp resp.
type UserInfoByOpenIDResp struct {
Name string `json:"name"`
BindState int32 `json:"bind_state"`
OutOpenID string `json:"out_open_id"`
}

View File

@@ -0,0 +1,47 @@
package model
import "go-common/library/time"
// order grant state
const (
AssociateGrantStateNone int8 = iota
AssociateGrantStateHadGrant
)
// ArgBilibiliVipGrant bilibili vip grant args.
type ArgBilibiliVipGrant struct {
OpenID string
OutOpenID string
OutOrderNO string
Duration int32
AppID int64
}
// VipOrderAssociateGrant vip order associate grant.
type VipOrderAssociateGrant struct {
ID int64
AppID int64
Mid int64
Months int32
OutOpenID string
OutTradeNO string
State int8
Ctime time.Time
Mtime time.Time
}
// ArgEleVipGrant args ele vip grant.
type ArgEleVipGrant struct {
OrderNO string `form:"order_no" validate:"required"`
}
// VipAssociateGrantCount associate grant count.
type VipAssociateGrantCount struct {
ID int64 `json:"id"`
AppID int64 `json:"app_id"`
Mid int64 `json:"mid"`
Months int32 `json:"months"`
CurrentCount int64 `json:"current_count"`
Ctime time.Time `json:"-"`
Mtime time.Time `json:"-"`
}

View File

@@ -0,0 +1,30 @@
package model
// AssociatePanelInfo associate panel info.
type AssociatePanelInfo struct {
ID int64 `json:"id"`
Month int32 `json:"month"`
PdName string `json:"product_name"`
PdID string `json:"product_id"`
SubType int32 `json:"sub_type"`
SuitType int32 `json:"suit_type"`
OPrice float64 `json:"original_price"`
DPrice float64 `json:"discount_price"`
DRate string `json:"discount_rate"`
Remark string `json:"remark"`
Selected int32 `json:"selected"`
PayState int8 `json:"pay_state"`
PayMessage string `json:"pay_message"`
}
// ArgAssociatePanel args.
type ArgAssociatePanel struct {
Device string `form:"device"`
Build int64 `form:"build"`
MobiApp string `form:"mobi_app"`
Platform string `form:"platform" default:"pc"`
SortTP int8 `form:"sort_type"`
PanelType string `form:"panel_type" default:"normal"`
Mid int64
IP string
}

View File

@@ -0,0 +1,40 @@
package model
// ArgBind bind args.
type ArgBind struct {
OpenID string
OutOpenID string
AppID int64
}
// ArgBindInfo bind info args.
type ArgBindInfo struct {
Mid int64
AppID int64
}
// ArgThirdPrizeGrant prize grant args.
type ArgThirdPrizeGrant struct {
Mid int64 `form:"mid" validate:"required"`
PrizeKey int64 `form:"prize_key"`
UniqueNo string `form:"unique_no" validate:"required"`
PrizeType int8 `form:"prize_type" validate:"required"`
Appkey string `form:"appkey" validate:"required"`
Remark string `form:"remark" validate:"required"`
AppID int64
}
// ArgBilibiliPrizeGrant args.
type ArgBilibiliPrizeGrant struct {
PrizeKey string
UniqueNo string
OpenID string
AppID int64
}
// BilibiliPrizeGrantResp resp.
type BilibiliPrizeGrantResp struct {
Amount float64
FullAmount float64
Description string
}

View File

@@ -0,0 +1,7 @@
package model
// BcoinSalaryResp salary dto.
type BcoinSalaryResp struct {
BcoinList []*VipBcoinSalary `json:"bcoin_list"`
DaysNextGive int32 `json:"days_next_give"`
}

View File

@@ -0,0 +1,17 @@
package model
// coupon state.
const (
CouponNotUsed = iota
CouponInUse
CouponUsed
CouponExpire
)
// coupon remark
const (
CouponUseRemark = "大会员券消费"
)
// MapProdLlimRenewal .
var MapProdLlimRenewal = map[int8]int8{0: 2, 1: 1}

View File

@@ -0,0 +1,30 @@
package model
import "go-common/library/time"
// OrderResult order result.
type OrderResult struct {
OrderNo string `json:"order_no"`
Status int8 `json:"status"`
Dialog *ConfDialog `json:"dialog,omitempty"`
}
// ConfDialog .
type ConfDialog struct {
ID int64 `json:"-"`
AppID int64 `json:"app_id"`
Platform int64 `json:"platform"`
StartTime time.Time `json:"-"`
EndTime time.Time `json:"-"`
Title string `json:"title"`
Content string `json:"content"`
Follow bool `json:"follow"`
LeftButton string `json:"left_button"`
LeftLink string `json:"left_link"`
RightButton string `json:"right_button"`
RightLink string `json:"right_link"`
Operator string `json:"-"`
Stage bool `json:"stage"`
Ctime time.Time `json:"-"`
Mtime time.Time `json:"-"`
}

View File

@@ -0,0 +1,59 @@
package model
// MemberResq response params .
type MemberResq struct {
CommonResq
Data *Member `json:"data"`
}
// Member response params .
type Member struct {
Mid string `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
Sign string `json:"sign"`
Sex string `json:"sex"`
Cert string `json:"cert"`
Rank string `json:"rank"`
Certdesc string `json:"certdesc"`
}
// PayResq response params.
type PayResq struct {
Errno int64 `json:"errno"`
Message string `json:"msg"`
}
// CommonResq response params.
type CommonResq struct {
Code int64 `json:"code"`
TS int64 `json:"ts"`
Message string `json:"message"`
}
//TokenResq get token resq.
type TokenResq struct {
CommonResq
Data *Token `json:"data"`
}
//Token get token .
type Token struct {
Token string `json:"token"`
URL string `json:"url"`
}
//OpenCodeResp openCode resq.
type OpenCodeResp struct {
CommonResq
Data int64 `json:"data"`
}
//PassportDetail .
type PassportDetail struct {
Mid int64 `json:"mid"`
Email string `json:"email"`
Phone string `json:"telphone"`
Spacesta int8 `json:"spacesta"`
JoinTime int64 `json:"join_time"`
}

View File

@@ -0,0 +1,27 @@
package model
import "go-common/library/time"
// Jointly def.
type Jointly struct {
ID int64 `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
Link string `json:"link"`
IsHot int8 `json:"is_hot"`
State int8 `json:"state"`
Operator string `json:"operator"`
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
}
// JointlyResp jointly resp.
type JointlyResp struct {
Title string `json:"title"`
Content string `json:"content"`
IsHot int8 `json:"is_hot"`
Link string `json:"link"`
EndTime int64 `json:"end_time"`
}

View File

@@ -0,0 +1,14 @@
package model
// ArgMailCouponCodeCreate mail coupon code create args.
type ArgMailCouponCodeCreate struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
CouponID string `json:"couponId"`
}
// MailCouponCodeCreateResp mail code create resp.
type MailCouponCodeCreateResp struct {
CouponCodeID string `json:"couponCodeId"`
RemainReceiveTimes int64 `json:"remainReceiveTimes"`
}

View File

@@ -0,0 +1,292 @@
package model
// open change
const (
OpenChangeNONE int8 = iota
PointChange
Recharge
System
Active
ReacquireDeduction
ActiveCode
SystemDeduction
)
//OpenChangeMap .
var OpenChangeMap = map[int8]string{
OpenChangeNONE: "none",
PointChange: "积分兑换",
Recharge: "充值开通",
System: "系统发放",
Active: "活动赠送",
ReacquireDeduction: "重复领取扣除",
ActiveCode: "激活码",
SystemDeduction: "系统扣减",
}
// const for vip
const (
PlatfromIOS = iota + 1
PlatfromIPAD
PlatfromPC
PlatfromANDROID
PlatfromIPADHD
PlatfromIOSBLUE
PlatfromANDROIDBLUE
PlatfromPUBLIC
PlatfromAutoRenewServer
PlatfromANDROIDI //安卓国际版
)
// const for vip
const (
DeviceIOS = iota + 1
DeviceIPAD
DevicePC
DeviceANDROID
DeviceIPADHD
DEVICEIOSBLUE
DEVICEANDROIDBLUE
DEVICEPUBLIC
)
// const for vip
const (
MobiAppIphone = iota + 1
MobiAppIpad
MobiAppPC
MobiAppANDROID
)
//PlatformByName .
var PlatformByName = map[string]int{
"ios": PlatfromIOS,
"ipad": PlatfromIPAD,
"pc": PlatfromPC,
"android": PlatfromANDROID,
"ipadhd": PlatfromIPADHD,
"ios_b": PlatfromIOSBLUE,
"android_b": PlatfromANDROIDBLUE,
"public": PlatfromPUBLIC,
}
//PlatformByCode .
var PlatformByCode = map[int]string{
PlatfromIOS: "ios",
PlatfromIPAD: "ipad",
PlatfromPC: "pc",
PlatfromANDROID: "android",
}
//MobiAppByName .
var MobiAppByName = map[string]int{
"iphone": MobiAppIphone,
"ipad": MobiAppIpad,
"pc": MobiAppPC,
"android": MobiAppANDROID,
}
//PayWayName payWay name
var PayWayName = map[int8]string{
ALIPAY: "支付宝",
WECHAT: "微信",
BCION: "B币",
BANK: "银行卡",
PAYPAL: "paypal",
IOSPAY: "iospay",
QPAY: "qpay",
}
// user discount history enum
const (
FirstDiscountBuyVip int64 = iota + 1
)
//PayPlatform vip mapping platform
var PayPlatform = map[int]int8{
DeviceIOS: 2,
DeviceIPAD: 2,
DevicePC: 1,
DeviceANDROID: 1,
}
// vip pay remark
const (
RemarkBuy = "充值开通"
RemarkGift = "好友赠送"
)
// business status
const (
StatusOpen = iota //有效
StatusClose = 1 //无效
)
// business status
const (
BizTypeIn = iota //内部
BizTypeOut = 1 //外部
)
//code status
const (
CodeUnUse int8 = iota + 1
CodeUse
CodeFrozen
)
// point change type
const (
ExchangeVip = iota + 1
Charge //充电
Contract //承包
PointSystem //系统发放
FYMReward //分院帽奖励
ExchangePendant //兑换挂件
MJActive //萌节活动
ReAcquirePointDedution //重复领取
)
// user discount
const (
UnUse int8 = iota
Used
)
// IsAutoRenewed is auto renewed.
const (
IsAutoRenewed int32 = 1
)
// bcoin salary status.
const (
BcoinUnissued int8 = iota
Grant
)
// vip status.
const (
Expire int32 = iota
NotExpired
Freeze
Block
)
//batch code status
const (
Nomal = iota
OnlyNotVip
)
// batch status
const (
BatchNormal int8 = iota + 1
BatchFrozen
)
// tips judge type .
const (
VersionTypeNone int8 = iota
VersionMoreThan
VersionEqual
VersionLessThan
)
// vip pay type.
const (
NormalPay int32 = iota
AutoRenewPay
)
// vip tips.
const (
PanelPosition int8 = iota + 1
PgcPosition
)
// switch.
const (
SwitchClose int8 = iota
SwitchOpen
)
const (
// VipUserFirstDiscount 促销类型
VipUserFirstDiscount = 1
)
// Discount status.
const (
DiscountNotUse = iota
DiscountUsed
)
// privilege type.
const (
AllPrivilege int8 = iota
OnlyAnnualPrivilege
)
// privilege resources type.
const (
WebResources = iota
AppResources
)
// privilege title.
const (
PrivilegeTitle = "大会员权益"
AnnualPrivilegeTitle = "年度大会员权益"
)
// plat arg
const (
DeviceIapdName = "pad"
MobiAppIpadName = "ipad"
)
// pay service type
const (
ServiceTypeNormal = 0
ServiceTypeInternational = 2
ServiceTypePublic = 1
ServiceTypeAuto = 7
ServiceTypeIap = 100
)
// pay sub type
const (
PaySubTypeAuto = 1
)
// vip pay type.
const (
NormalPayType int8 = iota
AutoRenewPayType
IapAutoRenewPayType
)
// pay showTitle.
const (
NormalShowTitle = "购买大会员"
AutoRenewShowTitle = "购买大会员连续包月"
)
// vip panel user explain.
const (
UserNotLoginExplain = "点击头像登录或注册优惠价开通大会员"
NotVipExplain = "你还不是大会员,开通福利多多"
ExpireVipExplain = "大会员离你而去了,快来续期吧"
YYYYDDVipExplain = "%s到期,购买后有效期将顺延"
WillExplainVipExplain = "只剩%d天大会员就要离开你而去啦,快来续期吧"
)
// pay param show content.
const (
ShowContent = "购买%d个月大会员"
)
// pay channel id
const (
IapPayChannelID = 100
)

View File

@@ -0,0 +1,65 @@
package model
// PayNotifyContent def.
type PayNotifyContent struct {
TxID int64 `json:"txId"`
OrderID string `json:"orderId"`
PayAmount int64 `json:"payAmount"`
PayChannel string `json:"payChannel"`
PayChannelID int32 `json:"payChannelId"`
PayStatus string `json:"payStatus"`
CustomerID int64 `json:"customerId"`
ExpiredTime int64 `json:"expiredTime"`
}
// PayNotifyContentOld .
type PayNotifyContentOld struct {
TradeNO string `json:"txId"`
OrderID string `json:"orderId"`
PayAmount int64 `json:"payAmount"`
PayChannel string `json:"payChannel"`
PayChannelID int32 `json:"payChannelId"`
PayStatus string `json:"payStatus"`
CustomerID int64 `json:"customerId"`
}
// PayCallBackResult def.
type PayCallBackResult struct {
TradeNO string `json:"trade_no" form:"trade_no"`
OutTradeNO string `json:"out_trade_no" form:"out_trade_no"`
TradeStatus int8 `json:"trade_status" form:"trade_status"`
Bp float64 `json:"bp" form:"bp"`
}
//PaySignNotify .
type PaySignNotify struct {
ChangeType string `json:"changeType"`
PayChannel string `json:"payChannel"`
UID int64 `json:"uid"`
CustomerID int64 `json:"customerId"`
}
//PayRefundNotify pay refund notify.
type PayRefundNotify struct {
CustomerID int64 `json:"customerId"`
OrderID string `json:"orderId"`
TxID int64 `json:"txId"`
RefundCount int64 `json:"refundCount"`
PayChannel int64 `json:"payChannel"`
PayChannelID int32 `json:"payChannelId"`
BatchRefundList []*PayRefundList `json:"batchRefundList"`
}
//PayRefundList pay refund list.
type PayRefundList struct {
CustomerRefundID string `json:"customerRefundId"`
RefundStatus string `json:"refundStatus"`
RefundStatusDesc string `json:"refundStatusDesc"`
RefundAmount int64 `json:"refundAmount"`
}
// trade status.
const (
TradeSuccess int8 = iota
TradeFailed
)

View File

@@ -0,0 +1,43 @@
package model
import "go-common/library/time"
//VipUserInfo vip_user_info table for vip java
type VipUserInfo struct {
ID int64 `json:"id"`
Mid int64 `form:"mid" validate:"required" json:"mid"`
VipType int32 `form:"vipType" json:"vipType"`
VipStatus int32 `form:"vipStatus" json:"vipStatus"`
VipStartTime time.Time `form:"vipStartTime" validate:"required" json:"vipStartTime"`
VipRecentTime time.Time `form:"vipRecentTime" json:"vipRecentTime"`
VipOverdueTime time.Time `form:"vipOverdueTime" validate:"required" json:"vipOverdueTime"`
AnnualVipOverdueTime time.Time `form:"annualVipOverdueTime" json:"annualVipOverdueTime"`
Wander int8 `json:"wander"`
AccessStatus int8 `json:"accessStatus"`
Ctime time.Time `form:"ctime" validate:"required" json:"ctime"`
Mtime time.Time `form:"mtime" validate:"required" json:"mtime"`
Ver int64 `form:"ver" json:"ver"`
AutoRenewed int8 `form:"autoRenewed" json:"autoRenewed"`
IsAutoRenew int32 `form:"isAutoRenew" json:"isAutoRenew"`
PayChannelID int32 `form:"payChannelId" json:"payChannelId"`
IosOverdueTime time.Time `form:"iosOverdueTime" json:"iosOverdueTime"`
}
// ToNew convert old model to new.
func (v *VipUserInfo) ToNew() (res *VipInfoDB) {
return &VipInfoDB{
Mid: v.Mid,
VipType: v.VipType,
VipPayType: v.IsAutoRenew,
PayChannelID: v.PayChannelID,
VipStatus: v.VipStatus,
VipStartTime: v.VipStartTime,
VipRecentTime: v.VipRecentTime,
VipOverdueTime: v.VipOverdueTime,
AnnualVipOverdueTime: v.AnnualVipOverdueTime,
Ctime: v.Ctime,
Mtime: v.Ctime,
IosOverdueTime: v.IosOverdueTime,
Ver: v.Ver,
}
}

View File

@@ -0,0 +1,364 @@
package model
import (
"go-common/library/time"
)
// order status
const (
PAYING int8 = iota + 1
SUCCESS
FAILED
Sign
UnSign
REFUNDING
REFUNDED
REFUNDFAIL
CANCEL = 20
)
// order type
const (
General int8 = iota
AutoRenew
)
// quick pay status
const (
QuickPaySuccess int8 = iota + 1
QuickPayFailed
)
// pay way
const (
ALIPAY int8 = iota + 1
WECHAT
BCION
BANK
PAYPAL
IOSPAY
QPAY
)
// pay origin
const (
MobileOrigin int8 = iota + 1
WebOrigin
H5
)
// PayType pay type
var PayType = map[int8]string{
ALIPAY: "alipay",
WECHAT: "wechat",
BCION: "bp",
BANK: "bank",
PAYPAL: "paypal",
IOSPAY: "iospay",
QPAY: "qpay",
}
// PayTypeName pay name.
var PayTypeName = map[string]int8{
"alipay": ALIPAY,
"wechat": WECHAT,
"bp": BCION,
"bank": BANK,
"paypal": PAYPAL,
"iospay": IOSPAY,
}
// AddPayOrderResp add pay order
type AddPayOrderResp struct {
OrderNo string `json:"order_no"`
CashierURL string `json:"cashier_url"`
QrcodeURL string `json:"qrcode_url"`
}
//PayBankResp pay bank resp
type PayBankResp struct {
BanckCode string `json:"bankCode"`
Name string `json:"name"`
Res string `json:"res"`
}
//PayAccountResp .
type PayAccountResp struct {
Mid int64 `json:"mid"`
Brokerage float64 `json:"brokerage"`
DefaultBp float64 `json:"default_bp"`
}
//APIPayOrderResp api pay resp.
type APIPayOrderResp struct {
SDK string `json:"sdk"`
QrcodeURL string `json:"qrcode_url"`
CashierURL string `json:"cashier_url"`
RechargeOrderNo string `json:"recharge_order_no"`
}
// QucikPayResp quick pay token.
type QucikPayResp struct {
Token string `json:"token"`
}
// PayRetResp pay ret response.
type PayRetResp struct {
Status int8 `json:"status"`
}
// BuyVipResp buy vip resp.
type BuyVipResp struct {
Qrcode string `json:"qrcode"`
CashierURL string `json:"cashier_url"`
OrderNo string `json:"orderNo"`
RechargeOrderNo string `json:"rechargeOrderNo"`
PayPayOrderNo string `json:"payPayOrderNo"`
PaySign string `json:"paySign"`
Status int8 `json:"status"`
ProductID string `json:"productId"`
}
//PayOrder pay order
type PayOrder struct {
ID int64 `json:"_"`
OrderNo string `json:"order_no"`
AppID int64 `json:"app_id"`
Platform int8 `json:"platform"`
OrderType int8 `json:"order_type"`
AppSubID string `json:"app_sub_id"`
Mid int64 `json:"mid"`
ToMid int64 `json:"to_mid"`
BuyMonths int16 `json:"buy_months"`
Money float64 `json:"money"`
RefundAmount float64 `json:"refund_amount"`
Status int8 `json:"status"`
PayType int8 `json:"pay_type"`
RechargeBp float64 `json:"recharge_bp"`
ThirdTradeNo string `json:"third_trade_no"`
Ver int64 `json:"ver"`
CouponMoney float64 `json:"coupon_money"`
PaymentTime time.Time `json:"payment_time"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
PID int64 `json:"p_id"`
UserIP []byte `json:"-"`
}
//PayOrderResp pay order resp.
type PayOrderResp struct {
OrderNo string `json:"order_no"`
BuyMonths int16 `json:"buy_months"`
Money float64 `json:"money"`
Status int8 `json:"status"`
Remark string `json:"remark"`
Ctime time.Time `json:"ctime"`
}
// Month def.
type Month struct {
ID int64 `json:"_"`
Month int16 `json:"month"`
MonthType int8 `json:"month_type"`
Operator string `json:"operator"`
Status int8 `json:"status"`
Deleted int8 `json:"deleted"`
Mtime time.Time `json:"mtime"`
}
// PriceMapping vip month map.
type PriceMapping struct {
ID int64 `json:"_"`
MonthID int64 `json:"month_id"`
MonthType int8 `json:"month_type"`
Money float64 `json:"money"`
Selected int8 `json:"selected"`
FirstDiscountMoney float64 `json:"first_discount_money"`
DiscountMoney float64 `json:"discount_money"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Remark string `json:"remark"`
Operator string `json:"operator"`
Mtime time.Time `json:"mtime"`
}
//PayPlatformOrder .
type PayPlatformOrder struct {
CustomerID string `json:"customerId"`
DeviceType int8 `json:"deviceType"`
OrderID string `json:"orderId"`
OrderCreateTime string `json:"orderCreateTime"`
OrderExpire int64 `json:"orderExpire"`
NotifyURL string `json:"notifyUrl"`
SignURL string `json:"signUrl"`
ShowTitle string `json:"showTitle"`
TraceID string `json:"traceId"`
Timestamp string `json:"timestamp"`
Version string `json:"version"`
SignType string `json:"signType"`
Sign string `json:"sign"`
ProductID string `json:"productId"`
PayAmount int32 `json:"payAmount"`
PlanID int32 `json:"planId"`
UID int64 `json:"uid"`
DisplayAccount string `json:"displayAccount"`
ServiceType int32 `json:"serviceType"`
OriginalAmout int32 `json:"originalAmount"`
}
// OrderInfo order info.
type OrderInfo struct {
ID int64
OrderNo string
AppID int64
OrderType int8
Platform int8
Mid int64
ToMid int64
BuyMonths int16
Money float64
RefundAmount float64
Status int8
PayType string
RechargeBP float64
ThirdTradeNo string
PaymentTime time.Time
Ver int64
Ctime time.Time
Mtime time.Time
AppSubID string
}
//OrderMng .
type OrderMng struct {
Username string `json:"username"`
Mid int64 `json:"mid"`
IsAutoRenew int8 `json:"isAuto_renew"`
ExpireDate string `json:"expire_date"`
NextDedutionDate string `json:"next_dedution_date"`
AutoRenewLoop string `json:"auto_renew_loop"`
PriceTip string `json:"price_tip"`
ChannelID int32 `json:"channel_id"`
PayType string `json:"pay_type"`
}
// OrderMessage .
type OrderMessage struct {
LeftButton string `json:"left_button"`
RightButton string `json:"right_button"`
LeftButtonLink string `json:"left_button_link"`
RightButtonLink string `json:"right_button_link"`
Title string `json:"title"`
Content string `json:"content"`
}
//VipUserDiscountHistory .
type VipUserDiscountHistory struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
DiscountID int64 `json:"discount_id"`
OrderNo string `json:"order_no"`
Status int8 `json:"status"`
}
//PannelInfo .
type PannelInfo struct {
VipMonths []*VipMonthsPriceBo `json:"vipMonths"`
PayTypes []*PayTypeBo `json:"payTypes"`
BcoinTips string `json:"bcoinTips"`
}
//PayTypeBo .
type PayTypeBo struct {
Name string `json:"name"`
Code string `json:"code"`
Banks []*PayBankBo `json:"banks"`
}
//VipMonthsPriceBo .
type VipMonthsPriceBo struct {
ID int64 `json:"_"`
Month int16 `json:"month"`
DiscountRate string `json:"discount_rate"`
MonthStr string `json:"month_str"`
MonthID int64 `json:"month_id"`
OrderType int8 `json:"order_type"`
MonthType int8 `json:"month_type"`
OriginalPrice float64 `json:"original_price"`
Selected int8 `json:"selected"`
FirstDiscountMoney float64 `json:"first_discount_money"`
Price float64 `json:"price"`
Remark string `json:"remark"`
}
//PayBankBo .
type PayBankBo struct {
Code string `json:"code"`
Name string `json:"name"`
Image string `json:"image"`
}
//VipPayOrderLog vip pay order log table
type VipPayOrderLog struct {
ID int64 `json:"id"`
OrderNo string `json:"order_no"`
RefundID string `json:"refund_id"`
RefundAmount float64 `json:"refund_amount"`
Mid int64 `json:"mid"`
Status int8 `json:"status"`
}
//VipPayOrderOld vip pay order table
type VipPayOrderOld struct {
ID int64 `json:"id"`
OrderNo string `json:"orderNo"`
AppID int64 `json:"appId"`
Platform int8 `json:"platform"`
OrderType int8 `json:"orderType"`
Mid int64 `json:"mid"`
Bmid int64 `json:"bmid"`
BuyMonths int16 `json:"buyMonths"`
Money float64 `json:"money"`
Status int8 `json:"status"`
PayType int8 `json:"payType"`
PaymentTime time.Time `json:"paymentTime"`
Ver int64 `json:"ver"`
AppSubID string `json:"appSubId"`
PID int64 `json:"pid"`
UserIP []byte `json:"user_ip"`
}
//VipOldPayOrder vip pay order table
type VipOldPayOrder struct {
ID int64
OrderNo string
AppID int64
Platform int8
OrderType int8
Mid int64
Bmid int64
BuyMonths int16
Money float64
Status int8
PaymentTime time.Time
Ver int64
AppSubID string
CouponMoney float64
PID int64 //套餐ID
UserIP []byte
}
// VipOldRechargeOrder vip recharge order.
type VipOldRechargeOrder struct {
AppID int64
PayMid int64
OrderNo string
RechargeBp float64
PayOrderNO string
Status int8
Remark string
Ver int64
Ctime time.Time
Bmid int64
ThirdTradeNO string
}

View File

@@ -0,0 +1,245 @@
package model
import (
"fmt"
"math"
"strconv"
colapi "go-common/app/service/main/coupon/api"
col "go-common/app/service/main/coupon/model"
"go-common/library/time"
)
// vip_price_config suit_type
const (
AllUser int8 = iota
OldVIP
NewVIP
OldSubVIP
NewSubVIP
OldPackVIP
NewPackVIP
)
// order type
const (
NoRenew int8 = iota
OtherRenew
IOSRenew
)
// order type by month for vip_user_discount_history table
const (
OneMonthSub int8 = iota + 1
ThreeMonthSub
OneYearSub
)
// const month
const (
OneMonth = int8(1)
ThreeMonth = int8(3)
OneYear = int8(12)
)
// const vip_price_config beforeSuitType
const (
All int8 = iota
VIP
Sub
Pack
)
// const panel month sort
const (
PanelMonthDESC int8 = iota
PanelMonthASC
)
// const PanelType
const (
PanelTypeNormal = "normal"
PanelTypeFriend = "friend"
PanelTypeCheck = "check"
PanelTypeEle = "ele"
)
const (
// PlatVipPriceConfigOther 其他平台
PlatVipPriceConfigOther int64 = iota + 1
// PlatVipPriceConfigIOS IOS平台
PlatVipPriceConfigIOS
// PlatVipPriceConfigIPADHD ipad hd平台
PlatVipPriceConfigIPADHD
// PlatVipPriceConfigFriendsGift 好友赠送
PlatVipPriceConfigFriendsGift
// PlatVipPriceConfigInternational 安卓国际版
PlatVipPriceConfigInternational
// PlatVipPriceConfigIphoneB iphone蓝版
PlatVipPriceConfigIphoneB
// PlatVipPriceConfigCheck 审核态价格
PlatVipPriceConfigCheck = 20
)
// const select
const (
PanelNotSelected int32 = iota
PanelSelected
)
// VipPriceConfig price config.
type VipPriceConfig struct {
ID int64 `json:"id"`
Plat int64 `json:"platform"`
PdName string `json:"product_name"`
PdID string `json:"product_id"`
SuitType int8 `json:"suit_type"`
TopSuitType int8 `json:"-"`
Month int16 `json:"month"`
SubType int8 `json:"sub_type"`
OPrice float64 `json:"original_price"`
DPrice float64 `json:"discount_price"`
Selected int32 `json:"selected"`
Remark string `json:"remark"`
Status int8 `json:"status"`
Forever bool `json:"-"`
Operator string `json:"operator"`
OpID int64 `json:"oper_id"`
Superscript string `json:"superscript"`
StartBuild int64 `json:"start_build"`
EndBuild int64 `json:"end_build"`
PanelType string `json:"panel_type"`
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
}
// VipPirceResp vip pirce resp.
type VipPirceResp struct {
Vps []*VipPanelInfo `json:"price_list"`
CouponInfo *col.CouponAllowancePanelInfo `json:"coupon_info"`
CouponSwith int8 `json:"coupon_switch"`
CodeSwitch int8 `json:"code_switch"`
GiveSwitch int8 `json:"give_switch"`
ExistCoupon int8 `json:"exist_coupon"`
Privileges *PrivilegesResp `json:"privileges"`
}
// VipPirceResp5 vip pirce resp.
type VipPirceResp5 struct {
Vps []*VipPanelInfo `json:"price_list"`
CouponInfo *col.CouponAllowancePanelInfo `json:"coupon_info"`
CouponSwith int8 `json:"coupon_switch"`
CodeSwitch int8 `json:"code_switch"`
GiveSwitch int8 `json:"give_switch"`
Privileges map[int8]*PrivilegesResp `json:"privileges"`
}
// VipPirceRespV9 vip pirce resp v9.
type VipPirceRespV9 struct {
Vps []*VipPanelInfo `json:"price_list"`
Coupon *colapi.UsableAllowanceCouponV2Reply `json:"coupon"`
CouponSwith int8 `json:"coupon_switch"`
CodeSwitch int8 `json:"code_switch"`
GiveSwitch int8 `json:"give_switch"`
Privileges map[int8]*PrivilegesResp `json:"privileges"`
}
// VipDPriceConfig price discount config.
type VipDPriceConfig struct {
ID int64 `json:"id"`
PdID string `json:"product_id"`
DPrice float64 `json:"discount_price"`
STime time.Time `json:"stime"`
ETime time.Time `json:"etime"`
Remark string `json:"remark"`
Operator string `json:"operator"`
OpID int64 `json:"oper_id"`
CTime time.Time `json:"ctime"`
MTime time.Time `json:"mtime"`
FirstPrice float64 `json:"first_price"`
}
// DoTopSuitType .
func (vpc *VipPriceConfig) DoTopSuitType() {
switch vpc.SuitType {
case OldPackVIP, NewPackVIP:
vpc.TopSuitType = Pack
case OldSubVIP, NewSubVIP:
vpc.TopSuitType = Sub
case OldVIP, NewVIP:
vpc.TopSuitType = VIP
case AllUser:
vpc.TopSuitType = All
}
}
// DoCheckRealPrice ,
func (vpc *VipPriceConfig) DoCheckRealPrice(mvp map[int64]*VipDPriceConfig) {
if vp, ok := mvp[vpc.ID]; ok {
vpc.PdID = vp.PdID
vpc.DPrice = vp.DPrice
vpc.Remark = vp.Remark
if vp.FirstPrice > 0 && vpc.SubType == AutoRenew {
vpc.DPrice = vp.FirstPrice
}
}
if vpc.DPrice == 0 {
vpc.DPrice = vpc.OPrice
}
}
// DoSubMonthKey .
func (vpc *VipPriceConfig) DoSubMonthKey() string {
return fmt.Sprintf("%d%d", vpc.Month, vpc.SubType)
}
// FormatRate .
func (vpc *VipPriceConfig) FormatRate() string {
if vpc.DPrice == 0 {
return ""
}
if vpc.DPrice/vpc.OPrice == 1 {
return ""
}
return strconv.FormatFloat(math.Floor((vpc.DPrice/vpc.OPrice)*100)/10, 'f', -1, 64) + "折"
}
// DoPayOrderTypeKey .
func (po *PayOrder) DoPayOrderTypeKey() string {
if po.OrderType == IOSRenew {
po.OrderType = OtherRenew
}
return fmt.Sprintf("%d%d", po.BuyMonths, po.OrderType)
}
// IsSub .
func (po *PayOrder) IsSub() bool {
return po.OrderType == OtherRenew || po.OrderType == IOSRenew
}
// VipPirce vip pirce.
type VipPirce struct {
Panel *VipPanelInfo `json:"pirce_info"`
Coupon *col.CouponAllowanceInfo `json:"coupon_info"`
}
// VipPanelExplain vip panel explain.
type VipPanelExplain struct {
BackgroundURL string `json:"background_url"`
Explain string `json:"user_explain"`
}
// FilterBuild filter price build .
func (vpc *VipPriceConfig) FilterBuild(build int64) bool {
if (vpc.StartBuild != 0 && vpc.StartBuild > build) || (vpc.EndBuild != 0 && vpc.EndBuild < build) {
return false
}
return true
}
// ArgProductLimit args product limit.
type ArgProductLimit struct {
Mid int64
Months int32
PanelType string
}

View File

@@ -0,0 +1,235 @@
package model
import (
"net"
"go-common/library/time"
)
// ArgDevice .
type ArgDevice struct {
Device string `form:"device" default:"pc"`
Build int64 `form:"build" default:"0"`
}
// ArgMid .
type ArgMid struct {
Mid int64 `form:"mid" validate:"required"`
}
//ArgPannel .
type ArgPannel struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
Platform string `form:"platform" validate:"required"`
}
//ArgChangeHistory .
type ArgChangeHistory struct {
Mid int64 `form:"mid" validate:"required"`
Pn int `form:"pn"`
Ps int `form:"ps"`
}
// ArgAddOrder add order form.
type ArgAddOrder struct {
AppID int64 `form:"appId" default:"0"`
Months int64 `form:"months" validate:"required"`
AppsubID string `form:"appsubId"`
BmID int64 `form:"bmid"`
}
//ArgCreateOrder .
type ArgCreateOrder struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
AppID int64 `form:"app_id" default:"0"`
AppSubID string `form:"app_sub_id"`
Months int16 `form:"months" validate:"required,min=1,gte=1"`
OrderType int8 `form:"order_type" `
DType int8 `form:"dtype"`
Bmid int64 `form:"bmid"`
Platform string `form:"platform"`
Price float64 `form:"price"`
IP string `form:"ip"`
}
//ArgCreateOrder2 .
type ArgCreateOrder2 struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
Month int32 `form:"months" validate:"required,min=1,gte=1"`
Platform string `form:"platform"`
MobiApp string `form:"mobi_app"`
Device string `form:"device"`
AppID int64 `form:"appId"`
AppSubID string `form:"appSubId"`
OrderType int8 `form:"orderType"`
Dtype int8 `form:"dtype"`
ReturnURL string `form:"returnUrl"`
CouponToken string `form:"coupon_token"`
Bmid int64 `form:"bmid"`
PanelType string `form:"panel_type" default:"normal"`
Build int64 `form:"build"`
IP net.IP
}
// ArgPrice def.
type ArgPrice struct {
Month int16 `form:"month"`
Platform int `form:"platform"`
Mt int8 `form:"mt"`
DiscountStatus int8
}
// ArgPriceV2 arg price v2.
type ArgPriceV2 struct {
Mid int64
Month int16
SubType int8
Token string
Platform string
PanelType string
MobiApp string
Device string
Build int64
}
// ArgCreateOrderPlatform def.
type ArgCreateOrderPlatform struct {
Mid int64 `form:"mid"`
AppID int64 `form:"appId"`
Bmid int64 `form:"bmid"`
Month int16 `form:"months"`
Price float64 `form:"price"`
Platform int `form:"platform"`
Dtype int8 `form:"dtype"`
OrderType int8 `form:"orderType"`
AppSubID string `form:"appsubId"`
}
// ArgUseBatch def.
type ArgUseBatch struct {
BatchID int64 `form:"batch_id" validate:"required" json:"batch_id"`
Mid int64 `form:"mid" validate:"required" json:"mid"`
OrderNo string `form:"order_no" validate:"required" json:"order_no"`
Remark string `form:"remark" validate:"required" json:"remark"`
Appkey string `form:"appkey" validate:"required" json:"appkey"`
Sign string `form:"sign"`
Ts int64 `form:"ts"`
}
//ToMap .
func (arg *ArgUseBatch) ToMap() map[string]interface{} {
mapVal := make(map[string]interface{})
mapVal["batch_id"] = arg.BatchID
mapVal["mid"] = arg.Mid
mapVal["order_no"] = arg.OrderNo
mapVal["remark"] = arg.Remark
mapVal["appkey"] = arg.Appkey
mapVal["sign"] = arg.Sign
mapVal["ts"] = arg.Ts
return mapVal
}
// ArgBuyVip def.
type ArgBuyVip struct {
AppID int64 `form:"appId" default:"0"`
Months int16 `form:"months" validate:"required"`
PayWay string `form:"payWay" validate:"required"`
Bmid int64 `form:"bmid"`
BankCode string `form:"bank_code"`
ProductID string `form:"productId"`
AppSubID string `form:"appsubId"`
AccessKey string `form:"access_key"`
Platform string `form:"platform"`
}
//ArgBuyPoint .
type ArgBuyPoint struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
Month int16 `form:"month" validate:"required" `
}
// ArgOldPayOrder def.
type ArgOldPayOrder struct {
OrderNo string `form:"order_no" validate:"required"`
AppID int64 `form:"app_id"`
Platform int8 `form:"platform" `
OrderType int8 `form:"order_type"`
AppSubID string `form:"app_sub_id"`
Mid int64 `form:"mid"`
ToMid int64 `form:"to_mid"`
BuyMonths int16 `form:"buy_months" validate:"required,min=1,gte=1"`
Money float64 `form:"money" validate:"required"`
Status int8 `form:"status"`
PayType int8 `form:"pay_type"`
RechargeBp float64 `form:"recharge_bp"`
ThirdTradeNo string `form:"third_trade_no"`
}
// ArgVipConfig .
type ArgVipConfig struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
Device string `form:"device"`
MobiApp string `form:"mobi_app"`
SortType int8 `form:"sort_type"`
PanelType string `form:"panel_type" default:"normal"`
Build int64 `form:"build"`
}
//ArgCodeOpened code opened.
type ArgCodeOpened struct {
BisAppkey string `form:"bis_appkey"`
BisSign string `form:"bis_sign"`
BisTs int64 `form:"bis_ts"`
StartTime time.Time `form:"start_time"`
EndTime time.Time `form:"end_time"`
Cursor int64 `form:"cursor"`
}
//ToMap .
func (arg *ArgCodeOpened) ToMap() map[string]interface{} {
mapval := make(map[string]interface{})
mapval["appkey"] = arg.BisAppkey
mapval["sign"] = arg.BisSign
mapval["ts"] = arg.BisTs
mapval["start_time"] = arg.StartTime
mapval["end_time"] = arg.EndTime
mapval["cursor"] = arg.Cursor
return mapval
}
// ArgVipConfigMonth .
type ArgVipConfigMonth struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
Device string `form:"device"`
MobiApp string `form:"mobi_app"`
Month int16 `form:"month" validate:"required,min=1,gte=1"`
SubType int8 `form:"sub_type" validate:"min=0,max=1"`
CouponToken string `form:"coupon_token"`
Platform string `form:"platform" default:"pc"`
PanelType string `form:"panel_type" default:"normal"`
IgnoreAutoRenewStatus int8 `form:"ignore_autorenew_status"`
Build int64 `form:"build"`
}
//ArgCancelUseCoupon cancel use coupon.
type ArgCancelUseCoupon struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
CouponToken string `form:"coupon_token" validate:"required"`
}
// ArgAssociateVip associate vip arg.
type ArgAssociateVip struct {
Platform string `form:"platform"`
MobiApp string `form:"mobi_app"`
Device string `form:"device"`
}
// ArgPriceByProduct arg price by product.
type ArgPriceByProduct struct {
ProductID string `form:"product_id" validate:"required"`
}
// ArgVipPriceByID arg vip price.
type ArgVipPriceByID struct {
ID int64 `form:"id" validate:"required"`
}

View File

@@ -0,0 +1,88 @@
package model
import "github.com/satori/go.uuid"
// qr tip
const (
QrTip = "请使用微信、支付宝或QQ扫码支付"
QrAutoRenewTip = "请使用微信扫码支付"
)
//APIPayCancelResp api pay cancel resp.
type APIPayCancelResp struct {
TraceID string `json:"traceId"`
ServerTime int64 `json:"serverTime"`
CustomerID int64 `json:"customerId"`
OrderID string `json:"orderId"`
OrderCloseTime int64 `json:"orderCloseTime"`
}
// UUID4 is generate uuid
func UUID4() string {
return uuid.NewV4().String()
}
// PayParam call pay param.
type PayParam struct {
CustomerID int64 `json:"customerId,omitempty"`
DeviceType int8 `json:"deviceType,omitempty"`
DefaultChoose string `json:"defaultChoose,omitempty"`
OrderID string `json:"orderId,omitempty"`
OrderCreateTime int64 `json:"orderCreateTime,omitempty"`
OrderExpire int `json:"orderExpire,omitempty"`
NotifyURL string `json:"notifyUrl,omitempty"`
CreateIP string `json:"createIp,omitempty"`
SignURL string `json:"signUrl,omitempty"`
ShowTitle string `json:"showTitle,omitempty"`
ShowContent string `json:"showContent,omitempty"`
TraceID string `json:"traceId,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Version string `json:"version,omitempty"`
SignType string `json:"signType,omitempty"`
Sign string `json:"sign,omitempty"`
ProductID string `json:"productId,omitempty"`
PayAmount int32 `json:"payAmount,omitempty"`
PlanID int32 `json:"planId,omitempty"`
DisplayAccount string `json:"displayAccount,omitempty"`
UID int64 `json:"uid,omitempty"`
ServiceType int `json:"serviceType,omitempty"`
OriginalAmount int32 `json:"originalAmount,omitempty"`
ReturnURL string `json:"returnUrl,omitempty"`
FeeType string `json:"feeType,omitempty"`
SubscribeType int `json:"subscribeType,omitempty"`
}
// CreateOrderRet create order ret.
type CreateOrderRet struct {
PayParam map[string]interface{} `json:"pay_param"`
Dprice float64 `json:"dprice"`
Oprice float64 `json:"oprice"`
CouponMoney float64 `json:"coupon_money"`
UserIP string `json:"user_ip"`
PID int64 `json:"p_id"`
}
// PayQrCode resp.
type PayQrCode struct {
CodeURL string `json:"codeUrl"`
ExpiredTime int64 `json:"expiredTime"`
}
// PayQrCodeResp pay qr resp.
type PayQrCodeResp struct {
CodeURL string `json:"codeUrl"`
ExpiredTime int64 `json:"expiredTime"`
Amount float64 `json:"amount"`
SaveAmount float64 `json:"saveAmount"`
Tip string `json:"tip"`
OrderNo string `json:"orderNo"`
}
// PayQrCodeRet pay qr resp.
type PayQrCodeRet struct {
PayQrCodeResp *PayQrCodeResp `json:"pay_qr_data"`
Dprice float64 `json:"dprice"`
CouponMoney float64 `json:"coupon_money"`
UserIP string `json:"user_ip"`
PID int64 `json:"p_id"`
}

View File

@@ -0,0 +1,37 @@
package model
const (
// PanelTypeDefault .
PanelTypeDefault = "normal"
// PlatformWeb .
PlatformWeb = "web"
// PlatformAndroid .
PlatformAndroid = "android"
// PlatformIos .
PlatformIos = "ios"
// DeviceIos .
DeviceIos = "ios"
)
var (
// PlatformMap 平台
PlatformMap = map[string]string{"android": "android", "ios": "ios", "pc": "pc", "public": "public"}
// DeviceMap 对应设备
DeviceMap = map[string]string{"pad": "pad", "phone": "phone"}
// MobiAPPIDIosMap iOS
MobiAPPIDIosMap = map[string]string{"iphone": "iphone", "ipad": "ipad", "iphone_b": "iphone_b"}
// MobiAPPIDAndroidMap Android
MobiAPPIDAndroidMap = map[string]string{"android": "android", "android_tv_yst": "android_tv_yst", "android_tv": "android_tv", "android_i": "android_i", "android_b": "android_b"}
// MobiAPPIDMap all
MobiAPPIDMap = map[string]string{"iphone": "iphone", "ipad": "ipad", "iphone_b": "iphone_b", "android": "android", "android_tv_yst": "android_tv_yst", "android_tv": "android_tv", "android_i": "android_i", "android_b": "android_b"}
)
// ConfPlatform struct .
type ConfPlatform struct {
ID int64 `json:"id"`
PlatformName string `json:"platform_name"`
Platform string `json:"platform"`
Device string `json:"device"`
MobiApp string `json:"mobi_app"`
PanelType string `json:"panel_type"`
}

View File

@@ -0,0 +1,18 @@
package model
//PointExchangePrice .
type PointExchangePrice struct {
ID int64 `json:"id"`
OriginPoint int32 `json:"originPoint"`
CurrentPoint int32 `json:"currentPoint"`
Month int16 `json:"month"`
PromotionTip string `json:"promotionTip"`
PromotionColor string `json:"promotionColor"`
OperatorID string `json:"operatorId"`
}
// point consume status
const (
PointConsumeSuc = 1
PointConsumeFaild = 1
)

View File

@@ -0,0 +1,68 @@
package model
import (
"go-common/app/admin/main/vip/model"
"go-common/library/time"
)
// Privilege info.
type Privilege struct {
ID int64 `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Explain string `json:"explain"`
Type int8 `json:"type"`
Operator string `json:"operator"`
State int8 `json:"state"`
Deleted int8 `json:"deleted"`
IconURL string `json:"icon_url"`
IconGrayURL string `json:"icon_gray_url"`
Order int64 `json:"order"`
LangType int64 `json:"-"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// PrivilegeResources privilege resources.
type PrivilegeResources struct {
ID int64 `json:"id"`
PID int64 `json:"pid"`
Link string `json:"link"`
ImageURL string `json:"image_url"`
Type int8 `json:"type"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// PrivilegeDetailResp privilege detail resp.
type PrivilegeDetailResp struct {
ID int64 `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Explain string `json:"explain"`
IconURL string `json:"icon_url"`
Type int8 `json:"type"`
Link string `json:"link"`
ImageURL string `json:"image_url"`
}
// PrivilegeResp privilege resp.
type PrivilegeResp struct {
Name string `json:"name"`
IconURL string `json:"icon_url"`
Type int8 `json:"type"`
}
// PrivilegesResp privileges resp.
type PrivilegesResp struct {
Title string `json:"title"`
List []*PrivilegeResp `json:"list"`
}
// ResourcesType get type by platform.
func ResourcesType(p string) int8 {
if p == "pc" {
return model.WebResources
}
return model.AppResources
}

View File

@@ -0,0 +1,7 @@
#! /bin/sh
# proto.sh
gopath=$GOPATH/src
gogopath=$GOPATH/src/go-common/vendor/github.com/gogo/protobuf
protoc --gofast_out=. --proto_path=$gopath:$gogopath:. *.proto

View File

@@ -0,0 +1,101 @@
package model
import (
"go-common/library/time"
)
//VipBusinessInfo vip_business_info table
type VipBusinessInfo struct {
ID int64 `json:"id"`
BusinessName string `json:"businessName"`
BusinessType int8 `json:"businessType"`
Status int8 `json:"status"`
AppKey string `json:"appKey"`
Secret string `json:"secret"`
Contacts string `json:"contacts"`
ContactsNumber string `json:"contactsNumber"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// VipResourcePool vip_resource_pool table
type VipResourcePool struct {
ID int64 `json:"id"`
PoolName string `json:"poolName"`
BusinessID int64 `json:"businessId"`
BusinessName string `json:"businessName"`
Reason string `json:"reason"`
CodeExpireTime time.Time `json:"codeExpireTime"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
Contacts string `json:"contacts"`
ContactsNumber string `json:"contactsNumber"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// VipResourceBatch vip_resource_batch table
type VipResourceBatch struct {
ID int64 `json:"id"`
PoolID int64 `json:"poolId"`
Unit int64 `json:"unit"`
Count int64 `json:"count"`
Ver int64 `json:"ver"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
SurplusCount int64 `json:"surplusCount"`
CodeUseCount int64 `json:"codeUseCount"`
DirectUseCount int64 `json:"directUseCount"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipResourceCode vip resource code.
type VipResourceCode struct {
ID int64 `json:"id"`
BatchCodeID int64 `json:"batch_code_id"`
Status int8 `json:"status"`
Days int32 `json:"days"`
RelationID string `json:"relation_id"`
Code string `json:"code"`
Mid int64 `json:"mid"`
UseTime time.Time `json:"use_time"`
}
//VipResourceBatchCode vip resource batchcode.
type VipResourceBatchCode struct {
ID int64 `json:"id"`
BusinessID int64 `json:"business_id"`
PoolID int64 `json:"pool_id"`
Status int8 `json:"status"`
Type int8 `json:"type"`
MaxCount int64 `json:"max_count"`
LimitDay int64 `json:"limit_day"`
BatchName string `json:"batch_name"`
Reason string `json:"reason"`
Unit int32 `json:"unit"`
Count int32 `json:"count"`
SurplusCount int32 `json:"surplus_count"`
Price float64 `json:"price"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
//VipActiveShow vip active show.
type VipActiveShow struct {
ID int64 `json:"id"`
ProductName string `json:"product_name"`
ProductPic string `json:"product_pic"`
ProductDetail string `json:"product_detail"`
RelationID string `json:"relation_id"`
BusID string `json:"bus_id"`
UseType string `json:"use_type"`
Type int16 `json:"type"`
}
//CodeInfoResp code info Response
type CodeInfoResp struct {
ID int64 `json:"id"`
UserTime time.Time `json:"user_time"`
Code string `json:"code"`
}

View File

@@ -0,0 +1,117 @@
package model
// ArgPanel .
type ArgPanel struct {
Mid int64
SortTp int8
IP string
MobiApp string
Device string
Platform string
Plat int64
PanelType string
SubType int32
Month int32
Build int64
Lang string
}
// ArgRPCMid .
type ArgRPCMid struct {
Mid int64 `json:"mid"`
}
// ArgRPCMids .
type ArgRPCMids struct {
Mids []int64 `json:"mids"`
}
// ArgRPCHistory .
type ArgRPCHistory struct {
Mid int64 `form:"mid" validate:"required"`
StartDate string `form:"start_time"`
EndDate string `form:"end_time"`
Pn int `form:"pn"`
Ps int `form:"ps"`
}
//ArgRPCCreateOrder .
type ArgRPCCreateOrder struct {
Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
AppID int64 `form:"appId" default:"0"`
AppSubID string `form:"appSubId"`
Months int16 `form:"months" validate:"required,min=1,gte=1"`
OrderType int8 `form:"orderType" `
DType int8 `form:"dtype"`
Bmid int64 `form:"bmid"`
Platform string `form:"platform"`
Price float64 `form:"price"`
IP string `form:"ip"`
}
// ArgRPCOrderNo .
type ArgRPCOrderNo struct {
OrderNo string `json:"order_no"`
}
// ArgTips arg tips.
type ArgTips struct {
Version int64 `json:"version" form:"version"`
Platform string `json:"platform" form:"platform" validate:"required"`
Position int8 `json:"position" form:"position"`
}
// ArgCouponPanel coupon panel arg.
type ArgCouponPanel struct {
Mid int64 `json:"mid"`
Sid int64 `json:"sid"`
Platform int `json:"platform"`
MobiApp string
Device string
PanelType string
Build int64
}
// ArgCouponPanelV2 coupon panel arg.
type ArgCouponPanelV2 struct {
Mid int64 `json:"mid"`
Sid int64 `json:"sid"`
}
// ArgCouponCancel coupon cancel use.
type ArgCouponCancel struct {
Mid int64 `json:"mid"`
CouponToken string `json:"coupon_token"`
IP string `json:"ip"`
}
// ArgPrivilegeDetail privilege by type.
type ArgPrivilegeDetail struct {
Type int8 `json:"type" form:"type"`
Lang string `json:"lang" form:"lang"`
Platform string `json:"platform" form:"platform" default:"pc"`
}
// ArgPrivilegeBySid privilege by sid .
type ArgPrivilegeBySid struct {
Sid int64 `json:"sid" form:"sid" validate:"required"`
Lang string `form:"lang"`
Platform string `json:"platform" form:"platform" default:"pc"`
}
// ArgPanelExplain arg explain .
type ArgPanelExplain struct {
Mid int64 `json:"mid"`
}
// ArgDialog get order result withc appID and Platform.
type ArgDialog struct {
OrderNo string `form:"order_no" validate:"required"`
Mid int64
AppID int64 `form:"app_id"`
Platform string `form:"platform" default:"pc"`
MobiApp string `form:"mobi_app"`
Device string `form:"device"`
Build int64 `form:"build"`
PanelType string `form:"panel_type" default:"normal"`
}

View File

@@ -0,0 +1,31 @@
package model
import "go-common/library/time"
// Tips def.
type Tips struct {
ID int64 `json:"id"`
Platform int64 `json:"platform"`
Version int64 `json:"version"`
Tip string `json:"tip"`
Link string `json:"link"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
Level int8 `json:"level"`
JudgeType int8 `json:"judge_type"`
Operator string `json:"operator"`
Deleted int8 `json:"deleted"`
Position int8 `json:"position"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// TipsResp tips resp.
type TipsResp struct {
ID int64 `json:"id"`
Version int64 `json:"version"`
Tip string `json:"tip"`
Link string `json:"link"`
ButtonName string `json:"button_name"`
ButtonLink string `json:"button_link"`
}

View File

@@ -0,0 +1,16 @@
package model
// VipInfoBoResp vipinfo bo resp.
type VipInfoBoResp struct {
Mid int64 `json:"mid"`
VipType int32 `json:"vip_type"`
PayType int32 `json:"pay_type"`
PayChannelID int32 `json:"pay_channel_id"`
VipStatus int32 `json:"vip_status"`
VipStartTime int64 `json:"vip_start_time"`
VipOverdueTime int64 `json:"vip_overdue_time"`
AnnualVipOverdueTime int64 `json:"annual_vip_overdue_time"`
VipRecentTime int64 `json:"vip_recent_time"`
AutoRenewed int32 `json:"auto_renewed"`
IosOverdueTime int64 `json:"ios_overdue_time"`
}

View File

@@ -0,0 +1,204 @@
package model
import (
"go-common/library/time"
)
//VipChangeHistory vip_change_history table
type VipChangeHistory struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
ChangeType int8 `json:"changeType"`
ChangeTime time.Time `json:"changeTime"`
Days int64 `json:"days"`
Month int16 `json:"month"`
OperatorID string `json:"operatorId"`
RelationID string `json:"relationId"`
BatchID int64 `json:"batchId"`
Remark string `json:"remark"`
Ctime time.Time `json:"ctime"`
BatchCodeID int64 `json:"batchCodeId"`
}
//VipAppInfo vip app info
type VipAppInfo struct {
ID int64 `json:"id"`
Type int8 `json:"type"`
Name string `json:"name"`
AppKey string `json:"appKey"`
PurgeURL string `json:"purgeUrl"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipBcoinSalary vip_bcoin_salary table
type VipBcoinSalary struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Status int8 `json:"status"`
GiveNowStatus int8 `json:"give_now_status"`
Month time.Time `json:"month"`
PayDay time.Time `json:"payday"`
Amount int64 `json:"amount"`
Memo string `json:"memo"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipConfig vipConfig
type VipConfig struct {
ID int64 `json:"id"`
ConfigKey string `json:"configKey"`
Name string `json:"name"`
Content string `json:"content"`
Description string `json:"description"`
OperatorID int64 `json:"operatorId"`
OperatorName string `json:"operatorName"`
Mtime time.Time `json:"mtime"`
}
//VipChangeBo vip change
type VipChangeBo struct {
Mid int64
ChangeType int8
ChangeTime time.Time
RelationID string
Remark string
Days int64
Months int16
BatchID int64
BatchCodeID int64
OperatorID string
}
//HandlerVip vip handler
type HandlerVip struct {
OldVipUser *VipInfoDB
VipUser *VipInfoDB
HistoryID int64
Days int64
Months int16
Mid int64
ToMid int64
}
//OldHandlerVip old vip handler
type OldHandlerVip struct {
OldVipUser *VipUserInfo
VipUser *VipUserInfo
HistoryID int64
Days int64
Months int16
Mid int64
ToMid int64
}
//BcoinSendBo bcoinSendBo
type BcoinSendBo struct {
Amount int64
DayOfMonth int64
DueDate time.Time
}
//VipBo vipBo
type VipBo struct {
Mid int64 `json:"mid"`
VipStatus int8 `json:"vipStatus"`
VipType int8 `json:"vipType"`
}
//VipListVo vipListVo
type VipListVo struct {
VipList []*VipBo `json:"vipList"`
ID int64 `json:"id"`
}
// VipInfoResp vipinfo resp.
type VipInfoResp struct {
Mid int64 `json:"mid"`
VipType int8 `json:"vip_type"`
PayType int8 `json:"pay_type"`
PayChannelID int32 `json:"pay_channel_id"`
VipStatus int32 `json:"vip_status"`
VipTotalMsec int64 `json:"vip_total_sec"`
VipHoldMsec int64 `json:"vip_hold_sec"`
VipDueMsec int64 `json:"vip_due_sec"`
VipSurplusMsec int64 `json:"vip_surplus_sec"`
DueRemark string `json:"due_remark"`
VipDueDate int64 `json:"vip_due_date"`
VipRecentTime int64 `json:"vip_recent_time"`
AutoRenewed int32 `json:"auto_renewed"`
}
//VipChangeHistoryVo .
type VipChangeHistoryVo struct {
ID string `json:"id"`
ChangeType int8 `json:"change_type"`
ChangeTypeStr string `json:"change_type_str"`
ChangeTime int64 `json:"change_time"`
Month int16 `json:"month"`
OpenRemark string `json:"open_remark"`
Days int32 `json:"days"`
Remark string `json:"remark"`
Actives []*VipActiveShow `json:"actives"`
}
//Eunm vip enum value.
const (
//ChangeType
ChangeTypePointExhchange = 1 // 积分兑换
ChangeTypeRechange = 2 //充值开通
ChangeTypeSystem = 3 // 系统发放
ChangeTypeActiveGive = 4 //活动赠送
ChangeTypeRepeatDeduction = 5 //重复领取扣除
VipDaysMonth = 31
VipDaysYear = 366
NotVip = 0 //非大会员
Vip = 1 //月度大会员
AnnualVip = 2 //年度会员
VipStatusOverTime = 0 //过期
VipStatusNotOverTime = 1 //未过期
VipStatusFrozen = 2 //冻结
VipStatusBan = 3 //封禁
VipAppUser = 1 //大会员对接业务方user缓存
VipAppPoint = 2 //大会员对接业务方积分缓存
VipChangeFrozen = -1 //冻结
VipChangeUnFrozen = 0 //解冻
VipChangeOpen = 1 //开通
VipChangeModify = 2 //变更
VipBusinessStatusOpen = 0 //有效
VipBusinessStatusClose = 1 //无效
VipOpenMsgTitle = "大会员开通成功"
VipSystemNotify = 4
VipOpenMsg = "恭喜您已开通大会员服务%s"
VipOpenKMsg = "恭喜您已续期大会员服务%s"
VipBcoinGiveContext = "尊敬的年度大会员,您本月%dB币到账啦请您随意挥霍注意会在次月%d日清零哦"
VipBcoinGiveTitle = "B币到账通知"
VipOpenMsgCode = "10_1_1"
VipBcoinGiveMsgCode = "10_99_2"
VipCustomizeMsgCode = "10_99_1"
AnnualVipBcoinDay = "annual_vip_bcoin_day" //年费VIPB券发放每月第几天
AnnualVipBcoinCouponMoney = "annual_vip_bcoin_coupon_money" //年费VIP返回B券金额
AnnualVipBcoinCouponActivityID = "annual_vip_bcoin_coupon_activity_id" //年费VIP返B券活动ID
)
// vip AccessStatus.
const (
WebHadAccess int32 = iota
)
//vip renew type
const (
NomalVip = iota
AuoRenewVip
)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
syntax = "proto3";
package account.service.vip;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "model";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
message VipInfo {
VipInfoDB VipInfoDB = 1 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
int32 AutoRenewed = 2 [(gogoproto.jsontag) = "auto_renewed"];
}
message VipInfoDB {
int64 ID = 1 [(gogoproto.jsontag) = "id"];
int64 Mid = 2 [(gogoproto.jsontag) = "mid"];
int32 VipType = 3 [(gogoproto.jsontag) = "vip_type"];
int32 VipPayType = 4 [(gogoproto.jsontag) = "vip_pay_type"];
int32 PayChannelID = 5 [(gogoproto.jsontag) = "pay_channel_id"];
int32 VipStatus = 6 [(gogoproto.jsontag) = "vip_status"];
int64 VipStartTime = 7 [(gogoproto.jsontag) = "vip_start_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 VipRecentTime = 8 [(gogoproto.jsontag) = "vip_recent_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 VipOverdueTime = 9 [(gogoproto.jsontag) = "vip_overdue_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 AnnualVipOverdueTime = 10 [(gogoproto.jsontag) = "annual_vip_overdue_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Ctime = 11 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 12 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 IosOverdueTime = 13 [(gogoproto.jsontag) = "ios_overdue_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Ver = 14 [(gogoproto.jsontag) = "ver"];
}
message VipPanelInfo {
int32 Month = 1 [(gogoproto.jsontag) = "month"];
string PdName = 2 [(gogoproto.jsontag) = "product_name"];
string PdID = 3 [(gogoproto.jsontag) = "product_id"];
int32 SubType = 4 [(gogoproto.jsontag) = "sub_type"];
int32 SuitType = 5 [(gogoproto.jsontag) = "suit_type"];
double OPrice = 6 [(gogoproto.jsontag) = "original_price"];
double DPrice = 7 [(gogoproto.jsontag) = "discount_price"];
string DRate = 8 [(gogoproto.jsontag) = "discount_rate"];
string Remark = 9 [(gogoproto.jsontag) = "remark"];
int32 Selected = 10 [(gogoproto.jsontag) = "selected"];
int64 Id = 11 [(gogoproto.jsontag) = "id"];
int32 Type = 12 [(gogoproto.jsontag) = "type"];
}
message OpenBindInfo {
int64 Mid = 1 [(gogoproto.jsontag) = "mid"];
int64 AppID = 2 [(gogoproto.jsontag) = "app_id"];
string OutOpenID = 3 [(gogoproto.jsontag) = "out_open_id"];
int32 State = 4 [(gogoproto.jsontag) = "state"];
int64 Ver = 5 [(gogoproto.jsontag) = "ver"];
int64 ID = 6 [(gogoproto.jsontag) = "-"];
}
message OpenInfo {
int64 Mid = 1 [(gogoproto.jsontag) = "mid"];
int64 AppID = 2 [(gogoproto.jsontag) = "app_id"];
string OpenID = 3 [(gogoproto.jsontag) = "open_id"];
}

View File

@@ -0,0 +1,106 @@
package model
import (
"go-common/library/time"
xtime "go-common/library/time"
)
// ArgWelfareList args for welfare list.
type ArgWelfareList struct {
Tid int64 `form:"tid"`
Recommend int64 `form:"recommend"`
Ps int64 `form:"ps"`
Pn int64 `form:"pn"`
NowTime xtime.Time `form:"-"`
}
// WelfareListResp response for welfare list.
type WelfareListResp struct {
ID int32 `json:"id"`
Name string `json:"name"`
HomepageUri string `json:"homepage_uri"`
BackdropUri string `json:"backdrop_uri"`
Tid int32 `json:"tid"`
Rank int32 `json:"rank"`
}
// WelfareTypeListResp response for welfare type list.
type WelfareTypeListResp struct {
ID int32 `json:"id"`
Name string `json:"name"`
}
// ArgWelfareInfo args for welfare info.
type ArgWelfareInfo struct {
ID int64 `form:"id"`
MID int64 `form:"mid"`
}
// WelfareInfoResp response for welfare info.
type WelfareInfoResp struct {
ID int32 `json:"id"`
Name string `json:"name"`
Desc string `json:"desc"`
ReceiveRate int `json:"receive_rate"`
HomepageUri string `json:"homepage_uri"`
BackdropUri string `json:"backdrop_uri"`
Finished bool `json:"finished"`
Received bool `json:"received"`
UsageForm int32 `json:"usage_form"`
VipType int64 `json:"vip_type"`
Stime time.Time `json:"stime"`
Etime time.Time `json:"etime"`
}
// ArgWelfareReceive args for welfare receive.
type ArgWelfareReceive struct {
Wid int64 `form:"wid"`
Mid int64 `form:"mid"`
}
// WelfareReceiveResp response for welfare receive.
type WelfareReceiveResp struct {
}
// WelfareBatchResp response for welfare batch.
type WelfareBatchResp struct {
Id int `json:"id"`
ReceivedCount int `json:"received_count"`
Count int `json:"count"`
Vtime time.Time `json:"vtime"`
}
// ReceivedCodeResp response for welfare code.
type ReceivedCodeResp struct {
ID int `json:"id"`
Mtime time.Time `json:"mtime"`
}
// UnReceivedCodeResp response for welfare unreceive.
type UnReceivedCodeResp struct {
Id int `json:"id"`
Bid int `json:"bid"`
Code string `json:"code"`
}
// ReceiveRecordResp response for welfare record.
type ReceiveRecordResp struct {
Id int `json:"id"`
Mid int `json:"mid"`
Wid int `json:"wid"`
MonthYear int `json:"month_year"`
Count int `json:"count"`
}
// MyWelfareResp response for my welfare.
type MyWelfareResp struct {
Wid int32 `json:"wid"`
Name string `json:"name"`
Desc string `json:"desc"`
UsageForm int32 `json:"usage_form"`
ReceiveUri string `json:"receive_uri"`
Code string `json:"code"`
Expired bool `json:"expired"`
Stime time.Time `json:"stime"`
Etime time.Time `json:"etime"`
}