291 lines
10 KiB
Go
291 lines
10 KiB
Go
package proto
|
|
|
|
import "intent-system/pkg/dal/models"
|
|
|
|
type NewsListReq struct {
|
|
Id int64 `json:"id"` //按ID过滤
|
|
Tag string `json:"tag"` //按标签过滤
|
|
All bool `json:"all"` //查询管理后台所有可见数据
|
|
IsDeleted bool `json:"is_deleted"` //是否查询已删除数据
|
|
OrderAsc bool `json:"order_asc"` //排序
|
|
Search string `json:"search"` //搜索条件
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //分页页码(从0开始)
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"` //单页数据条数
|
|
Language string `json:"language"` //语言类型
|
|
}
|
|
|
|
type NewsListResp struct {
|
|
List []*models.NewsDO `json:"list"`
|
|
}
|
|
|
|
type NewsAddReq struct {
|
|
Category string `json:"category" db:"category" bson:"category"` //分类
|
|
MainTitle string `json:"main_title" db:"main_title" bson:"main_title"` //主标题
|
|
SubTitle string `json:"sub_title" db:"sub_title" bson:"sub_title"` //副标题
|
|
Summary string `json:"summary" db:"summary" sqlca:"isnull" bson:"summary"` //摘要
|
|
Keywords []string `json:"keywords" db:"keywords" sqlca:"isnull" bson:"keywords"` //文章关键词
|
|
SeoKeywords []string `json:"seo_keywords" db:"seo_keywords" sqlca:"isnull" bson:"seo_keywords"` //SEO关键词
|
|
Tags []string `json:"tags" db:"tags" sqlca:"isnull" bson:"tags"` //人工打标签(多选)
|
|
ImageUrl string `json:"image_url" db:"image_url" sqlca:"isnull" bson:"image_url"` //图片URL
|
|
Content string `json:"content" db:"content" bson:"content" binding:"required"` //新闻内容
|
|
Language string `json:"language" binding:"required"` //语言类型
|
|
}
|
|
|
|
type NewsAddResp struct {
|
|
DraftId int64 `json:"draft_id"`
|
|
}
|
|
|
|
type NewsEditReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
}
|
|
|
|
type NewsEditResp struct {
|
|
DraftId int64 `json:"draft_id"`
|
|
}
|
|
|
|
type NewsDeleteReq struct {
|
|
Ids []int64 `json:"ids" binding:"required"`
|
|
}
|
|
|
|
type NewsDeleteResp struct {
|
|
}
|
|
|
|
type NewsCompareReq struct {
|
|
Id int64 `json:"id" binding:"required"`
|
|
}
|
|
|
|
type NewsCompareResp struct {
|
|
CurNews *models.NewsDO `json:"cur_news"`
|
|
OrgNews *models.NewsDO `json:"org_news"`
|
|
}
|
|
|
|
type NewsDraftListReq struct {
|
|
Id int64 `json:"id"` //数据ID
|
|
OrderAsc bool `json:"order_asc"` //排序
|
|
Search string `json:"search"` //搜索条件
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //分页页码(从0开始)
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"` //单页记录条数
|
|
}
|
|
|
|
type NewsDraftListResp struct {
|
|
List []*models.NewsDraftDO `json:"list"`
|
|
}
|
|
|
|
type NewsDraftEditReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
Category string `json:"category" db:"category" bson:"category"` //分类
|
|
MainTitle string `json:"main_title" db:"main_title" bson:"main_title"` //主标题
|
|
SubTitle string `json:"sub_title" db:"sub_title" bson:"sub_title"` //副标题
|
|
Summary string `json:"summary" db:"summary" sqlca:"isnull" bson:"summary"` //摘要
|
|
Keywords []string `json:"keywords" db:"keywords" sqlca:"isnull" bson:"keywords"` //文章关键词
|
|
SeoKeywords []string `json:"seo_keywords" db:"seo_keywords" sqlca:"isnull" bson:"seo_keywords"` //SEO关键词
|
|
Tags []string `json:"tags" db:"tags" sqlca:"isnull" bson:"tags"` //人工打标签(多选)
|
|
ImageUrl string `json:"image_url" db:"image_url" sqlca:"isnull" bson:"image_url"` //图片URL
|
|
Content string `json:"content" binding:"required"` //内容
|
|
Language string `json:"language"` //语言类型
|
|
}
|
|
|
|
type NewsDraftEditResp struct {
|
|
}
|
|
|
|
type NewsDraftPublishReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
}
|
|
|
|
type NewsDraftPublishResp struct {
|
|
}
|
|
|
|
type NewsDraftDeleteReq struct {
|
|
Ids []int64 `json:"ids" binding:"required"` //数据ID列表
|
|
}
|
|
|
|
type NewsDraftDeleteResp struct {
|
|
}
|
|
|
|
type NewsTagReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
Tags []string `json:"tags" binding:"required"` //标签数组
|
|
}
|
|
|
|
type NewsTagResp struct {
|
|
}
|
|
|
|
type NewsPublishReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
}
|
|
|
|
type NewsPublishResp struct {
|
|
}
|
|
|
|
type QaListReq struct {
|
|
Id int64 `json:"id"`
|
|
IsDeleted bool `json:"is_deleted"` //Q&A列表
|
|
OrderAsc bool `json:"order_asc"` //排序
|
|
Search string `json:"search"` //搜索条件
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //分页页码(从0开始)
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"` //单页记录条数
|
|
Language string `json:"language"` //语言类型
|
|
}
|
|
|
|
type QaListResp struct {
|
|
List []*models.QuestionAnswerDO `json:"list"`
|
|
}
|
|
|
|
type QaAddReq struct {
|
|
Question string `json:"question" binding:"required"` //问题
|
|
Answer string `json:"answer" binding:"required"` //答案
|
|
Language string `json:"language" binding:"required"` //语言类型
|
|
}
|
|
|
|
type QaAddResp struct {
|
|
DraftId int64 `json:"draft_id"`
|
|
}
|
|
|
|
type QaEditReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
}
|
|
|
|
type QaEditResp struct {
|
|
DraftId int64 `json:"draft_id"`
|
|
}
|
|
|
|
type QaDeleteReq struct {
|
|
Ids []int64 `json:"ids" binding:"required"` //ID列表
|
|
}
|
|
|
|
type QaDeleteResp struct {
|
|
}
|
|
|
|
type QaDraftListReq struct {
|
|
Id int64 `json:"id"` //数据ID
|
|
OrderAsc bool `json:"order_asc"` //排序
|
|
Search string `json:"search"` //搜索条件
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //分页页码(从0开始)
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"` //单页记录条数
|
|
}
|
|
|
|
type QaDraftListResp struct {
|
|
List []*models.QuestionDraftDO `json:"list"`
|
|
}
|
|
|
|
type QaDraftEditReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
Question string `json:"question" binding:"required"` //问题
|
|
Answer string `json:"answer" binding:"required"` //答案
|
|
Language string `json:"language"` //语言类型
|
|
}
|
|
|
|
type QaDraftEditResp struct {
|
|
}
|
|
|
|
type QaDraftPublishReq struct {
|
|
Id int64 `json:"id" binding:"required"` //数据ID
|
|
}
|
|
|
|
type QaDraftPublishResp struct {
|
|
}
|
|
|
|
type QaDraftDeleteReq struct {
|
|
Ids []int64 `json:"ids" binding:"required"` //数据ID
|
|
}
|
|
|
|
type QaDraftDeleteResp struct {
|
|
}
|
|
|
|
type SubListAllReq struct {
|
|
Id int64 `json:"id"` //数据ID
|
|
OrderAsc bool `json:"order_asc"` //排序
|
|
Search string `json:"search"` //搜索条件
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //分页页码(从0开始)
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"` //单页条数
|
|
}
|
|
|
|
type SubListAllResp struct {
|
|
List []*models.NewsDO `json:"list"`
|
|
}
|
|
|
|
type SubListPushedReq struct {
|
|
Id int64 `json:"id"` //数据ID
|
|
OrderAsc bool `json:"order_asc"` //排序
|
|
Search string `json:"search"` //搜索条件
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //分页页码(从0开始)
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"` //单页条数
|
|
}
|
|
|
|
type SubListPushedResp struct {
|
|
List []*models.NewsDO `json:"list"`
|
|
}
|
|
|
|
type SubListTodayReq struct {
|
|
}
|
|
|
|
type SubListTodayResp struct {
|
|
List []*models.NewsDO `json:"list"`
|
|
}
|
|
|
|
type SubAddNewsReq struct {
|
|
}
|
|
|
|
type SubAddNewsResp struct {
|
|
}
|
|
|
|
type SubEditNewsReq struct {
|
|
Id int64 `json:"id" binding:"required"`
|
|
Category string `json:"category" db:"category" bson:"category"` //分类
|
|
MainTitle string `json:"main_title" db:"main_title" bson:"main_title"` //主标题
|
|
SubTitle string `json:"sub_title" db:"sub_title" bson:"sub_title"` //副标题
|
|
Summary string `json:"summary" db:"summary" sqlca:"isnull" bson:"summary"` //摘要
|
|
Keywords []string `json:"keywords" db:"keywords" sqlca:"isnull" bson:"keywords"` //文章关键词
|
|
SeoKeywords []string `json:"seo_keywords" db:"seo_keywords" sqlca:"isnull" bson:"seo_keywords"` //SEO关键词
|
|
Tags []string `json:"tags" db:"tags" sqlca:"isnull" bson:"tags"` //人工打标签(多选)
|
|
ImageUrl string `json:"image_url" db:"image_url" sqlca:"isnull" bson:"image_url"` //图片URL
|
|
Content string `json:"content" binding:"required"`
|
|
}
|
|
|
|
type SubEditNewsResp struct {
|
|
}
|
|
|
|
type TagListReq struct {
|
|
OrderAsc bool `json:"order_asc"`
|
|
PageNo int `json:"page_no" db:"page_no" bson:"page_no"` //page_no must >= 0
|
|
PageSize int `json:"page_size" db:"page_size" bson:"page_size"`
|
|
}
|
|
|
|
type TagListResp struct {
|
|
List []*models.TagDO `json:"list"`
|
|
}
|
|
|
|
type TagAddReq struct {
|
|
Name string `json:"name" binding:"required"`
|
|
NameCN string `json:"name_cn" binding:"required"`
|
|
}
|
|
|
|
type TagAddResp struct {
|
|
Id int64 `json:"id"`
|
|
}
|
|
|
|
type TagEditReq struct {
|
|
Id int64 `json:"id" binding:"required"` //标签ID
|
|
Name string `json:"name" binding:"required"`
|
|
NameCN string `json:"name_cn" binding:"required"`
|
|
}
|
|
|
|
type TagEditResp struct {
|
|
}
|
|
|
|
type TagDeleteReq struct {
|
|
Ids []int64 `json:"ids" binding:"required"`
|
|
}
|
|
|
|
type TagDeleteResp struct {
|
|
}
|
|
|
|
type NewsAsync struct {
|
|
Org_Id int64 `json:"org_id"`
|
|
Digest string `json:"digest"`
|
|
}
|
|
|
|
type NewsAsyncResp struct {
|
|
List []*models.NewsDO `json:"list"`
|
|
}
|