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,68 @@
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.go",
"coupon.go",
"databus.go",
"handler.go",
"http.go",
"model.go",
"oldVip.go",
"query.go",
"vip.go",
],
embed = [":model_go_proto"],
importpath = "go-common/app/job/main/vip/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_golang_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"],
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/job/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,16 @@
package model
import "go-common/library/time"
// VipOrderActivityRecord vip record.
type VipOrderActivityRecord struct {
ID int64
Mid int64
OrderNo string
ProductID string
Months int32
PanelType string
AssociateState int32
Ctime time.Time
Mtime time.Time
}

View File

@@ -0,0 +1,23 @@
package model
// VideoCouponSalaryLog videl coupon salary log.
type VideoCouponSalaryLog struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
CouponCount int64 `json:"coupon_count"`
CouponType int8 `json:"coupon_type"`
State int8 `json:"state"`
Type int8 `json:"type"`
ExpireTime int64 `json:"expire_time"`
StartTime int64 `json:"start_time"`
Ver int64 `json:"ver"`
}
// OldSalaryLog def.
type OldSalaryLog struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
CouponCount int64 `json:"coupon_count"`
State int8 `json:"state"`
Type int8 `json:"type"`
}

View File

@@ -0,0 +1,155 @@
package model
import (
"encoding/json"
"go-common/library/time"
)
//VipUserInfoMsg get databus vip_user_info msg
type VipUserInfoMsg struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Type int8 `json:"vip_type"`
Status int8 `json:"vip_status"`
StartTime string `json:"vip_start_time"`
OverdueTime string `json:"vip_overdue_time"`
AnnualVipOverdueTime string `json:"annual_vip_overdue_time"`
RecentTime string `json:"vip_recent_time"`
Wander int8 `json:"wander"`
AutoRenewed int8 `json:"auto_renewed"`
IsAutoRenew int8 `json:"is_auto_renew"`
Ver int64 `json:"ver"`
PayChannelID int64 `json:"pay_channel_id"`
IosOverdueTime string `json:"ios_overdue_time"`
}
//VipUserInfoNewMsg .
type VipUserInfoNewMsg struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Ver int64 `json:"ver"`
VipType int8 `json:"vip_type"`
VipPayType int8 `json:"vip_pay_type"`
PayChannelID int64 `json:"pay_channel_id"`
VipStatus int8 `json:"vip_status"`
VipStartTime string `json:"vip_start_time"`
VipRecentTime string `json:"vip_recent_time"`
VipOverdueTime string `json:"vip_overdue_time"`
AnnualVipOverdueTime string `json:"annual_vip_overdue_time"`
IosOverdueTime string `json:"ios_overdue_time"`
}
//VipPointChangeHistoryMsg get databus json data
type VipPointChangeHistoryMsg struct {
ID int `json:"id"`
Mid int `json:"mid"`
Point int `json:"point"`
OrderID string `json:"order_id"`
ChangeType int `json:"change_type"`
ChangeTime string `json:"change_time"`
RelationID string `json:"relation_id"`
PointBalance int `json:"point_balance"`
Remark string `json:"remark"`
Operator string `json:"operator"`
}
//VipPayOrderOldMsg get databus json data
type VipPayOrderOldMsg struct {
ID int64 `json:"id"`
OrderNo string `json:"order_no"`
AppID int64 `json:"app_id"`
Platform int8 `json:"platform"`
OrderType int8 `json:"order_type"`
Mid int64 `json:"mid"`
Bmid int64 `json:"bmid"`
BuyMonths int16 `json:"buy_months"`
Money float64 `json:"money"`
RechargeBp float64 `json:"recharge_bp"`
Status int8 `json:"status"`
PayType int8 `json:"pay_type"`
PaymentTime string `json:"payment_time"`
Ver int64 `json:"ver"`
AppSubID string `json:"app_sub_id"`
CouponMoney float64 `json:"coupon_money"`
Ctime string `json:"ctime"`
Mtime string `json:"mtime"`
}
//VipPayOrderNewMsg .
type VipPayOrderNewMsg struct {
ID int64 `json:"id"`
OrderNo string `json:"order_no"`
AppID int64 `json:"app_id"`
Platform int8 `json:"platform"`
OrderType int8 `json:"order_type"`
Mid int64 `json:"mid"`
ToMid int64 `json:"to_mid"`
BuyMonths int16 `json:"buy_months"`
Money float64 `json:"money"`
RechargeBp float64 `json:"recharge_bp"`
ThirdTradeNo string `json:"third_trade_no"`
Status int8 `json:"status"`
PayType string `json:"pay_type"`
PaymentTime string `json:"payment_time"`
Ver int64 `json:"ver"`
AppSubID string `json:"app_sub_id"`
CouponMoney float64 `json:"coupon_money"`
}
//VipRechargeOrderMsg get databus json data
type VipRechargeOrderMsg struct {
ID int64 `json:"id"`
AppID int64 `json:"app_id"`
PayMid int64 `json:"pay_mid"`
OrderNo string `json:"order_no"`
RechargeBp float64 `json:"recharge_bp"`
ThirdTradeNo string `json:"third_trade_no"`
PayOrderNo string `json:"pay_order_no"`
Status int8 `json:"status"`
Ver int64 `json:"ver"`
Bmid int64 `json:"bmid"`
}
//VipChangeHistoryMsg vip change history msg
type VipChangeHistoryMsg struct {
Mid int64 `json:"mid"`
ChangeType int8 `json:"change_type"`
ChangeTime string `json:"change_time"`
Days int32 `json:"days"`
Month int16 `json:"month"`
OperatorID string `json:"operator_id"`
RelationID string `json:"relation_id"`
BatchID int64 `json:"batch_id"`
Remark string `json:"remark"`
BatchCodeID int64 `json:"batch_code_id"`
}
//VipBcoinSalaryMsg .
type VipBcoinSalaryMsg struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Status int8 `json:"status"`
GiveNowStatus int8 `json:"give_now_status"`
Payday string `json:"month"`
Amount int32 `json:"amount"`
Memo string `json:"memo"`
}
//Message databus message
type Message struct {
Action string `json:"action"`
Table string `json:"table"`
New json.RawMessage `json:"new"`
Old json.RawMessage `json:"old"`
}
// LoginLog login log.
type LoginLog struct {
Mid int64 `json:"mid,omitempty" form:"mid"`
IP uint32 `json:"loginip" form:"ip"`
Location string `json:"location"`
LocationID int64 `json:"location_id,omitempty"`
Time time.Time `json:"timestamp,omitempty"`
Type int8 `json:"type,omitempty"`
}

