refactor: localize protobuf definitions
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -122,42 +121,42 @@ func (x *GetPostByKeyRequest) GetKey() string {
|
||||
|
||||
// 文章
|
||||
type PostItem struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SiteIdentity string `protobuf:"bytes,1,opt,name=site_identity,proto3" json:"site_identity,omitempty"`
|
||||
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 文章唯一标识
|
||||
OwnerId int64 `protobuf:"varint,3,opt,name=owner_id,proto3" json:"owner_id,omitempty"` // 作者ID
|
||||
OwnerIdentity string `protobuf:"bytes,4,opt,name=owner_identity,proto3" json:"owner_identity,omitempty"` // 作者唯一标识
|
||||
CategoryIdentityArray []string `protobuf:"bytes,5,rep,name=category_identity_array,proto3" json:"category_identity_array,omitempty"` // <必传>,所属分类Identity 列表
|
||||
TagsIdentityArray []string `protobuf:"bytes,6,rep,name=tags_identity_array,proto3" json:"tags_identity_array,omitempty"` // 标签集Identity 列表
|
||||
Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` // <必传>,标题
|
||||
CoverPath string `protobuf:"bytes,8,opt,name=cover_path,proto3" json:"cover_path,omitempty"` //封面
|
||||
Author string `protobuf:"bytes,9,opt,name=author,proto3" json:"author,omitempty"` // 作者
|
||||
AuthorIdentity string `protobuf:"bytes,10,opt,name=author_identity,proto3" json:"author_identity,omitempty"`
|
||||
Content string `protobuf:"bytes,11,opt,name=content,proto3" json:"content,omitempty"` // <必传>,内容
|
||||
TargetUrl string `protobuf:"bytes,12,opt,name=target_url,proto3" json:"target_url,omitempty"` // 跳转目标地址
|
||||
SourceUrl string `protobuf:"bytes,13,opt,name=source_url,proto3" json:"source_url,omitempty"` // 文章来源地址
|
||||
Hits int64 `protobuf:"varint,14,opt,name=hits,proto3" json:"hits,omitempty"` //点击量
|
||||
AccessoryIdentityArray []string `protobuf:"bytes,15,rep,name=accessory_identity_array,proto3" json:"accessory_identity_array,omitempty"` //附件Identity 列表
|
||||
HasAccessory bool `protobuf:"varint,16,opt,name=has_accessory,proto3" json:"has_accessory,omitempty"` //是否有附件,默认没有
|
||||
CreatedAt string `protobuf:"bytes,17,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,18,opt,name=updated_at,proto3" json:"updated_at,omitempty"` //更新时间
|
||||
Description string `protobuf:"bytes,19,opt,name=description,proto3" json:"description,omitempty"` //简介
|
||||
LikeHits int64 `protobuf:"varint,20,opt,name=like_hits,proto3" json:"like_hits,omitempty"` //点赞量
|
||||
UnlikeHits int64 `protobuf:"varint,21,opt,name=unlike_hits,proto3" json:"unlike_hits,omitempty"` //点踩量
|
||||
CommentHits int64 `protobuf:"varint,22,opt,name=comment_hits,proto3" json:"comment_hits,omitempty"` //评论量
|
||||
PostType int32 `protobuf:"varint,23,opt,name=post_type,proto3" json:"post_type,omitempty"` // 用户自定义文章类型
|
||||
Rights string `protobuf:"bytes,24,opt,name=rights,proto3" json:"rights,omitempty"` //权限
|
||||
Key string `protobuf:"bytes,25,opt,name=key,proto3" json:"key,omitempty"` // content key
|
||||
CategoryData []*protobuf.CmsCategoryItem `protobuf:"bytes,26,rep,name=category_data,proto3" json:"category_data,omitempty"` // 分类数据
|
||||
TagsData []*protobuf.CmsTagsItem `protobuf:"bytes,27,rep,name=tags_data,proto3" json:"tags_data,omitempty"` // 标签数据
|
||||
AccessoryData []*protobuf.CmsAccessoryItem `protobuf:"bytes,28,rep,name=accessory_data,proto3" json:"accessory_data,omitempty"` //附件数据
|
||||
Lang string `protobuf:"bytes,29,opt,name=lang,proto3" json:"lang,omitempty"` // 语言
|
||||
SourceOrigin string `protobuf:"bytes,30,opt,name=source_origin,proto3" json:"source_origin,omitempty"` // 来源方简称
|
||||
ExtendUrl string `protobuf:"bytes,31,opt,name=extend_url,proto3" json:"extend_url,omitempty"` // 扩展:URL
|
||||
ExtendData string `protobuf:"bytes,32,opt,name=extend_data,proto3" json:"extend_data,omitempty"` // 扩展:数据
|
||||
ExtendImg string `protobuf:"bytes,33,opt,name=extend_img,proto3" json:"extend_img,omitempty"` // 扩展:图片
|
||||
ExtendDesc string `protobuf:"bytes,34,opt,name=extend_desc,proto3" json:"extend_desc,omitempty"` // 扩展:描述
|
||||
Published string `protobuf:"bytes,35,opt,name=published,proto3" json:"published,omitempty"` // 事件发生时间
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SiteIdentity string `protobuf:"bytes,1,opt,name=site_identity,proto3" json:"site_identity,omitempty"`
|
||||
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 文章唯一标识
|
||||
OwnerId int64 `protobuf:"varint,3,opt,name=owner_id,proto3" json:"owner_id,omitempty"` // 作者ID
|
||||
OwnerIdentity string `protobuf:"bytes,4,opt,name=owner_identity,proto3" json:"owner_identity,omitempty"` // 作者唯一标识
|
||||
CategoryIdentityArray []string `protobuf:"bytes,5,rep,name=category_identity_array,proto3" json:"category_identity_array,omitempty"` // <必传>,所属分类Identity 列表
|
||||
TagsIdentityArray []string `protobuf:"bytes,6,rep,name=tags_identity_array,proto3" json:"tags_identity_array,omitempty"` // 标签集Identity 列表
|
||||
Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` // <必传>,标题
|
||||
CoverPath string `protobuf:"bytes,8,opt,name=cover_path,proto3" json:"cover_path,omitempty"` //封面
|
||||
Author string `protobuf:"bytes,9,opt,name=author,proto3" json:"author,omitempty"` // 作者
|
||||
AuthorIdentity string `protobuf:"bytes,10,opt,name=author_identity,proto3" json:"author_identity,omitempty"`
|
||||
Content string `protobuf:"bytes,11,opt,name=content,proto3" json:"content,omitempty"` // <必传>,内容
|
||||
TargetUrl string `protobuf:"bytes,12,opt,name=target_url,proto3" json:"target_url,omitempty"` // 跳转目标地址
|
||||
SourceUrl string `protobuf:"bytes,13,opt,name=source_url,proto3" json:"source_url,omitempty"` // 文章来源地址
|
||||
Hits int64 `protobuf:"varint,14,opt,name=hits,proto3" json:"hits,omitempty"` //点击量
|
||||
AccessoryIdentityArray []string `protobuf:"bytes,15,rep,name=accessory_identity_array,proto3" json:"accessory_identity_array,omitempty"` //附件Identity 列表
|
||||
HasAccessory bool `protobuf:"varint,16,opt,name=has_accessory,proto3" json:"has_accessory,omitempty"` //是否有附件,默认没有
|
||||
CreatedAt string `protobuf:"bytes,17,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,18,opt,name=updated_at,proto3" json:"updated_at,omitempty"` //更新时间
|
||||
Description string `protobuf:"bytes,19,opt,name=description,proto3" json:"description,omitempty"` //简介
|
||||
LikeHits int64 `protobuf:"varint,20,opt,name=like_hits,proto3" json:"like_hits,omitempty"` //点赞量
|
||||
UnlikeHits int64 `protobuf:"varint,21,opt,name=unlike_hits,proto3" json:"unlike_hits,omitempty"` //点踩量
|
||||
CommentHits int64 `protobuf:"varint,22,opt,name=comment_hits,proto3" json:"comment_hits,omitempty"` //评论量
|
||||
PostType int32 `protobuf:"varint,23,opt,name=post_type,proto3" json:"post_type,omitempty"` // 用户自定义文章类型
|
||||
Rights string `protobuf:"bytes,24,opt,name=rights,proto3" json:"rights,omitempty"` //权限
|
||||
Key string `protobuf:"bytes,25,opt,name=key,proto3" json:"key,omitempty"` // content key
|
||||
CategoryData []*CmsCategoryItem `protobuf:"bytes,26,rep,name=category_data,proto3" json:"category_data,omitempty"` // 分类数据
|
||||
TagsData []*CmsTagsItem `protobuf:"bytes,27,rep,name=tags_data,proto3" json:"tags_data,omitempty"` // 标签数据
|
||||
AccessoryData []*CmsAccessoryItem `protobuf:"bytes,28,rep,name=accessory_data,proto3" json:"accessory_data,omitempty"` //附件数据
|
||||
Lang string `protobuf:"bytes,29,opt,name=lang,proto3" json:"lang,omitempty"` // 语言
|
||||
SourceOrigin string `protobuf:"bytes,30,opt,name=source_origin,proto3" json:"source_origin,omitempty"` // 来源方简称
|
||||
ExtendUrl string `protobuf:"bytes,31,opt,name=extend_url,proto3" json:"extend_url,omitempty"` // 扩展:URL
|
||||
ExtendData string `protobuf:"bytes,32,opt,name=extend_data,proto3" json:"extend_data,omitempty"` // 扩展:数据
|
||||
ExtendImg string `protobuf:"bytes,33,opt,name=extend_img,proto3" json:"extend_img,omitempty"` // 扩展:图片
|
||||
ExtendDesc string `protobuf:"bytes,34,opt,name=extend_desc,proto3" json:"extend_desc,omitempty"` // 扩展:描述
|
||||
Published string `protobuf:"bytes,35,opt,name=published,proto3" json:"published,omitempty"` // 事件发生时间
|
||||
// 扩展:文章唯一键值(用于URL等)
|
||||
Hash string `protobuf:"bytes,36,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -369,21 +368,21 @@ func (x *PostItem) GetKey() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PostItem) GetCategoryData() []*protobuf.CmsCategoryItem {
|
||||
func (x *PostItem) GetCategoryData() []*CmsCategoryItem {
|
||||
if x != nil {
|
||||
return x.CategoryData
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PostItem) GetTagsData() []*protobuf.CmsTagsItem {
|
||||
func (x *PostItem) GetTagsData() []*CmsTagsItem {
|
||||
if x != nil {
|
||||
return x.TagsData
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PostItem) GetAccessoryData() []*protobuf.CmsAccessoryItem {
|
||||
func (x *PostItem) GetAccessoryData() []*CmsAccessoryItem {
|
||||
if x != nil {
|
||||
return x.AccessoryData
|
||||
}
|
||||
@@ -1010,7 +1009,7 @@ var File_module_base_cms_proto_post_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cms_proto_post_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
" module/base/cms/proto/post.proto\x12\x03cms\x1a\x15protobuf/blocks.proto\"X\n" +
|
||||
" module/base/cms/proto/post.proto\x12\x03cms\x1a!module/base/cms/proto/const.proto\"X\n" +
|
||||
"\x14DeleteCommentRequest\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12$\n" +
|
||||
"\rpost_identity\x18\x02 \x01(\tR\rpost_identity\"'\n" +
|
||||
@@ -1152,23 +1151,23 @@ func file_module_base_cms_proto_post_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cms_proto_post_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_module_base_cms_proto_post_proto_goTypes = []any{
|
||||
(*DeleteCommentRequest)(nil), // 0: cms.DeleteCommentRequest
|
||||
(*GetPostByKeyRequest)(nil), // 1: cms.GetPostByKeyRequest
|
||||
(*PostItem)(nil), // 2: cms.PostItem
|
||||
(*PostListRequest)(nil), // 3: cms.PostListRequest
|
||||
(*PostListReply)(nil), // 4: cms.PostListReply
|
||||
(*GetPostRequest)(nil), // 5: cms.GetPostRequest
|
||||
(*CommentItem)(nil), // 6: cms.CommentItem
|
||||
(*CommentListRequest)(nil), // 7: cms.CommentListRequest
|
||||
(*CommentListResponse)(nil), // 8: cms.CommentListResponse
|
||||
(*PostOpIdentityRequest)(nil), // 9: cms.PostOpIdentityRequest
|
||||
(*CommentOpIdentityRequest)(nil), // 10: cms.CommentOpIdentityRequest
|
||||
(*protobuf.CmsCategoryItem)(nil), // 11: blocks.CmsCategoryItem
|
||||
(*protobuf.CmsTagsItem)(nil), // 12: blocks.CmsTagsItem
|
||||
(*protobuf.CmsAccessoryItem)(nil), // 13: blocks.CmsAccessoryItem
|
||||
(*protobuf.CmsSearchRequest)(nil), // 14: blocks.CmsSearchRequest
|
||||
(*protobuf.IdentRequest)(nil), // 15: blocks.IdentRequest
|
||||
(*protobuf.StatusReply)(nil), // 16: blocks.StatusReply
|
||||
(*DeleteCommentRequest)(nil), // 0: cms.DeleteCommentRequest
|
||||
(*GetPostByKeyRequest)(nil), // 1: cms.GetPostByKeyRequest
|
||||
(*PostItem)(nil), // 2: cms.PostItem
|
||||
(*PostListRequest)(nil), // 3: cms.PostListRequest
|
||||
(*PostListReply)(nil), // 4: cms.PostListReply
|
||||
(*GetPostRequest)(nil), // 5: cms.GetPostRequest
|
||||
(*CommentItem)(nil), // 6: cms.CommentItem
|
||||
(*CommentListRequest)(nil), // 7: cms.CommentListRequest
|
||||
(*CommentListResponse)(nil), // 8: cms.CommentListResponse
|
||||
(*PostOpIdentityRequest)(nil), // 9: cms.PostOpIdentityRequest
|
||||
(*CommentOpIdentityRequest)(nil), // 10: cms.CommentOpIdentityRequest
|
||||
(*CmsCategoryItem)(nil), // 11: blocks.CmsCategoryItem
|
||||
(*CmsTagsItem)(nil), // 12: blocks.CmsTagsItem
|
||||
(*CmsAccessoryItem)(nil), // 13: blocks.CmsAccessoryItem
|
||||
(*CmsSearchRequest)(nil), // 14: blocks.CmsSearchRequest
|
||||
(*IdentRequest)(nil), // 15: blocks.IdentRequest
|
||||
(*StatusReply)(nil), // 16: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cms_proto_post_proto_depIdxs = []int32{
|
||||
11, // 0: cms.PostItem.category_data:type_name -> blocks.CmsCategoryItem
|
||||
@@ -1227,6 +1226,7 @@ func file_module_base_cms_proto_post_proto_init() {
|
||||
if File_module_base_cms_proto_post_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cms_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
Reference in New Issue
Block a user