forked from all_user/stat_center
86 lines
3.6 KiB
Go
86 lines
3.6 KiB
Go
package proto
|
|
|
|
import (
|
|
"stat/common"
|
|
"time"
|
|
)
|
|
|
|
// 公告列表请求
|
|
type ListAnnounReq struct {
|
|
AppId *int32 `json:"appId"` // 应用id 筛选条件
|
|
common.Page
|
|
}
|
|
|
|
// 公告列表响应
|
|
type ListAnnounRes struct {
|
|
Total int64 `json:"total"`
|
|
List []AnnounInfo `json:"list"`
|
|
}
|
|
|
|
// 公告信息
|
|
type AnnounInfo struct {
|
|
ID string `json:"id"` // 公告id
|
|
AppId int32 `json:"appId"` // 应用id
|
|
AppName string `json:"appName"` // 应用名称
|
|
Title string `json:"title"` // 公告标题
|
|
Content string `json:"content"` // 公告内容
|
|
Cover string `json:"cover"` // 公告封面图
|
|
Href string `json:"href"` // 公告跳转地址
|
|
Type int `json:"type"` // 公告类型 0,外部连接;1,直接安装app
|
|
Active bool `json:"active"` // 是否激活
|
|
StartTime time.Time `json:"startTime"` // 开始时间
|
|
EndTime time.Time `json:"endTime"` // 结束时间
|
|
}
|
|
|
|
// 添加公告
|
|
type AddAnnounReq struct {
|
|
AppId *int32 `from:"appId" json:"appId" binding:"required"` // 应用id
|
|
Title *string `from:"title" json:"title" binding:"required"` // 公告标题
|
|
Content *string `from:"content" json:"content" binding:"required"` // 公告内容
|
|
Cover *string `from:"cover" json:"cover" binding:"omitempty"` // 公告封面图
|
|
Href *string `from:"href" json:"href" binding:"omitempty"` // 公告跳转地址
|
|
Type *int `from:"type" json:"type" binding:"required"` // 公告类型 0,外部连接;1,直接安装app
|
|
Active *bool `from:"active" json:"active" binding:"required"` // 是否激活
|
|
StartTime *time.Time `from:"startTime" json:"startTime" binding:"required"` // 公告开始时间
|
|
EndTime *time.Time `from:"endTime" json:"endTime" binding:"required"` // 公告结束时间
|
|
}
|
|
|
|
// 修改公告
|
|
type UpdateAnnounReq struct {
|
|
Id *string `form:"id" json:"id" binding:"required"` // 公告id
|
|
AppId *int32 `form:"appId" json:"appId" binding:"omitempty"` // 应用id
|
|
Title *string `form:"title" json:"title" binding:"omitempty"` // 公告标题
|
|
Content *string `form:"content" json:"content" binding:"omitempty"` // 公告内容
|
|
Cover *string `form:"cover" json:"cover" binding:"omitempty"` // 公告封面图
|
|
Href *string `form:"href" json:"href" binding:"omitempty"` // 公告跳转地址
|
|
Type *int `form:"type" json:"type" binding:"omitempty"` // 公告类型 0,外部连接;1,直接安装app
|
|
Active *bool `from:"active" json:"active" binding:"omitempty"` // 是否激活
|
|
StartTime *time.Time `from:"startTime" json:"startTime" binding:"omitempty"` // 公告开始时间
|
|
EndTime *time.Time `from:"endTime" json:"endTime" binding:"omitempty"` // 公告结束时间
|
|
}
|
|
|
|
// 删除公告
|
|
type DelAnnounReq struct {
|
|
Id *string `json:"id" binding:"required"` // 公告id
|
|
}
|
|
|
|
// 外部获取公告请求
|
|
type AnnouncementReq struct {
|
|
AppId *int32 `form:"appId" json:"appId" binding:"required"` // 应用id
|
|
}
|
|
|
|
// 外部获取公告响应
|
|
type AnnouncementRes struct {
|
|
AnnounceList []AnnouncementInfo `json:"announceList"` // 公告列表
|
|
}
|
|
|
|
// 外部获取公告
|
|
type AnnouncementInfo struct {
|
|
ID string `json:"id"` // 公告id
|
|
Title string `json:"title"` // 公告标题
|
|
Content string `json:"content"` // 公告内容
|
|
Cover string `json:"cover"` // 公告封面图
|
|
Href string `json:"href"` // 公告跳转地址
|
|
Type int `json:"type"` // 公告类型 0,外部连接;1,直接安装app
|
|
}
|