View File

@@ -0,0 +1,37 @@
package model
import "go-common/library/time"
//HandlerVip vip handler
type HandlerVip struct {
Days int32
Months int16
Mid int64
Type int8
}
//AppCache appCache
type AppCache struct {
AppID int64 `json:"appID"`
Mid int64 `json:"mid"`
}
//BcoinSendInfo .
type BcoinSendInfo struct {
Amount int32 `json:"amount"`
DueDate time.Time `json:"dueDate"`
DayOfMonth int `json:"dayOfMonth"`
}
//VipBuyResq .
type VipBuyResq struct {
Mid int64 `json:"mid"`
CouponID string `json:"coupon_id"`
OrderNo string `json:"order_no"`
}
//VipPushResq .
type VipPushResq struct {
Code int64 `json:"code"`
Data int64 `json:"data"`
}

View File

@@ -0,0 +1,8 @@
package model
// CommonResq response params.
type CommonResq struct {
Code int64 `json:"code"`
TS int64 `json:"ts"`
Message string `json:"message"`
}

View File

@@ -0,0 +1,102 @@
package model
//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 //无效
VipUserFirstDiscount = 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
HadSalaryState = 1 // 已发放
NormalVipSalaryType = 1
AnnualVipSalaryType = 2
VipSupplyType = 3
TimingSalaryType = 4
SalaryVipOrigin = 1
TimeFormatSec = "2006-01-02 15:04:05"
DayOfHour = 24
IsAutoRenew = 1
IAPChannelID = 100
MsgSystemNotify = 4
MsgCouponSalaryMc = "10_99_2"
CouponSalaryTitle = `观影劵到账通知`
CouponSalaryMsg = `大会员专享观影券已到账,#{点击查看>>}{"https://big.bilibili.com/mobile/userticket"}`
CouponToAnnualSalaryMsg = `升级年度大会员赠送观影券%d张已到账#{点击查看>>}{"https://big.bilibili.com/mobile/userticket"}`
CouponCartoonSalaryTitle = `漫画阅读劵到账通知`
CouponCartoonSalaryMsg = `大会员漫画阅读券已到账 #{点击查看>>}{"https://big.bilibili.com/mobile/userticket"}`
CouponCartoonToAnnualSalaryMsg = `升级年度大会员赠送漫画阅读券%d张已到账#{点击查看>>}{"https://big.bilibili.com/mobile/userticket"}`
)
// dicount type
const (
DiscountNotUse = iota
DiscountUsed
)
// coupon salary type
const (
CouponSalaryTiming int8 = iota
CouponSalaryAtonce
)
// coupon type
const (
SalaryCouponType int8 = iota + 1
SalaryCartoonCouponType
)
//pay order type
const (
Normal = iota
AutoRenew
IAPAutoRenew
)
//pay order status
const (
PAYING = iota + 1
SUCCESS
FAILED
SIGN
UNSIGN
)

