@@ -0,0 +1,282 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"91porn-server/app/service/annouser"
|
||||
"91porn-server/common/constant"
|
||||
"91porn-server/models/v/advanceordermod"
|
||||
"91porn-server/models/v/bannerjumpmod"
|
||||
"91porn-server/models/v/jingangmod"
|
||||
"91porn-server/models/v/paymentguidemod"
|
||||
"91porn-server/models/v/sourcemod"
|
||||
"91porn-server/models/v/systemmod"
|
||||
"91porn-server/models/v/versionmod"
|
||||
)
|
||||
|
||||
// AdsInfo 广告列表
|
||||
type AdsInfo struct {
|
||||
//公告id
|
||||
ID string `json:"id" bson:"_id"`
|
||||
//广告标题
|
||||
Title string `json:"title" bson:"title"`
|
||||
//广告描述
|
||||
Description string `json:"description" bson:"description"`
|
||||
//广告封面图
|
||||
Cover string `json:"cover" bson:"cover"`
|
||||
//广告跳转地址
|
||||
Href string `json:"href" bson:"href"`
|
||||
//广告位置
|
||||
Position int `json:"position" bson:"position" swaggertype:"integer"`
|
||||
PositionName string `json:"positionName" bson:"positionName"`
|
||||
//排序号
|
||||
SortCode int `json:"sortCode" bson:"sortCode"`
|
||||
//封面尺寸
|
||||
CoverImgSize string `json:"coverImgSize" bson:"coverImgSize"`
|
||||
WatchTime int `json:"watchTime"` // 视频广告时长
|
||||
|
||||
}
|
||||
|
||||
type AdsRes struct {
|
||||
AdsList []AdsInfo `json:"adsInfoList"`
|
||||
//公告列表
|
||||
AnnounList interface{} `json:"announList"`
|
||||
//系统公告(强制更新弃用)
|
||||
AnnounInfo []*annouser.Annou `json:"-"`
|
||||
}
|
||||
|
||||
// 只返回弹窗 浮标 大背景 等
|
||||
type AdvanceSource struct {
|
||||
PageBackground string `json:"pageBackground"` // 大背景
|
||||
PageVidBackground string `json:"pageVidBackground"` // 金币视频区背景
|
||||
ButtonBackground string `json:"buttonBackground"` // 支付按钮 立即预定
|
||||
ButtonWaitBackground string `json:"buttonWaitBackground"` // 支付按钮 已预定,未到支付时间
|
||||
ButtonProcBackground string `json:"buttonProcBackground"` // 支付按钮 已预定,去支付尾款
|
||||
EnterBgWait string `json:"enterBgWait"` // 入口按钮背景(未付款)
|
||||
EnterBgProc string `json:"enterBgProc"` // 入口按钮背景(付尾款)
|
||||
PopBgWait string `json:"popBgWait"` // 弹窗背景(未付款)
|
||||
PopBgProc string `json:"popBgProc"` // 弹窗背景(付尾款)
|
||||
Banner string `json:"banner"` // 立即预定
|
||||
BannerWait string `json:"bannerWait"` // 已预定,未到支付时间
|
||||
BannerProc string `json:"bannerProc"` // 已预定,去支付尾款
|
||||
}
|
||||
|
||||
type SysInfo struct {
|
||||
Ads AdsRes `json:"ads"`
|
||||
//域名信息
|
||||
SourceList []*sourcemod.SourceRes `json:"sourceList"`
|
||||
//接口域名
|
||||
Domain []string `json:"domain"`
|
||||
//系统配置
|
||||
SystemConfigList []*systemmod.Config `json:"systemConfigList"`
|
||||
//非会员每日可观看次数
|
||||
TotalWatch uint64 `json:"totalWatch"`
|
||||
//楼凤H5(金主特制)
|
||||
LouFengH5 string `json:"louFengH5"`
|
||||
//版本信息
|
||||
Ver []*versionmod.VersionBody `json:"ver"`
|
||||
JGArea []*jingangmod.JGModel `json:"jgArea"` //随机banner
|
||||
RandomBanner string `json:"randomBanner"`
|
||||
//2023新春抽奖
|
||||
//Active2023URL string `json:"active_2023_url"`
|
||||
//长视频广告时间(单位: 秒)
|
||||
AdsTimeLongVideo uint64 `json:"adsTimeLongVideo"`
|
||||
//黑料h5地址
|
||||
HlH5URL string `json:"hlH5"`
|
||||
LuckyDrawIcon string `json:"luckyDrawIcon"` // 抽奖浮动图标
|
||||
LuckyDrawH5 string `json:"luckyDrawH5"` // 抽奖H5链接
|
||||
AiUndressPrice int64 `json:"aiUndressPrice"` // AI脱衣价格
|
||||
AiImageToVideoPrice int64 `json:"aiImageToVideoPrice"` // AI图生视频金币
|
||||
AiTextToImagePrice int64 `json:"aiTextToImagePrice"` // AI绘图金币
|
||||
AiTextToNovelPrice int64 `json:"aiTextToNovelPrice"` // AI小说金币
|
||||
SendMsgPrice int64 `json:"sendMsgPrice"` // 发送私信价格
|
||||
AdvanceStatus advanceordermod.AdvanceStatus `json:"advanceStatus"` // 预售状态
|
||||
AiBubble []string `json:"aiBubble"` //AI女友气泡内容
|
||||
AiCharacterImg string `json:"aiCharacterImg"` // AI卡通人物形象
|
||||
Broadcast bool `json:"broadcast"` // 直播开关
|
||||
StoreIsOpen bool `json:"storeIsOpen"` // 是否开启店铺
|
||||
BackgroundTheme constant.UIThemeEnum `json:"backgroundTheme"` // 背景主题 0:默认主题,1:新春主题
|
||||
AdvancePage AdvanceSource `json:"advancePage"` // 预售页面资源
|
||||
HotSearchTerms []string `json:"hotSearchTerms"` // 热搜词
|
||||
SearchHintWord []string `json:"searchHintWord"` // 搜索提示词
|
||||
FestivalUi string `json:"festivalUi"` // 节日ui,如果为空值/默认 则展示默认的
|
||||
BannerJump map[int]bannerjumpmod.BannerJumpInfo `json:"bannerJump"` // 限时Banner活动
|
||||
BannerJumpList []bannerjumpmod.BannerJumpInfo `json:"bannerJumpList"` // 限时Banner活动列表
|
||||
AiGirlFriend bool `json:"aiGirlFriend"` // ai女友
|
||||
AiUndress bool `json:"aiUndress"` // ai脱衣
|
||||
AiImageChangeFace bool `json:"aiImageChangeFace"` // ai图片换脸
|
||||
AiVideoChangeFace bool `json:"aiVideoChangeFace"` // ai视频换脸
|
||||
DarkWebVipName string `json:"darkWebVipName"` // 暗网会员卡名字
|
||||
DarkWebVipId string `json:"darkWebVipId"` // 暗网会员卡id
|
||||
PrivateZoneVipName string `json:"privateZoneVipName"` // 私密圈推荐会员卡名字
|
||||
PrivateZoneVipId string `json:"privateZoneVipId"` // 私密圈跳转会员卡id
|
||||
RecommendVipIds []string `json:"recommendVipIds"` // 特邀会员卡id
|
||||
ShortDramaCardID string `json:"shortDramaCardId"` // 短剧播放页默认会员卡id
|
||||
ShortDramaEntryPopupEnabled bool `json:"shortDramaEntryPopupEnabled"` // 短剧首次进入悬浮窗总开关
|
||||
DefaultEntryPage string `json:"defaultEntryPage"` // 默认进入页面:home/drama
|
||||
DefaultEntryAudience string `json:"defaultEntryAudience"` // 默认进入页面生效人群:new_user/all_users
|
||||
NewbieSaleTime int64 `json:"newbieSaleTime"` // 新人特惠销售时间 单位 小时}
|
||||
QmdlUrl string `json:"qmdlUrl"` // 全民代理地址
|
||||
AIMateH5 string `json:"aiMateH5"` // AI伴侣链接
|
||||
PersonalCenterBackground string `json:"personalCenterBackground"` // 个人中心背景图
|
||||
Video1 string `json:"video1"` // 创作技巧视频1
|
||||
Video2 string `json:"video2"` // 创作技巧视频2
|
||||
ReturnSaleVipIds []string `json:"returnSaleVipIds"` // 返场会员卡id
|
||||
OldReturnSaleTime int64 `json:"oldReturnSaleTime"` // 返场销售时间 单位 小时
|
||||
ReportUrl string `json:"reportUrl"` // 数据上报地址
|
||||
ReportSDKConfig string `json:"reportSdkConfig"` // 数据上报SDK域名配置
|
||||
FreeMark bool `json:"freeMark"` // 免费角标是否展示
|
||||
VipMark bool `json:"vipMark"` // vip角标是否展示
|
||||
CoinMark bool `json:"coinMark"` // 金币角标是否展示
|
||||
AiSwitchConf []AISwitchConf `json:"aiSwitchConf"` // AI科技排序和开关配置
|
||||
SignIcon string `json:"signIcon"` // 签到图标
|
||||
DarkWebEnable bool `json:"darkWebEnable"` // 暗网是否开启
|
||||
DarkWebImg string `json:"darkWebImg"` // 暗网图片
|
||||
DarkWebIcon string `json:"darkWebIcon"` // 暗网图标
|
||||
DarkWebIconName string `json:"darkWebIconName"` // 暗网图标名称
|
||||
PaymentStatusPopup string `json:"paymentStatusPopup"` // 用户付费状态分层
|
||||
PaymentStatusPopupConfig PaymentStatusPopupConfig `json:"paymentStatusPopupConfig"` // 付费状态弹窗配置
|
||||
PaymentGuide PaymentGuidePing `json:"paymentGuide"` // 新版付费引导配置
|
||||
}
|
||||
|
||||
type SysInfos struct {
|
||||
//广告列表
|
||||
AdsList []AdsInfo `json:"adsInfoList"`
|
||||
//公告列表
|
||||
AnnounList interface{} `json:"announList"`
|
||||
//版本信息
|
||||
Ver []*versionmod.VersionBody `json:"ver"`
|
||||
//域名信息
|
||||
SourceList []*sourcemod.SourceRes `json:"sourceList"`
|
||||
//接口域名
|
||||
Domain []string `json:"domain"`
|
||||
//系统配置
|
||||
SystemConfigList []*systemmod.Config `json:"systemConfigList"`
|
||||
//非会员每日可观看次数
|
||||
TotalWatch uint64 `json:"totalWatch"`
|
||||
//EKey rsa公钥
|
||||
EKey []byte `json:"eKey"`
|
||||
//楼凤H5(金主特制)
|
||||
LouFengH5 string `json:"louFengH5"`
|
||||
//随机banner
|
||||
RandomBanner string `json:"randomBanner"`
|
||||
//2023新春抽奖
|
||||
//Active2023URL string `json:"active_2023_url"`
|
||||
//长视频广告时间(单位: 秒)
|
||||
AdsTimeLongVideo uint64 `json:"adsTimeLongVideo"`
|
||||
JGArea []*jingangmod.JGModel `json:"jgArea"` // 金刚区配置
|
||||
//黑料h5地址
|
||||
HlH5URL string `json:"hlH5"`
|
||||
LuckyDrawIcon string `json:"luckyDrawIcon"` // 抽奖浮动图标
|
||||
LuckyDrawH5 string `json:"luckyDrawH5"` // 抽奖H5链接
|
||||
AiUndressPrice int64 `json:"aiUndressPrice"` // AI脱衣价格
|
||||
AiImageToVideoPrice int64 `json:"aiImageToVideoPrice"` // AI图生视频金币
|
||||
AiTextToImagePrice int64 `json:"aiTextToImagePrice"` // AI绘图金币
|
||||
SendMsgPrice int64 `json:"sendMsgPrice"` // 发送私信价格
|
||||
AdvanceStatus advanceordermod.AdvanceStatus `json:"advanceStatus"` // 预售状态
|
||||
AndLink string `json:"andLink"` // ios下载链接
|
||||
IosLink string `json:"iosLink"` // 安卓下载链接
|
||||
AiBubble []string `json:"aiBubble"` // AI女友气泡内容
|
||||
AiCharacterImg string `json:"aiCharacterImg"` // AI卡通人物形象
|
||||
Broadcast bool `json:"broadcast"` // 直播开关
|
||||
StoreIsOpen bool `json:"storeIsOpen"` // 是否开启店铺
|
||||
BackgroundTheme constant.UIThemeEnum `json:"backgroundTheme"` // 背景主题 0:默认主题,1:新春主题
|
||||
AdvancePage AdvanceSource `json:"advancePage"` // 预售页面资源
|
||||
ShopIosLink string `json:"shopIosLink"` // ios商店包下载链接
|
||||
HotSearchTerms []string `json:"hotSearchTerms"` // 热搜词
|
||||
SearchHintWord []string `json:"searchHintWord"` // 搜索提示词
|
||||
FestivalUi string `json:"festivalUi"` // 节日ui,如果为空值/默认 则展示默认的
|
||||
BannerJump map[int]bannerjumpmod.BannerJumpInfo `json:"bannerJump"` // 限时Banner活动
|
||||
BannerJumpList []bannerjumpmod.BannerJumpInfo `json:"bannerJumpList"` // 限时Banner活动列表
|
||||
AiGirlFriend bool `json:"aiGirlFriend"` // ai女友
|
||||
AiUndress bool `json:"aiUndress"` // ai脱衣
|
||||
AiImageChangeFace bool `json:"aiImageChangeFace"` // ai图片换脸
|
||||
AiVideoChangeFace bool `json:"aiVideoChangeFace"` // ai视频换脸
|
||||
AiTextToNovelPrice int64 `json:"aiTextToNovelPrice"` // AI小说金币
|
||||
QmdlUrl string `json:"qmdlUrl"` // 全民代理地址
|
||||
DarkWebVipName string `json:"darkWebVipName"` // 暗网会员卡名字
|
||||
DarkWebVipId string `json:"darkWebVipId"` // 暗网会员卡id
|
||||
RecommendVipIds []string `json:"recommendVipIds"` // 特邀会员卡id
|
||||
ShortDramaCardID string `json:"shortDramaCardId"` // 短剧播放页默认会员卡id
|
||||
ShortDramaEntryPopupEnabled bool `json:"shortDramaEntryPopupEnabled"` // 短剧首次进入悬浮窗总开关
|
||||
DefaultEntryPage string `json:"defaultEntryPage"` // 默认进入页面:home/drama
|
||||
DefaultEntryAudience string `json:"defaultEntryAudience"` // 默认进入页面生效人群:new_user/all_users
|
||||
PrivateZoneVipName string `json:"privateZoneVipName"` // 私密圈推荐会员卡名字
|
||||
PrivateZoneVipId string `json:"privateZoneVipId"` // 私密圈跳转会员卡id
|
||||
NewbieSaleTime int64 `json:"newbieSaleTime"` // 新人特惠销售时间 单位 小时}
|
||||
AIMateH5 string `json:"aiMateH5"` // AI伴侣链接
|
||||
PersonalCenterBackground string `json:"personalCenterBackground"` // 个人中心背景图
|
||||
Video1 string `json:"video1"` // 创作技巧视频1
|
||||
Video2 string `json:"video2"` // 创作技巧视频2
|
||||
ReturnSaleVipIds []string `json:"returnSaleVipIds"` // 返场会员卡id
|
||||
OldReturnSaleTime int64 `json:"oldReturnSaleTime"` // 返场销售时间 单位 小时
|
||||
ReportUrl string `json:"reportUrl"` // 数据上报地址
|
||||
ReportSDKConfig string `json:"reportSdkConfig"` // 数据上报SDK域名配置
|
||||
FreeMark bool `json:"freeMark"` // 免费角标是否展示
|
||||
VipMark bool `json:"vipMark"` // vip角标是否展示
|
||||
CoinMark bool `json:"coinMark"` // 金币角标是否展示
|
||||
AiSwitchConf []AISwitchConf `json:"aiSwitchConf"` // AI科技排序和开关配置
|
||||
SignIcon string `json:"signIcon"` // 签到图标
|
||||
DarkWebEnable bool `json:"darkWebEnable"` // 暗网是否开启
|
||||
DarkWebImg string `json:"darkWebImg"` // 暗网图片
|
||||
DarkWebIcon string `json:"darkWebIcon"` // 暗网图标
|
||||
DarkWebIconName string `json:"darkWebIconName"` // 暗网图标名称
|
||||
PaymentStatusPopup string `json:"paymentStatusPopup"` // 用户付费状态分层
|
||||
PaymentStatusPopupTimeDown int64 `json:"paymentStatusPopupTimeDown"` // 用户付费状态弹窗倒计时
|
||||
PaymentStatusPopupConfig PaymentStatusPopupConfig `json:"paymentStatusPopupConfig"` // 付费状态弹窗配置
|
||||
PaymentGuide PaymentGuidePing `json:"paymentGuide"` // 新版付费引导配置
|
||||
}
|
||||
|
||||
type AISwitchConf struct {
|
||||
Type int `json:"type" bson:"type"` // AI类型 1:AI脱衣 2:AI视频换脸 3:AI图片换脸 4:图生视频 5:文生图 6:AI小说 7:ai女友
|
||||
Sort int `json:"sort" bson:"sort"` // 排序
|
||||
IsOpen bool `json:"isOpen" bson:"isOpen"` // 是否开启
|
||||
}
|
||||
|
||||
// PaymentStatusPopupConfig 用户分层弹窗配置
|
||||
type PaymentStatusPopupConfig struct {
|
||||
Homepage string `json:"homepage"` // 首页弹窗
|
||||
HomepageFlot string `json:"homepageFlot"` // 首页浮窗
|
||||
PlayPage string `json:"playPage"` // 播放页弹窗
|
||||
MeTab string `json:"meTab"` // 我的tab弹窗
|
||||
VipCard string `json:"vipCard"` // 会员卡弹窗
|
||||
LastDiscountTime time.Time `json:"lastDiscountTime"` // 最后优惠时间(零值表示无倒计时)
|
||||
}
|
||||
|
||||
// PaymentGuidePing 新版付费引导 Ping 下发配置。
|
||||
// 普通场景直接下发已解析的展示数据;会员内容上新场景只下发 enabled。
|
||||
type PaymentGuidePing struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Segment string `json:"segment"`
|
||||
Scenes map[string]PaymentGuidePingScene `json:"scenes"`
|
||||
}
|
||||
|
||||
type PaymentGuidePingScene struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Show *bool `json:"show,omitempty"`
|
||||
TotalWatchCount *uint64 `json:"totalWatchCount,omitempty"`
|
||||
ConfigID string `json:"configId,omitempty"`
|
||||
Style string `json:"style,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Cover *string `json:"cover,omitempty"`
|
||||
ProductID *string `json:"productId,omitempty"`
|
||||
DurationSeconds *int64 `json:"durationSeconds,omitempty"`
|
||||
Action *paymentguidemod.Action `json:"action,omitempty"`
|
||||
}
|
||||
|
||||
// SysInfoRefresh /ping/domain/refresh 按需刷新返回
|
||||
type SysInfoRefresh struct {
|
||||
PaymentPopup SysInfoRefreshPaymentPopup `json:"paymentPopup"` // 用户付费状态弹窗
|
||||
PaymentGuide PaymentGuidePing `json:"paymentGuide"` // 新版付费引导配置
|
||||
}
|
||||
|
||||
type SysInfoRefreshPaymentPopup struct {
|
||||
PaymentStatusPopup string `json:"paymentStatusPopup"` // 用户付费状态分层
|
||||
Homepage string `json:"homepage"` // 首页弹窗
|
||||
HomepageFlot string `json:"homepageFlot"` // 首页浮窗
|
||||
PlayPage string `json:"playPage"` // 播放页弹窗
|
||||
MeTab string `json:"meTab"` // 我的tab弹窗
|
||||
VipCard string `json:"vipCard"` // 会员卡弹窗
|
||||
LastDiscountTime time.Time `json:"lastDiscountTime"` // 最后优惠时间(零值表示无倒计时)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPingResponsesIncludeShortDramaCardID(t *testing.T) {
|
||||
const productID = "6a8f066778316ccfc08c4ce7"
|
||||
responses := []any{
|
||||
SysInfo{ShortDramaCardID: productID},
|
||||
SysInfos{ShortDramaCardID: productID},
|
||||
}
|
||||
for _, response := range responses {
|
||||
data, err := json.Marshal(response)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var decoded map[string]any
|
||||
if err = json.Unmarshal(data, &decoded); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := decoded["shortDramaCardId"]; got != productID {
|
||||
t.Fatalf("shortDramaCardId = %v, want %s", got, productID)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"91porn-server/models/v/integralconfigmod"
|
||||
"time"
|
||||
|
||||
"91porn-server/common/daichong"
|
||||
"91porn-server/models/v/productmod"
|
||||
"91porn-server/models/v/rchgamtmod"
|
||||
)
|
||||
|
||||
// ProductList 充值金额列表
|
||||
type ProductList struct {
|
||||
//展示样式 1heng 2 shu
|
||||
ShowType int64 `json:"showType"`
|
||||
//位置
|
||||
Position string `json:"position"`
|
||||
//列表
|
||||
List []VIPListRes `json:"list"`
|
||||
//楼凤位置id
|
||||
PositionID string `json:"positionID"`
|
||||
}
|
||||
|
||||
// GoldRes 充值金额列表
|
||||
type VIPListRes struct {
|
||||
productmod.Product
|
||||
RechargeType []rchgamtmod.PayChannelRes `json:"rchgType" bson:"rchgType"` //充值方式
|
||||
BadgeType string `json:"badgeType" bson:"-"` // A/B实验套餐角标类型
|
||||
BadgeText string `json:"badgeText" bson:"-"` // A/B实验套餐角标文案
|
||||
}
|
||||
|
||||
type VIPCardBadgeStyle struct {
|
||||
BadgeType string `json:"badgeType"`
|
||||
BackgroundColor string `json:"backgroundColor"`
|
||||
TextColor string `json:"textColor"`
|
||||
}
|
||||
|
||||
type VIPCardUIConfig struct {
|
||||
BackgroundImage string `json:"backgroundImage"`
|
||||
BadgeStyles []VIPCardBadgeStyle `json:"badgeStyles"`
|
||||
}
|
||||
|
||||
type ProductRes struct {
|
||||
ExperimentID string `json:"experimentId,omitempty" bson:"-"` // VIP卡片实验ID
|
||||
ExperimentStatus string `json:"experimentStatus,omitempty" bson:"-"` // 本次响应的VIP卡片实验状态
|
||||
Variant string `json:"variant,omitempty" bson:"-"` // 用户命中的实验分组 A/B
|
||||
SkinKey string `json:"skinKey,omitempty" bson:"-"` // 分组对应卡皮标识
|
||||
DefaultProductID string `json:"defaultProductId,omitempty" bson:"-"` // 默认选中套餐ID
|
||||
UIConfig *VIPCardUIConfig `json:"uiConfig,omitempty" bson:"-"` // 用户命中分组的UI配置
|
||||
List []ProductList `json:"list" bson:"list"` // 产品列表数据
|
||||
IntegralList []integralconfigmod.APPIntegralConfig `json:"integralList" bson:"integralList"` // 积分兑换列表
|
||||
Daichong daichong.Chat `json:"daichong" bson:"daichong"` // 代充商人数据
|
||||
IsNewUser bool `json:"isNewUser" bson:"isNewUser"` // 是否新手
|
||||
}
|
||||
|
||||
type TransactionResp struct {
|
||||
ProductName string `json:"productName"`
|
||||
OrderId string `json:"orderId"`
|
||||
Money int64 `json:"money"`
|
||||
PaymentAt time.Time `json:"paymentAt"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
PayType string `json:"payType"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProductResUIConfigJSONContract(t *testing.T) {
|
||||
response := ProductRes{
|
||||
UIConfig: &VIPCardUIConfig{
|
||||
BackgroundImage: "vip-card-skin-a.png",
|
||||
BadgeStyles: []VIPCardBadgeStyle{{
|
||||
BadgeType: "MOST_POPULAR",
|
||||
BackgroundColor: "#2B251A",
|
||||
TextColor: "#F7D98C",
|
||||
}},
|
||||
},
|
||||
}
|
||||
data, err := json.Marshal(response)
|
||||
if err != nil {
|
||||
t.Fatalf("json.Marshal() error = %v", err)
|
||||
}
|
||||
for _, field := range [][]byte{
|
||||
[]byte(`"uiConfig"`),
|
||||
[]byte(`"backgroundImage":"vip-card-skin-a.png"`),
|
||||
[]byte(`"badgeType":"MOST_POPULAR"`),
|
||||
[]byte(`"backgroundColor":"#2B251A"`),
|
||||
[]byte(`"textColor":"#F7D98C"`),
|
||||
} {
|
||||
if !bytes.Contains(data, field) {
|
||||
t.Fatalf("JSON response missing %s: %s", field, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestProductResOmitsEmptyUIConfig(t *testing.T) {
|
||||
data, err := json.Marshal(ProductRes{})
|
||||
if err != nil {
|
||||
t.Fatalf("json.Marshal() error = %v", err)
|
||||
}
|
||||
if bytes.Contains(data, []byte(`"uiConfig"`)) {
|
||||
t.Fatalf("legacy JSON response contains uiConfig: %s", data)
|
||||
}
|
||||
}
|
||||
|
||||
func TestProductResIncludesExperimentStatus(t *testing.T) {
|
||||
data, err := json.Marshal(ProductRes{ExperimentStatus: "DISABLED"})
|
||||
if err != nil {
|
||||
t.Fatalf("json.Marshal() error = %v", err)
|
||||
}
|
||||
if !bytes.Contains(data, []byte(`"experimentStatus":"DISABLED"`)) {
|
||||
t.Fatalf("JSON response missing experimentStatus: %s", data)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package proto
|
||||
|
||||
type GinH struct {
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"91porn-server/common/daichong"
|
||||
"91porn-server/models/v/rchgamtmod"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type CurryenyResp struct {
|
||||
//代充
|
||||
daichong.Chat `json:"daichong"`
|
||||
//
|
||||
List []*CurrencyListResponse `json:"list"`
|
||||
}
|
||||
|
||||
type CurrencyListResponse struct {
|
||||
//表id
|
||||
ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
|
||||
//货币数量
|
||||
Amount int64 `json:"amount" bson:"amount" binding:"required"`
|
||||
//货币价格
|
||||
Money int64 `json:"money" bson:"money"`
|
||||
//优惠描述
|
||||
CouponDesc string `json:"couponDesc" bson:"couponDesc"`
|
||||
//赠送vip天数
|
||||
GiveVipDays int `json:"giveVipDays" bson:"giveVipDays"`
|
||||
//赠送楼凤解锁次数
|
||||
LouFengUnlockTimes int `json:"louFengUnlockTimes" bson:"louFengUnlockTimes"`
|
||||
//类型名称
|
||||
TypeName string `json:"typeName" bson:"typeName" binding:"required"`
|
||||
//充值方式
|
||||
RechargeType []rchgamtmod.PayChannelRes `json:"rchgType" bson:"rchgType"`
|
||||
//赠送金币
|
||||
GiveGold int64 `json:"giveGold" bson:"giveGold"`
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package proto
|
||||
|
||||
import "91porn-server/models/v/vidmod"
|
||||
|
||||
type LightVideoRes struct {
|
||||
HomeVideo []*vidmod.VideoInfo `json:"homeVideo"`
|
||||
ZoneVideo []*vidmod.VideoInfo `json:"zoneVideo"`
|
||||
ADs []*AdsInfo `json:"ads"`
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"91porn-server/models/v/usermod"
|
||||
"91porn-server/models/v/vidmod"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
// Tag 标签信息
|
||||
type Tag struct {
|
||||
ID primitive.ObjectID `json:"id" bson:"_id"` // 标签id
|
||||
Name string `json:"name" bson:"tagName"` // 标签名字
|
||||
Hot int64 `json:"hot" bson:"hot"` // 热度
|
||||
}
|
||||
|
||||
// HotPublisher 标签信息
|
||||
type HotPublisher struct {
|
||||
usermod.BaseInfo `json:",inline"`
|
||||
List []*vidmod.VideoInfo `json:"list"`
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package proto
|
||||
|
||||
// 新用户注册
|
||||
type NewUserRegisterMsg struct {
|
||||
UserId uint64 `json:"user_id"` // 用户id
|
||||
DeviceId string `json:"device_id"` // 用户设备标识
|
||||
Platform string `json:"platform"` // android ios h5
|
||||
Coin int64 `json:"coin"` // 用户金币
|
||||
IsVip int `json:"is_vip"` // 是否vip 0 否 1 是
|
||||
InviteUserId uint64 `json:"invite_user_id"` // 邀请用户id
|
||||
RegistTime int64 `json:"regist_time"` // 用户注册时间
|
||||
RegisterIp string `json:"register_ip"` // 用户注册ip
|
||||
ChannelCode string `json:"channel_code"` // 用户渠道码 区分大小写
|
||||
LastOnlineTime int64 `json:"last_online_time"` // 最后在线时间 unix时间戳 秒
|
||||
}
|
||||
|
||||
// 新用户邀请
|
||||
type NewUserInviteMsg struct {
|
||||
Id string `json:"id"` // 记录id
|
||||
UserId uint64 `json:"user_id"` // 用户id
|
||||
InviteUserId uint64 `json:"invite_user_id"` // 邀请用户id
|
||||
}
|
||||
|
||||
// 新用户访问
|
||||
type NewUserAccessMsg struct {
|
||||
UserId uint64 `json:"user_id"` // 用户id
|
||||
DeviceId string `json:"device_id"` // 用户设备标识
|
||||
Platform string `json:"platform"` // android ios h5
|
||||
Coin int64 `json:"coin"` // 用户金币
|
||||
IsVip int `json:"is_vip"` // 是否vip 0 否 1 是
|
||||
InviteUserId uint64 `json:"invite_user_id"` // 邀请用户id
|
||||
RegistTime int64 `json:"regist_time"` // 用户注册时间
|
||||
RegisterIp string `json:"register_ip"` // 用户注册ip
|
||||
ChannelCode string `json:"channel_code"` // 用户渠道码 区分大小写
|
||||
LastOnlineTime int64 `json:"last_online_time"` // 最后在线时间 unix时间戳 秒
|
||||
}
|
||||
|
||||
// 新用户充值消息
|
||||
type NewUserRechargeMsg struct {
|
||||
Id string `json:"id"` // 订单id
|
||||
OID string `json:"order_no"` // 第三方支付流水id
|
||||
OrderId string `json:"app_order_no"` // 流水id
|
||||
UserId uint64 `json:"user_id"` // 用户ID
|
||||
Money int64 `json:"order_amount"` // 订单金额,分
|
||||
Channel string `json:"payment_channel"` // 支付渠道名字
|
||||
RechargeType string `json:"payment_method"` // 支付编码,如:wechat
|
||||
OrderType string `json:"order_type"` // 订单产品类型 coin/vip
|
||||
OrderTime int64 `json:"order_time"` // 下单时间
|
||||
PayTime int64 `json:"pay_time"` // 支付时间
|
||||
PayAmount int64 `json:"pay_amount"` // 支付金额,分
|
||||
IsPaid int `json:"is_paid"` // 是否支付 0 未支付 1 已支付
|
||||
Poundage int32 `json:"poundage"` // 手续费,分
|
||||
ProductType int `json:"product_type"` // 支付产品类型 0 站群 1 棋牌
|
||||
}
|
||||
Reference in New Issue
Block a user