forked from all_user/stat_center
189 lines
10 KiB
Go
189 lines
10 KiB
Go
package proto
|
|
|
|
import (
|
|
"stat/common"
|
|
"stat/models/versionMod"
|
|
)
|
|
|
|
// VersionInfo 版本信息
|
|
type VersionInfo struct {
|
|
Id int64 `from:"_id" json:"id"` // ID
|
|
AppId int32 `from:"appId" json:"appId"` //APPID
|
|
AppName string `from:"appname" json:"appname"` //APP名称
|
|
VersionNum string `from:"versionNum" json:"versionNum"` //版本号
|
|
Terminal string `from:"terminal" json:"terminal"` //终端ios android
|
|
Link []string `from:"link" json:"link"` //下载链接
|
|
Info string `from:"info" json:"info"` //版本描述
|
|
PackageType versionMod.PkgType `from:"packageType" json:"packageType"` //包类型:1-企业包、2-商店包、3-tf、4-超级签
|
|
IsForceUpdate bool `from:"isForceUpdate" json:"isForceUpdate"` //是否强更
|
|
MinVersion string `from:"minVersion" json:"minVersion"` //最小版本
|
|
Status bool `from:"status" json:"status"` //是否启用
|
|
Size string `from:"size" json:"size"` //更新版本大小M
|
|
BackLink string `from:"backLink" json:"backLink"` //企业签(备用连接)
|
|
Md5 string `from:"md5" json:"md5"` //MD5验证
|
|
}
|
|
|
|
type VersionListReq struct {
|
|
AppId *int32 `from:"appId" json:"appId"` //APPID
|
|
common.Page
|
|
}
|
|
|
|
type VersionListResp struct {
|
|
Count int64 `json:"count" ` //总条数
|
|
Data []*VersionInfo `json:"data" ` //数据
|
|
}
|
|
|
|
type VersionDelReq struct {
|
|
Id int64 `from:"id" json:"id" binding:"required"` //版本ID
|
|
}
|
|
|
|
type VersionAddReq struct {
|
|
AppId int32 `from:"appId" json:"appId" binding:"required"` //APPID
|
|
VersionNum string `from:"versionNum" json:"versionNum" binding:"required"` //版本号
|
|
Terminal string `from:"terminal" json:"terminal" binding:"required" ` //终端 ios android(安卓,苹果下拉框选择)
|
|
Link []string `from:"link" json:"link" binding:"required"` //下载链接
|
|
Info string `from:"info" json:"info" binding:"omitempty"` //版本描述
|
|
PackageType versionMod.PkgType `from:"packageType" json:"packageType" binding:"required"` //包类型:1-企业包、2-商店包、3-tf包(下拉框)
|
|
IsForceUpdate bool `from:"isForceUpdate" json:"isForceUpdate" binding:"omitempty"` //是否强更
|
|
MinVersion string `from:"minVersion" json:"minVersion" binding:"omitempty"` //最小版本
|
|
Status bool `from:"status" json:"status"` //是否启用
|
|
Size string `from:"size" json:"size" binding:"omitempty" ` //更新版本大小M
|
|
BackLink string `from:"backLink" json:"backLink" binding:"omitempty"` //企业签
|
|
Md5 string `from:"md5" json:"md5" binding:"omitempty"` //MD5验证
|
|
}
|
|
|
|
type VersionUpdateReq struct {
|
|
Id int64 `from:"_id" json:"id" binding:"required"` // ID
|
|
AppId *int32 `from:"appId" json:"appId" binding:"omitempty"` //APPID
|
|
VersionNum *string `from:"versionNum" json:"versionNum" binding:"omitempty"` //版本号
|
|
Terminal *string `from:"terminal" json:"terminal" binding:"omitempty"` //终端ios android
|
|
Link *[]string `from:"link" json:"link" binding:"omitempty"` //下载链接
|
|
Info *string `from:"info" json:"info" binding:"omitempty"` //版本描述
|
|
PackageType *versionMod.PkgType `from:"packageType" json:"packageType" binding:"omitempty"` //包类型:1-企业包、2-商店包、3-tf
|
|
IsForceUpdate *bool `from:"isForceUpdate" json:"isForceUpdate" binding:"omitempty"` //是否强更
|
|
MinVersion *string `from:"minVersion" json:"minVersion" binding:"omitempty"` //最小版本
|
|
Status *bool `from:"status" json:"status" binding:"omitempty"` //是否启用
|
|
BackLink *string `from:"backLink" json:"backLink" binding:"omitempty"` //企业签
|
|
Size *string `from:"size" json:"size" binding:"omitempty"` //更新版本大小M
|
|
Md5 *string `from:"md5" json:"md5" binding:"omitempty"` //MD5验证
|
|
}
|
|
|
|
// 点击按钮(上报客户端IP信息和渠道信息)
|
|
type PageButtonClickReq struct {
|
|
AppId int32 `json:"appId"` //AppID
|
|
Ip string `from:"ip" json:"ip"` //ip
|
|
Channel string `from:"channel" json:"channel"` //渠道(json字符串)
|
|
Domain string `from:"domain" json:"domain"` //落地页域名
|
|
PackageType versionMod.PkgType `from:"packageType" json:"packageType"` //包类型 1:企业包 2:商店包 3:TF包 4:超级签 5:轻量版
|
|
Terminal string `from:"terminal" json:"terminal" binding:"required"` //终端ios android
|
|
}
|
|
|
|
type TfInfo struct {
|
|
AppName string `bson:"appName" json:"appName"` //应用名称
|
|
AppIcon string `bson:"appIcon" json:"appIcon"` //应用图标
|
|
URL string `bson:"url" json:"url"` //URL
|
|
BackUrl string `bson:"backUrl" json:"BackUrl"` //企业签URL
|
|
}
|
|
|
|
// 返回下载链接
|
|
type PageButtonClickResp struct {
|
|
VersionNum string `from:"versionNum" json:"versionNum"` //版本号
|
|
Terminal string `from:"terminal" json:"terminal"` //终端ios android light
|
|
Link []string `from:"link" json:"link"` //下载链接
|
|
Tf []TfInfo `from:"tf" json:"tf"` //TFinfo
|
|
BackUrl string `bson:"backUrl" json:"BackUrl"` //企业签URL (不用)
|
|
PackageType versionMod.PkgType `from:"packageType" json:"packageType" binding:"required"` //包类型 1:企业包 2:商店包 3:TF包
|
|
Status bool `from:"status" json:"status"` //是否启用
|
|
LightData []byte `from:"lightData" json:"lightData"` //如果是轻量版,返回数据
|
|
}
|
|
|
|
// 落地页获取显示的按钮信息(appid标示具体应用)
|
|
type PageButtonListReq struct {
|
|
AppId int32 `from:"appId" json:"appId"` //AppID
|
|
Ip string `from:"ip" json:"ip"` //ip
|
|
Domain string `from:"domain" json:"domain"` //落地页域名
|
|
Channel string `from:"channel" json:"channel"` //渠道(json字符串)
|
|
}
|
|
|
|
// 落地页获取显示的按钮信息
|
|
type PageButtonListResp struct {
|
|
IosDown bool `json:"iosDown"` // 显示完整版,是企业包
|
|
IosStore bool `json:"iosStore"` // 显示商店包
|
|
IosTF bool `json:"iosTF"` // TF包
|
|
IosH5 bool `json:"iosH5"` // H5跳转链接
|
|
IosLink string `json:"iosLink"` // 商店包下载链接
|
|
AndroidButton int `json:"androidButton"` // android下载按钮
|
|
HasChannelApk bool `json:"hasChannelApk"` // 有安卓渠道包
|
|
PictureList []PageButtonPicture `json:"pictureList"` // 资源数据
|
|
Contact ContactInfo `json:"contact"` // 联系方式
|
|
}
|
|
|
|
type PageButtonPicture struct {
|
|
PcAvatar string `json:"pcAvatar" bson:"pcAvatar"` // PC端图片
|
|
MobileAvatar string `json:"mobileAvatar" bson:"mobileAvatar"` // 移动端图片
|
|
PcBackgroud string `json:"pcBackgroud" bson:"pcBackgroud"` // PC端背景图
|
|
MobileBackgroud string `json:"mobileBackgroud" bson:"mobileBackgroud"` // 移动端背景图
|
|
Music string `json:"music" bson:"music"` // 音频文件
|
|
PcTitle string `json:"pcTitle" bson:"pcTitle"` // PC端标语
|
|
MobileTiltle string `json:"mobileTiltle" bson:"mobileTiltle"` // 移动端标语
|
|
}
|
|
type ContactInfo struct {
|
|
Telegram string `json:"telegram" bson:"telegram"` // PC端图片
|
|
Paoto string `json:"paoto" bson:"paoto"` // 土豆
|
|
Madou string `json:"madou" bson:"madou"` // 官网
|
|
}
|
|
|
|
type PacketType int32
|
|
|
|
const (
|
|
PacketTypeEnterprise PacketType = 1 // 企业签
|
|
PacketTypeShop PacketType = 2 // 商店包
|
|
PacketTypeTestFlight PacketType = 3 // TF包
|
|
)
|
|
|
|
type AppVersionReq struct {
|
|
AppId int32 `json:"appId" binding:"required"` // AppID
|
|
SysType string `json:"sysType,omitempty"` // 终端类型
|
|
PktType PacketType `json:"pktType,omitempty"` // 包类型
|
|
CurVersion string `json:"curVersion,omitempty"` // 当前版本
|
|
CurPackageName string `json:"curPackageName,omitempty"` // 包名
|
|
}
|
|
|
|
type AppVersionResp struct {
|
|
HasNewVersion bool `json:"hasNewVersion,omitempty"` // 是否存在新版本
|
|
ServerVersion string `json:"serverVersion,omitempty"` // 服务器新版本
|
|
DownloadLink []string `json:"downloadLink,omitempty"` // 下载地址
|
|
Description string `json:"description,omitempty"` // 描述
|
|
IsForceUpdate bool `json:"isForceUpdate,omitempty"` // 是否强制升级
|
|
}
|
|
|
|
type ShareUrlReq struct {
|
|
AppId int32 `from:"appid" json:"appid"` // AppID
|
|
}
|
|
|
|
// 落地页获取显示的按钮信息
|
|
type ShareUrlResp struct {
|
|
Url []string `form:"url" json:"url"` // 分享地址
|
|
}
|
|
|
|
type ChannelDownLoadLinkReq struct {
|
|
AppId int32 `form:"appId" json:"appId"` // AppID
|
|
Channel string `form:"channel" json:"channel"` // 商区渠道号
|
|
}
|
|
|
|
type ChannelDownLoadLinkResp struct {
|
|
DownLoadLink string `json:"downLoadLink"` // 下载链接
|
|
CmdInfo string `json:"cmdInfo"` // 下载链接
|
|
}
|
|
|
|
type H5ConfigReq struct {
|
|
AppId int32 `form:"appId" json:"appId"` // AppID
|
|
DC string `form:"dc" json:"dc"` // 商区渠道号
|
|
PC string `form:"pc" json:"pc"` // 用户渠道号,即用户邀请码
|
|
Domain string `from:"domain" json:"domain"` // 落地页域名
|
|
}
|
|
|
|
type H5ConfigV2Resp struct {
|
|
URL string `form:"url" json:"url"` // 描述文件链接
|
|
}
|