View File

@@ -0,0 +1,91 @@
package model
import "go-common/library/time"
//VipUserInfoOld vip_user_info table
type VipUserInfoOld struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Type int8 `json:"vipType"`
Status int8 `json:"vipStatus"`
StartTime time.Time `json:"vipStartTime"`
OverdueTime time.Time `json:"vipOverdueTime"`
AnnualVipOverdueTime time.Time `json:"annualVipOverdueTime"`
RecentTime time.Time `json:"vip_recent_time"`
Wander int8 `json:"wander"`
AccessStatus int8 `json:"accessStatus"`
AutoRenewed int8 `json:"auto_renewed"`
IsAutoRenew int8 `json:"is_auto_renew"`
IosOverdueTime time.Time `json:"ios_overdue_time"`
PayChannelID int64 `json:"pay_channel_id"`
Ver int64 `json:"ver"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
// ToNew convert old model to new.
func (v *VipUserInfoOld) ToNew() (n *VipUserInfo) {
return &VipUserInfo{
Mid: v.Mid,
Type: v.Type,
PayType: v.IsAutoRenew,
PayChannelID: v.PayChannelID,
Status: v.Status,
StartTime: v.StartTime,
RecentTime: v.RecentTime,
OverdueTime: v.OverdueTime,
AnnualVipOverdueTime: v.AnnualVipOverdueTime,
Ctime: v.Ctime,
Mtime: v.Mtime,
IosOverdueTime: v.IosOverdueTime,
Ver: v.Ver,
}
}
//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"`
CouponMoney float64 `json:"coupon_money"`
}
//VipRechargeOrder vip recharge order table
type VipRechargeOrder struct {
ID int `json:"id"`
AppID int `json:"appId"`
PayMid int `json:"payMid"`
OrderNo string `json:"orderNo"`
RechargeBp float64 `json:"rechargeBp"`
ThirdTradeNo string `json:"thirdTradeNo"`
PayOrderNo string `json:"payOrderNo"`
Status int `json:"status"`
Ver int `json:"ver"`
Bmid int `json:"bmid"`
}
//VipChangeHistory .
type VipChangeHistory struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
ChangeType int8 `json:"change_type"`
ChangeTime time.Time `json:"change_time"`
Month int16 `json:"month"`
Days int32 `json:"days"`
OperatorID string `json:"operator_id"`
RelationID string `json:"relation_id"`
BatchCodeID int64 `json:"batch_code_id"`
BatchID int64 `json:"batch_id"`
Remark string `json:"remark"`
}

View File

@@ -0,0 +1,13 @@
package model
import "go-common/library/time"
//QueryBcoinSalary .
type QueryBcoinSalary struct {
StartID int64 `json:"start_id"`
EndID int64 `json:"end_id"`
StartMonth time.Time `json:"start_month"`
EndMonth time.Time `json:"end_month"`
GiveNowStatus int8 `json:"give_now_status"`
Status int8 `json:"status"`
}

View File

@@ -0,0 +1,185 @@
package model
import (
"go-common/library/time"
)
//VipAppInfo app info
type VipAppInfo struct {
ID int64 `json:"id"`
Type int8 `json:"type"`
Name string `json:"name"`
PurgeURL string `json:"purgeUrl"`
AppKey string `json:"appKey"`
}
// VipPoint vip_point table
type VipPoint struct {
ID int `json:"id"`
Mid int `json:"mid"`
PointBalance int `json:"point_balance"`
Ver int `json:"ver"`
}
//VipPointChangeHistory vip_point_change_history table
type VipPointChangeHistory struct {
ID int `json:"id"`
Mid int `json:"mid"`
Point int `json:"point"`
OrderID string `json:"orderId"`
ChangeType int `json:"changeType"`
ChangeTime time.Time `json:"changeTime"`
RelationID string `json:"relationId"`
PointBalance int `json:"pointBalance"`
Remark string `json:"remark"`
Operator string `json:"operator"`
}
//VipPayOrderLog vip pay order log table
type VipPayOrderLog struct {
ID int64 `json:"id"`
OrderNo string `json:"orderNo"`
Mid int64 `json:"mid"`
Status int8 `json:"status"`
}
//VipPayOrder VipPayOrder table
type VipPayOrder 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"`
ToMid int64 `json:"toMid"`
BuyMonths int16 `json:"buyMonths"`
Money float64 `json:"money"`
RechargeBp float64 `json:"rechargeBp"`
Status int8 `json:"status"`
PayType int8 `json:"payType"`
ThirdTradeNo string `json:"thirdTradeNo"`
PaymentTime time.Time `json:"paymentTime"`
Ver int64 `json:"ver"`
AppSubID string `json:"appSubId"`
CouponMoney float64 `json:"coupon_money"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipUserInfo vip user info table
type VipUserInfo struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Type int8 `json:"vipType"`
PayType int8 `json:"payType"`
PayChannelID int64 `json:"payChannelId"`
Status int8 `json:"vipStatus"`
Ver int64 `json:"ver"`
OldVer int64 `json:"old_ver"`
StartTime time.Time `json:"vipStartTime"`
RecentTime time.Time `json:"vipRecentTime"`
OverdueTime time.Time `json:"vipOverdueTime"`
AnnualVipOverdueTime time.Time `json:"annualVipOverdueTime"`
AutoRenewed int8 `json:"auto_renewed"`
IosOverdueTime time.Time `json:"ios_overdue_time"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipPushData .
type VipPushData struct {
ID int64 `json:"id"`
DisableType int8 `json:"disable_type"`
GroupName string `json:"group_name"`
Title string `json:"title" `
Content string `json:"content"`
PushTotalCount int32 `json:"-"`
PushedCount int32 `json:"-"`
PushProgress string `json:"push_progress"`
ProgressStatus int8 `json:"progress_status"`
Status int8 `json:"status"`
Platform string `json:"platform"`
LinkType int32 `json:"link_type"`
ErrorCode int32 `json:"error_code"`
LinkURL string `json:"link_url"`
ExpiredDayStart int32 `json:"expired_day_start" `
ExpiredDayEnd int64 `json:"expired_day_end" `
EffectStartDate time.Time `json:"effect_start_date" `
EffectEndDate time.Time `json:"effect_end_date" `
PushStartTime string `json:"push_start_time" `
PushEndTime string `json:"push_end_time" `
}
//VipUserDiscountHistory vip user discount history table
type VipUserDiscountHistory struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
DiscountID int32 `json:"discountId"`
OrderNo string `json:"orderNo"`
Status int8 `json:"status"`
}
//VipBcoinSalary .
type VipBcoinSalary struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Status int8 `json:"status"`
GiveNowStatus int8 `json:"giveNowStatus"`
Payday time.Time `json:"month"`
Amount int32 `json:"amount"`
Memo string `json:"memo"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipInfoDB vip user info db
type VipInfoDB struct {
ID int64 `json:"id"`
Mid int64 `json:"mid"`
Ver int64 `json:"ver"`
Type int8 `json:"vip_type"`
PayType int8 `json:"vip_pay_type"`
PayChannelID int64 `json:"pay_channel_id"`
Status int8 `json:"vip_status"`
StartTime time.Time `json:"vip_start_time"`
RecentTime time.Time `json:"vip_recent_time"`
OverdueTime time.Time `json:"vip_overdue_time"`
AnnualVipOverdueTime time.Time `json:"annual_vip_overdue_time"`
IosOverdueTime time.Time `json:"ios_overdue_time"`
Ctime time.Time `json:"ctime"`
Mtime time.Time `json:"mtime"`
}
//VipConfig .
type VipConfig struct {
ID int64 `json:"id"`
ConfigKey string `json:"config_key"`
Content string `json:"content"`
}
//VipResourceBatchCode .
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"`
BatchName string `json:"batch_name"`
Reason string `json:"reason"`
Unit int32 `json:"unit"`
Count int64 `json:"count"`
SurplusCount int64 `json:"surplus_count"`
Price float64 `json:"price"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
//VipResourceCode vip resource code
type VipResourceCode struct {
ID int64 `json:"id"`
Bmid int64 `json:"bmid"`
RelationID string `json:"relation_id"`
Code string `json:"code"`
Status int8 `json:"status"`
BatchCodeID int64 `json:"batch_code_id"`
}

View File

@@ -0,0 +1,570 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: vip.proto
/*
Package model is a generated protocol buffer package.
It is generated from these files:
vip.proto
It has these top-level messages:
VipInfo
*/
package model
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import go_common_time "go-common/library/time"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type VipInfo struct {
Mid int64 `protobuf:"varint,1,opt,name=Mid,proto3" json:"mid"`
VipType int32 `protobuf:"varint,2,opt,name=VipType,proto3" json:"vip_type"`
VipStatus int32 `protobuf:"varint,3,opt,name=VipStatus,proto3" json:"vip_status"`
VipStartTime go_common_time.Time `protobuf:"varint,4,opt,name=VipStartTime,proto3,casttype=go-common/library/time.Time" json:"vip_start_time"`
VipOverdueTime go_common_time.Time `protobuf:"varint,5,opt,name=VipOverdueTime,proto3,casttype=go-common/library/time.Time" json:"vip_overdue_time"`
AnnualVipOverdueTime go_common_time.Time `protobuf:"varint,6,opt,name=AnnualVipOverdueTime,proto3,casttype=go-common/library/time.Time" json:"annual_vip_overdue_time"`
AccessStatus int32 `protobuf:"varint,7,opt,name=AccessStatus,proto3" json:"access_status"`
FrozenDate go_common_time.Time `protobuf:"varint,8,opt,name=FrozenDate,proto3,casttype=go-common/library/time.Time" json:"frozen_date"`
VipStatusWarn string `protobuf:"bytes,9,opt,name=VipStatusWarn,proto3" json:"vip_status_warn"`
VipRecentTime go_common_time.Time `protobuf:"varint,10,opt,name=VipRecentTime,proto3,casttype=go-common/library/time.Time" json:"vip_recent_time"`
}
func (m *VipInfo) Reset() { *m = VipInfo{} }
func (m *VipInfo) String() string { return proto.CompactTextString(m) }
func (*VipInfo) ProtoMessage() {}
func (*VipInfo) Descriptor() ([]byte, []int) { return fileDescriptorVip, []int{0} }
func init() {
proto.RegisterType((*VipInfo)(nil), "model.VipInfo")
}
func (m *VipInfo) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *VipInfo) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Mid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintVip(dAtA, i, uint64(m.Mid))
}
if m.VipType != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintVip(dAtA, i, uint64(m.VipType))
}
if m.VipStatus != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintVip(dAtA, i, uint64(m.VipStatus))
}
if m.VipStartTime != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintVip(dAtA, i, uint64(m.VipStartTime))
}
if m.VipOverdueTime != 0 {
dAtA[i] = 0x28
i++
i = encodeVarintVip(dAtA, i, uint64(m.VipOverdueTime))
}
if m.AnnualVipOverdueTime != 0 {
dAtA[i] = 0x30
i++
i = encodeVarintVip(dAtA, i, uint64(m.AnnualVipOverdueTime))
}
if m.AccessStatus != 0 {
dAtA[i] = 0x38
i++
i = encodeVarintVip(dAtA, i, uint64(m.AccessStatus))
}
if m.FrozenDate != 0 {
dAtA[i] = 0x40
i++
i = encodeVarintVip(dAtA, i, uint64(m.FrozenDate))
}
if len(m.VipStatusWarn) > 0 {
dAtA[i] = 0x4a
i++
i = encodeVarintVip(dAtA, i, uint64(len(m.VipStatusWarn)))
i += copy(dAtA[i:], m.VipStatusWarn)
}
if m.VipRecentTime != 0 {
dAtA[i] = 0x50
i++
i = encodeVarintVip(dAtA, i, uint64(m.VipRecentTime))
}
return i, nil
}
func encodeVarintVip(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *VipInfo) Size() (n int) {
var l int
_ = l
if m.Mid != 0 {
n += 1 + sovVip(uint64(m.Mid))
}
if m.VipType != 0 {
n += 1 + sovVip(uint64(m.VipType))
}
if m.VipStatus != 0 {
n += 1 + sovVip(uint64(m.VipStatus))
}
if m.VipStartTime != 0 {
n += 1 + sovVip(uint64(m.VipStartTime))
}
if m.VipOverdueTime != 0 {
n += 1 + sovVip(uint64(m.VipOverdueTime))
}
if m.AnnualVipOverdueTime != 0 {
n += 1 + sovVip(uint64(m.AnnualVipOverdueTime))
}
if m.AccessStatus != 0 {
n += 1 + sovVip(uint64(m.AccessStatus))
}
if m.FrozenDate != 0 {
n += 1 + sovVip(uint64(m.FrozenDate))
}
l = len(m.VipStatusWarn)
if l > 0 {
n += 1 + l + sovVip(uint64(l))
}
if m.VipRecentTime != 0 {
n += 1 + sovVip(uint64(m.VipRecentTime))
}
return n
}
func sovVip(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozVip(x uint64) (n int) {
return sovVip(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *VipInfo) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: VipInfo: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: VipInfo: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType)
}
m.Mid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Mid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field VipType", wireType)
}
m.VipType = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.VipType |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field VipStatus", wireType)
}
m.VipStatus = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.VipStatus |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field VipStartTime", wireType)
}
m.VipStartTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.VipStartTime |= (go_common_time.Time(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field VipOverdueTime", wireType)
}
m.VipOverdueTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.VipOverdueTime |= (go_common_time.Time(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field AnnualVipOverdueTime", wireType)
}
m.AnnualVipOverdueTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.AnnualVipOverdueTime |= (go_common_time.Time(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 7:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field AccessStatus", wireType)
}
m.AccessStatus = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.AccessStatus |= (int32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 8:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field FrozenDate", wireType)
}
m.FrozenDate = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.FrozenDate |= (go_common_time.Time(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 9:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field VipStatusWarn", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthVip
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.VipStatusWarn = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 10:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field VipRecentTime", wireType)
}
m.VipRecentTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowVip
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.VipRecentTime |= (go_common_time.Time(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipVip(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthVip
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipVip(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVip
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVip
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVip
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthVip
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowVip
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipVip(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthVip = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowVip = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("vip.proto", fileDescriptorVip) }
var fileDescriptorVip = []byte{
// 429 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xd3, 0x40,
0x10, 0xc6, 0x63, 0x42, 0x9a, 0x66, 0x49, 0x03, 0x6c, 0x91, 0x30, 0x1c, 0xbc, 0x11, 0x87, 0x2a,
0xfc, 0x69, 0x22, 0x81, 0x38, 0x70, 0xac, 0x85, 0x2a, 0x71, 0xa8, 0x40, 0x6e, 0x15, 0x8e, 0xd6,
0xc6, 0x5e, 0x9b, 0x95, 0xea, 0xdd, 0xd5, 0x7a, 0x1d, 0x54, 0x1e, 0x83, 0x13, 0x8f, 0xd4, 0x63,
0x9f, 0x60, 0x45, 0xc3, 0x6d, 0x1f, 0x81, 0x13, 0xf2, 0xb8, 0xa1, 0xb8, 0x82, 0x88, 0x9b, 0x67,
0xbe, 0xef, 0xfb, 0xed, 0x68, 0xc6, 0x68, 0xb0, 0xe4, 0x6a, 0xaa, 0xb4, 0x34, 0x12, 0xf7, 0x0a,
0x99, 0xb2, 0xd3, 0xc7, 0xfb, 0x39, 0x37, 0x9f, 0xaa, 0xc5, 0x34, 0x91, 0xc5, 0x2c, 0x97, 0xb9,
0x9c, 0x81, 0xba, 0xa8, 0x32, 0xa8, 0xa0, 0x80, 0xaf, 0x26, 0xf5, 0xe4, 0x6b, 0x0f, 0xf5, 0xe7,
0x5c, 0xbd, 0x13, 0x99, 0xc4, 0x8f, 0x50, 0xf7, 0x88, 0xa7, 0xbe, 0x37, 0xf6, 0x26, 0xdd, 0xb0,
0xef, 0x2c, 0xe9, 0x16, 0x3c, 0x8d, 0xea, 0x1e, 0xde, 0x03, 0xd7, 0xc9, 0x99, 0x62, 0xfe, 0xad,
0xb1, 0x37, 0xe9, 0x85, 0x43, 0x67, 0xc9, 0xf6, 0x92, 0xab, 0xd8, 0x9c, 0x29, 0x16, 0xad, 0x45,
0xfc, 0x02, 0x0d, 0xe6, 0x5c, 0x1d, 0x1b, 0x6a, 0xaa, 0xd2, 0xef, 0x82, 0x73, 0xe4, 0x2c, 0x41,
0xb5, 0xb3, 0x84, 0x6e, 0x74, 0x6d, 0xc0, 0x47, 0x68, 0xd8, 0x14, 0xda, 0x9c, 0xf0, 0x82, 0xf9,
0xb7, 0xe1, 0xe5, 0xa7, 0xce, 0x92, 0xd1, 0x55, 0x40, 0x9b, 0xd8, 0xf0, 0x82, 0xfd, 0xb4, 0x64,
0x37, 0x97, 0xfb, 0x89, 0x2c, 0x0a, 0x29, 0x66, 0x75, 0x67, 0x5a, 0x07, 0xa2, 0x56, 0x1c, 0x1f,
0xa3, 0xd1, 0x9c, 0xab, 0xf7, 0x4b, 0xa6, 0xd3, 0x8a, 0x01, 0xb0, 0x07, 0xc0, 0xe7, 0xce, 0x92,
0x7b, 0x35, 0x50, 0x36, 0xd2, 0x46, 0xe4, 0x0d, 0x04, 0xce, 0xd0, 0x83, 0x03, 0x21, 0x2a, 0x7a,
0x7a, 0x03, 0xbd, 0x05, 0xe8, 0x97, 0xce, 0x92, 0x87, 0x14, 0xf4, 0xf8, 0x7f, 0x5f, 0xf8, 0x2b,
0x0f, 0xbf, 0x46, 0xc3, 0x83, 0x24, 0x61, 0x65, 0x79, 0xb5, 0xbc, 0x3e, 0x2c, 0xef, 0xbe, 0xb3,
0x64, 0x87, 0x42, 0x7f, 0xbd, 0xbf, 0x96, 0x0d, 0x1f, 0x22, 0x74, 0xa8, 0xe5, 0x17, 0x26, 0xde,
0x52, 0xc3, 0xfc, 0x6d, 0x18, 0x6a, 0xcf, 0x59, 0x72, 0x27, 0x83, 0x6e, 0x9c, 0x52, 0xf3, 0xcf,
0x41, 0xfe, 0x48, 0xe2, 0x37, 0x68, 0xe7, 0xf7, 0x5d, 0x3e, 0x52, 0x2d, 0xfc, 0xc1, 0xd8, 0x9b,
0x0c, 0xc2, 0x5d, 0x67, 0xc9, 0xdd, 0xeb, 0xe3, 0xc5, 0x9f, 0xa9, 0x16, 0x51, 0xdb, 0x89, 0x3f,
0x40, 0x34, 0x62, 0x09, 0x13, 0xcd, 0x19, 0x11, 0x4c, 0xf1, 0x6c, 0x1d, 0xd5, 0xa0, 0x6c, 0x5c,
0x49, 0x1b, 0x10, 0xfa, 0xe7, 0x97, 0x41, 0xe7, 0xe2, 0x32, 0xe8, 0x9c, 0xaf, 0x02, 0xef, 0x62,
0x15, 0x78, 0xdf, 0x57, 0x81, 0xf7, 0xed, 0x47, 0xd0, 0x59, 0x6c, 0xc1, 0x5f, 0xfb, 0xea, 0x57,
0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x38, 0x57, 0xb5, 0xf8, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,23 @@
syntax = "proto3";
package model;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
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 {
int64 Mid = 1 [(gogoproto.jsontag) = "mid"];
int32 VipType = 2 [(gogoproto.jsontag) = "vip_type"];
int32 VipStatus = 3 [(gogoproto.jsontag) = "vip_status"];
int64 VipStartTime = 4 [(gogoproto.jsontag) = "vip_start_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 VipOverdueTime = 5 [(gogoproto.jsontag) = "vip_overdue_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 AnnualVipOverdueTime = 6 [(gogoproto.jsontag) = "annual_vip_overdue_time", (gogoproto.casttype) = "go-common/library/time.Time"];
int32 AccessStatus = 7 [(gogoproto.jsontag) = "access_status"];
int64 FrozenDate = 8 [(gogoproto.jsontag) = "frozen_date", (gogoproto.casttype) = "go-common/library/time.Time"];
string VipStatusWarn = 9 [(gogoproto.jsontag) = "vip_status_warn"];
int64 VipRecentTime = 10 [(gogoproto.jsontag) = "vip_recent_time", (gogoproto.casttype) = "go-common/library/time.Time"];
}