refactor: localize protobuf definitions
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 搜索文章
|
||||
func Search(ctx context.Context, in *pb.SearchRequest) (reply *pb.PostListReply, err error) {
|
||||
func Search(ctx context.Context, in *pb.CmsSearchRequest) (reply *pb.PostListReply, err error) {
|
||||
if in.GetKeyword() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/base/cms/internal/logic/category"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type CategoryServer struct {
|
||||
@@ -21,7 +21,7 @@ func (s *CategoryServer) Fetch(ctx context.Context, in *pb.IdentRequest) (*pb.Ca
|
||||
}
|
||||
|
||||
// 添加分类
|
||||
func (s *CategoryServer) Create(ctx context.Context, in *pb.CategoryItem) (*pb.StatusReply, error) {
|
||||
func (s *CategoryServer) Create(ctx context.Context, in *pb.CmsCategoryItem) (*pb.StatusReply, error) {
|
||||
return category.Create(ctx, in)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,12 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
"context"
|
||||
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/reflection"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@@ -27,7 +21,6 @@ func New(addr string) *Server {
|
||||
srv := &Server{
|
||||
Ctx: context.Background(),
|
||||
Grpc: grpc.NewServer(),
|
||||
Mux: gwRuntime.NewServeMux(gwRuntime.WithForwardResponseRewriter(responseEnvelope)),
|
||||
grpcConns: make(map[string]*grpc.ClientConn),
|
||||
}
|
||||
|
||||
@@ -40,72 +33,5 @@ func New(addr string) *Server {
|
||||
|
||||
reflection.Register(srv.Grpc)
|
||||
|
||||
// 连接池: 只创建一次连接并复用
|
||||
conn, ok := srv.grpcConns[addr]
|
||||
if !ok {
|
||||
var err error
|
||||
conn, err = grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
panic("failed to dial grpc server: " + err.Error())
|
||||
}
|
||||
srv.grpcConns[addr] = conn
|
||||
}
|
||||
|
||||
// 将服务注册到Gateway
|
||||
|
||||
if err := pb.RegisterCategoryHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Category handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterPagesHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Pages handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterPostHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Post handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterSiteHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Site handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterTagsHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Tags handler: " + err.Error())
|
||||
}
|
||||
|
||||
// Register services swagger
|
||||
srv.RegisterSwagger()
|
||||
|
||||
return srv
|
||||
}
|
||||
|
||||
// RegisterSwagger 注册swagger
|
||||
func (s *Server) RegisterSwagger() {
|
||||
srvKey := strings.ToLower(vars.ServiceKey)
|
||||
s.Mux.HandlePath("GET", "/"+srvKey+".swagger.json", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
bytes, err := os.ReadFile("./swagger/" + srvKey + ".swagger.json")
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
w.Write(bytes)
|
||||
return
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// response envelope
|
||||
func responseEnvelope(_ context.Context, response proto.Message) (interface{}, error) {
|
||||
name := string(response.ProtoReflect().Descriptor().Name())
|
||||
if name == "Status" || name == "Error" || name == "StatusReply" {
|
||||
return response, nil
|
||||
}
|
||||
return map[string]any{
|
||||
"code": 0,
|
||||
"message": vars.OK,
|
||||
"details": response,
|
||||
"timeseq": time.Now().Unix(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/base/cms/internal/logic/pages"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type PagesServer struct {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/base/cms/internal/logic/post"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type PostServer struct {
|
||||
@@ -31,7 +31,7 @@ func (s *PostServer) GetByKey(ctx context.Context, in *pb.GetPostByKeyRequest) (
|
||||
}
|
||||
|
||||
// 搜索文章
|
||||
func (s *PostServer) Search(ctx context.Context, in *pb.SearchRequest) (*pb.PostListReply, error) {
|
||||
func (s *PostServer) Search(ctx context.Context, in *pb.CmsSearchRequest) (*pb.PostListReply, error) {
|
||||
return post.Search(ctx, in)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/base/cms/internal/logic/site"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type SiteServer struct {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/base/cms/internal/logic/tags"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type TagsServer struct {
|
||||
@@ -21,12 +21,12 @@ func (s *TagsServer) Fetch(ctx context.Context, in *pb.IdentRequest) (*pb.TagsLi
|
||||
}
|
||||
|
||||
// 创建标签
|
||||
func (s *TagsServer) Create(ctx context.Context, in *pb.TagsItem) (*pb.StatusReply, error) {
|
||||
func (s *TagsServer) Create(ctx context.Context, in *pb.CmsTagsItem) (*pb.StatusReply, error) {
|
||||
return tags.Create(ctx, in)
|
||||
}
|
||||
|
||||
// 修改标签
|
||||
func (s *TagsServer) Modify(ctx context.Context, in *pb.TagsItem) (*pb.StatusReply, error) {
|
||||
func (s *TagsServer) Modify(ctx context.Context, in *pb.CmsTagsItem) (*pb.StatusReply, error) {
|
||||
return tags.Modify(ctx, in)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
package cms
|
||||
|
||||
import blocks "bsm/full/protobuf"
|
||||
|
||||
type Empty = blocks.Empty
|
||||
type FetchRequest = blocks.FetchRequest
|
||||
type IdentRequest = blocks.IdentRequest
|
||||
type VersionRequest = blocks.VersionRequest
|
||||
type SearchRequest = blocks.CmsSearchRequest
|
||||
type StatusReply = blocks.StatusReply
|
||||
type CategoryItem = blocks.CmsCategoryItem
|
||||
type TagsItem = blocks.CmsTagsItem
|
||||
type AccessoryItem = blocks.CmsAccessoryItem
|
||||
type CategoryItem = CmsCategoryItem
|
||||
type TagsItem = CmsTagsItem
|
||||
type AccessoryItem = CmsAccessoryItem
|
||||
|
||||
@@ -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"
|
||||
@@ -26,7 +25,7 @@ const (
|
||||
type CategoryListReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// 数据
|
||||
Data []*protobuf.CmsCategoryItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||
Data []*CmsCategoryItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||
// 总数
|
||||
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -63,7 +62,7 @@ func (*CategoryListReply) Descriptor() ([]byte, []int) {
|
||||
return file_module_base_cms_proto_category_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CategoryListReply) GetData() []*protobuf.CmsCategoryItem {
|
||||
func (x *CategoryListReply) GetData() []*CmsCategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
@@ -124,16 +123,16 @@ func (x *AddCategoryResponse) GetIdentity() string {
|
||||
|
||||
// 添加分类请求
|
||||
type AddCategoryRequest 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"` // 添加分类请求唯一码
|
||||
ParentId int64 `protobuf:"varint,3,opt,name=parent_id,proto3" json:"parent_id,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
CoverPath string `protobuf:"bytes,5,opt,name=cover_path,proto3" json:"cover_path,omitempty"` // 封面图片
|
||||
Intro string `protobuf:"bytes,6,opt,name=intro,proto3" json:"intro,omitempty"` // 简介
|
||||
CreatedAt string `protobuf:"bytes,7,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,proto3" json:"updated_at,omitempty"` // 更新时间
|
||||
Data []*protobuf.CmsCategoryItem `protobuf:"bytes,9,rep,name=data,proto3" json:"data,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"` // 添加分类请求唯一码
|
||||
ParentId int64 `protobuf:"varint,3,opt,name=parent_id,proto3" json:"parent_id,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
CoverPath string `protobuf:"bytes,5,opt,name=cover_path,proto3" json:"cover_path,omitempty"` // 封面图片
|
||||
Intro string `protobuf:"bytes,6,opt,name=intro,proto3" json:"intro,omitempty"` // 简介
|
||||
CreatedAt string `protobuf:"bytes,7,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,proto3" json:"updated_at,omitempty"` // 更新时间
|
||||
Data []*CmsCategoryItem `protobuf:"bytes,9,rep,name=data,proto3" json:"data,omitempty"` // 子集
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -224,7 +223,7 @@ func (x *AddCategoryRequest) GetUpdatedAt() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddCategoryRequest) GetData() []*protobuf.CmsCategoryItem {
|
||||
func (x *AddCategoryRequest) GetData() []*CmsCategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
@@ -233,17 +232,17 @@ func (x *AddCategoryRequest) GetData() []*protobuf.CmsCategoryItem {
|
||||
|
||||
// 修改分类请求
|
||||
type ModifyCategoryRequest 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"` // 修改分类请求唯一标识
|
||||
ParentId int64 `protobuf:"varint,3,opt,name=parent_id,proto3" json:"parent_id,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
CoverPath string `protobuf:"bytes,5,opt,name=cover_path,proto3" json:"cover_path,omitempty"` // 封面图片
|
||||
Intro string `protobuf:"bytes,6,opt,name=intro,proto3" json:"intro,omitempty"` // 简介
|
||||
CreatedAt string `protobuf:"bytes,7,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,proto3" json:"updated_at,omitempty"` // 更新时间
|
||||
Data []*protobuf.CmsCategoryItem `protobuf:"bytes,9,rep,name=data,proto3" json:"data,omitempty"` // 子集
|
||||
CategoryKey string `protobuf:"bytes,10,opt,name=category_key,proto3" json:"category_key,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"` // 修改分类请求唯一标识
|
||||
ParentId int64 `protobuf:"varint,3,opt,name=parent_id,proto3" json:"parent_id,omitempty"` // 为空表示顶级分类
|
||||
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
CoverPath string `protobuf:"bytes,5,opt,name=cover_path,proto3" json:"cover_path,omitempty"` // 封面图片
|
||||
Intro string `protobuf:"bytes,6,opt,name=intro,proto3" json:"intro,omitempty"` // 简介
|
||||
CreatedAt string `protobuf:"bytes,7,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,proto3" json:"updated_at,omitempty"` // 更新时间
|
||||
Data []*CmsCategoryItem `protobuf:"bytes,9,rep,name=data,proto3" json:"data,omitempty"` // 子集
|
||||
CategoryKey string `protobuf:"bytes,10,opt,name=category_key,proto3" json:"category_key,omitempty"` // 分类标识
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -334,7 +333,7 @@ func (x *ModifyCategoryRequest) GetUpdatedAt() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModifyCategoryRequest) GetData() []*protobuf.CmsCategoryItem {
|
||||
func (x *ModifyCategoryRequest) GetData() []*CmsCategoryItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
@@ -442,7 +441,7 @@ var File_module_base_cms_proto_category_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cms_proto_category_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"$module/base/cms/proto/category.proto\x12\x03cms\x1a\x15protobuf/blocks.proto\"V\n" +
|
||||
"$module/base/cms/proto/category.proto\x12\x03cms\x1a!module/base/cms/proto/const.proto\"V\n" +
|
||||
"\x11CategoryListReply\x12+\n" +
|
||||
"\x04data\x18\x01 \x03(\v2\x17.blocks.CmsCategoryItemR\x04data\x12\x14\n" +
|
||||
"\x05count\x18\x02 \x01(\x03R\x05count\"1\n" +
|
||||
@@ -506,15 +505,15 @@ func file_module_base_cms_proto_category_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cms_proto_category_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_module_base_cms_proto_category_proto_goTypes = []any{
|
||||
(*CategoryListReply)(nil), // 0: cms.CategoryListReply
|
||||
(*AddCategoryResponse)(nil), // 1: cms.AddCategoryResponse
|
||||
(*AddCategoryRequest)(nil), // 2: cms.AddCategoryRequest
|
||||
(*ModifyCategoryRequest)(nil), // 3: cms.ModifyCategoryRequest
|
||||
(*DeleteCategoryRequest)(nil), // 4: cms.DeleteCategoryRequest
|
||||
(*KeywordRequest)(nil), // 5: cms.KeywordRequest
|
||||
(*protobuf.CmsCategoryItem)(nil), // 6: blocks.CmsCategoryItem
|
||||
(*protobuf.IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*protobuf.StatusReply)(nil), // 8: blocks.StatusReply
|
||||
(*CategoryListReply)(nil), // 0: cms.CategoryListReply
|
||||
(*AddCategoryResponse)(nil), // 1: cms.AddCategoryResponse
|
||||
(*AddCategoryRequest)(nil), // 2: cms.AddCategoryRequest
|
||||
(*ModifyCategoryRequest)(nil), // 3: cms.ModifyCategoryRequest
|
||||
(*DeleteCategoryRequest)(nil), // 4: cms.DeleteCategoryRequest
|
||||
(*KeywordRequest)(nil), // 5: cms.KeywordRequest
|
||||
(*CmsCategoryItem)(nil), // 6: blocks.CmsCategoryItem
|
||||
(*IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*StatusReply)(nil), // 8: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cms_proto_category_proto_depIdxs = []int32{
|
||||
6, // 0: cms.CategoryListReply.data:type_name -> blocks.CmsCategoryItem
|
||||
@@ -540,6 +539,7 @@ func file_module_base_cms_proto_category_proto_init() {
|
||||
if File_module_base_cms_proto_category_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cms_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cms
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -38,7 +37,7 @@ var (
|
||||
|
||||
func request_Category_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -53,7 +52,7 @@ func request_Category_Fetch_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Category_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -65,7 +64,7 @@ func local_request_Category_Fetch_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func request_Category_Create_0(ctx context.Context, marshaler runtime.Marshaler, client CategoryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsCategoryItem
|
||||
protoReq CmsCategoryItem
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Category_Create_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Category_Create_0(ctx context.Context, marshaler runtime.Marshaler, server CategoryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsCategoryItem
|
||||
protoReq CmsCategoryItem
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -33,13 +32,13 @@ const (
|
||||
// CMS - 分类
|
||||
type CategoryClient interface {
|
||||
// 分类列表
|
||||
Fetch(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CategoryListReply, error)
|
||||
Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CategoryListReply, error)
|
||||
// 添加分类
|
||||
Create(ctx context.Context, in *protobuf.CmsCategoryItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Create(ctx context.Context, in *CmsCategoryItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改分类
|
||||
Modify(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Modify(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除分类
|
||||
Delete(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Delete(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type categoryClient struct {
|
||||
@@ -50,7 +49,7 @@ func NewCategoryClient(cc grpc.ClientConnInterface) CategoryClient {
|
||||
return &categoryClient{cc}
|
||||
}
|
||||
|
||||
func (c *categoryClient) Fetch(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CategoryListReply, error) {
|
||||
func (c *categoryClient) Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CategoryListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CategoryListReply)
|
||||
err := c.cc.Invoke(ctx, Category_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -60,9 +59,9 @@ func (c *categoryClient) Fetch(ctx context.Context, in *protobuf.IdentRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *categoryClient) Create(ctx context.Context, in *protobuf.CmsCategoryItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *categoryClient) Create(ctx context.Context, in *CmsCategoryItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Category_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -70,9 +69,9 @@ func (c *categoryClient) Create(ctx context.Context, in *protobuf.CmsCategoryIte
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *categoryClient) Modify(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *categoryClient) Modify(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Category_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -80,9 +79,9 @@ func (c *categoryClient) Modify(ctx context.Context, in *ModifyCategoryRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *categoryClient) Delete(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *categoryClient) Delete(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Category_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -97,13 +96,13 @@ func (c *categoryClient) Delete(ctx context.Context, in *DeleteCategoryRequest,
|
||||
// CMS - 分类
|
||||
type CategoryServer interface {
|
||||
// 分类列表
|
||||
Fetch(context.Context, *protobuf.IdentRequest) (*CategoryListReply, error)
|
||||
Fetch(context.Context, *IdentRequest) (*CategoryListReply, error)
|
||||
// 添加分类
|
||||
Create(context.Context, *protobuf.CmsCategoryItem) (*protobuf.StatusReply, error)
|
||||
Create(context.Context, *CmsCategoryItem) (*StatusReply, error)
|
||||
// 修改分类
|
||||
Modify(context.Context, *ModifyCategoryRequest) (*protobuf.StatusReply, error)
|
||||
Modify(context.Context, *ModifyCategoryRequest) (*StatusReply, error)
|
||||
// 删除分类
|
||||
Delete(context.Context, *DeleteCategoryRequest) (*protobuf.StatusReply, error)
|
||||
Delete(context.Context, *DeleteCategoryRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedCategoryServer should be embedded to have
|
||||
@@ -113,16 +112,16 @@ type CategoryServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCategoryServer struct{}
|
||||
|
||||
func (UnimplementedCategoryServer) Fetch(context.Context, *protobuf.IdentRequest) (*CategoryListReply, error) {
|
||||
func (UnimplementedCategoryServer) Fetch(context.Context, *IdentRequest) (*CategoryListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) Create(context.Context, *protobuf.CmsCategoryItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedCategoryServer) Create(context.Context, *CmsCategoryItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) Modify(context.Context, *ModifyCategoryRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedCategoryServer) Modify(context.Context, *ModifyCategoryRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) Delete(context.Context, *DeleteCategoryRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedCategoryServer) Delete(context.Context, *DeleteCategoryRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedCategoryServer) testEmbeddedByValue() {}
|
||||
@@ -146,7 +145,7 @@ func RegisterCategoryServer(s grpc.ServiceRegistrar, srv CategoryServer) {
|
||||
}
|
||||
|
||||
func _Category_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -158,13 +157,13 @@ func _Category_Fetch_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Category_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CategoryServer).Fetch(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(CategoryServer).Fetch(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Category_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.CmsCategoryItem)
|
||||
in := new(CmsCategoryItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -176,7 +175,7 @@ func _Category_Create_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
FullMethod: Category_Create_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CategoryServer).Create(ctx, req.(*protobuf.CmsCategoryItem))
|
||||
return srv.(CategoryServer).Create(ctx, req.(*CmsCategoryItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
3368
module/base/cms/pb/const.pb.go
Normal file
3368
module/base/cms/pb/const.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
@@ -69,24 +68,24 @@ func (x *GetPagesByKeyRequest) GetKey() string {
|
||||
|
||||
// 文章
|
||||
type PagesItem 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"` // 文章唯一标识
|
||||
CreatedAt string `protobuf:"bytes,3,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,4,opt,name=updated_at,proto3" json:"updated_at,omitempty"` //更新时间
|
||||
PostType int32 `protobuf:"varint,5,opt,name=post_type,proto3" json:"post_type,omitempty"` // 用户自定义文章类型
|
||||
Rights string `protobuf:"bytes,6,opt,name=rights,proto3" json:"rights,omitempty"` //权限
|
||||
Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` // <必传>,标题
|
||||
Key string `protobuf:"bytes,8,opt,name=key,proto3" json:"key,omitempty"` //<必传> 内容页的key
|
||||
Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` //简介
|
||||
CoverPath string `protobuf:"bytes,10,opt,name=cover_path,proto3" json:"cover_path,omitempty"` //封面
|
||||
Content string `protobuf:"bytes,11,opt,name=content,proto3" json:"content,omitempty"` // <必传>,内容
|
||||
HasAccessory bool `protobuf:"varint,12,opt,name=has_accessory,proto3" json:"has_accessory,omitempty"` //是否有附件,默认没有
|
||||
AccessoryIdentityArray []string `protobuf:"bytes,13,rep,name=accessory_identity_array,proto3" json:"accessory_identity_array,omitempty"` //附件Identity 列表
|
||||
AccessoryData []*protobuf.CmsAccessoryItem `protobuf:"bytes,14,rep,name=accessory_data,proto3" json:"accessory_data,omitempty"` //附件数据
|
||||
TagsData []*protobuf.CmsTagsItem `protobuf:"bytes,15,rep,name=tags_data,proto3" json:"tags_data,omitempty"` // 标签数据
|
||||
TagsIdentityArray []string `protobuf:"bytes,16,rep,name=tags_identity_array,proto3" json:"tags_identity_array,omitempty"` // 标签集Identity 列表
|
||||
Hits int64 `protobuf:"varint,17,opt,name=hits,proto3" json:"hits,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"` // 文章唯一标识
|
||||
CreatedAt string `protobuf:"bytes,3,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
UpdatedAt string `protobuf:"bytes,4,opt,name=updated_at,proto3" json:"updated_at,omitempty"` //更新时间
|
||||
PostType int32 `protobuf:"varint,5,opt,name=post_type,proto3" json:"post_type,omitempty"` // 用户自定义文章类型
|
||||
Rights string `protobuf:"bytes,6,opt,name=rights,proto3" json:"rights,omitempty"` //权限
|
||||
Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` // <必传>,标题
|
||||
Key string `protobuf:"bytes,8,opt,name=key,proto3" json:"key,omitempty"` //<必传> 内容页的key
|
||||
Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` //简介
|
||||
CoverPath string `protobuf:"bytes,10,opt,name=cover_path,proto3" json:"cover_path,omitempty"` //封面
|
||||
Content string `protobuf:"bytes,11,opt,name=content,proto3" json:"content,omitempty"` // <必传>,内容
|
||||
HasAccessory bool `protobuf:"varint,12,opt,name=has_accessory,proto3" json:"has_accessory,omitempty"` //是否有附件,默认没有
|
||||
AccessoryIdentityArray []string `protobuf:"bytes,13,rep,name=accessory_identity_array,proto3" json:"accessory_identity_array,omitempty"` //附件Identity 列表
|
||||
AccessoryData []*CmsAccessoryItem `protobuf:"bytes,14,rep,name=accessory_data,proto3" json:"accessory_data,omitempty"` //附件数据
|
||||
TagsData []*CmsTagsItem `protobuf:"bytes,15,rep,name=tags_data,proto3" json:"tags_data,omitempty"` // 标签数据
|
||||
TagsIdentityArray []string `protobuf:"bytes,16,rep,name=tags_identity_array,proto3" json:"tags_identity_array,omitempty"` // 标签集Identity 列表
|
||||
Hits int64 `protobuf:"varint,17,opt,name=hits,proto3" json:"hits,omitempty"` //点击量
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -212,14 +211,14 @@ func (x *PagesItem) GetAccessoryIdentityArray() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PagesItem) GetAccessoryData() []*protobuf.CmsAccessoryItem {
|
||||
func (x *PagesItem) GetAccessoryData() []*CmsAccessoryItem {
|
||||
if x != nil {
|
||||
return x.AccessoryData
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PagesItem) GetTagsData() []*protobuf.CmsTagsItem {
|
||||
func (x *PagesItem) GetTagsData() []*CmsTagsItem {
|
||||
if x != nil {
|
||||
return x.TagsData
|
||||
}
|
||||
@@ -411,7 +410,7 @@ var File_module_base_cms_proto_pages_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cms_proto_pages_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"!module/base/cms/proto/pages.proto\x12\x03cms\x1a\x15protobuf/blocks.proto\"(\n" +
|
||||
"!module/base/cms/proto/pages.proto\x12\x03cms\x1a!module/base/cms/proto/const.proto\"(\n" +
|
||||
"\x14GetPagesByKeyRequest\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\"\xe4\x04\n" +
|
||||
"\tPagesItem\x12$\n" +
|
||||
@@ -471,15 +470,15 @@ func file_module_base_cms_proto_pages_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cms_proto_pages_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_module_base_cms_proto_pages_proto_goTypes = []any{
|
||||
(*GetPagesByKeyRequest)(nil), // 0: cms.GetPagesByKeyRequest
|
||||
(*PagesItem)(nil), // 1: cms.PagesItem
|
||||
(*PagesListRequest)(nil), // 2: cms.PagesListRequest
|
||||
(*PagesListReply)(nil), // 3: cms.PagesListReply
|
||||
(*GetPagesRequest)(nil), // 4: cms.GetPagesRequest
|
||||
(*protobuf.CmsAccessoryItem)(nil), // 5: blocks.CmsAccessoryItem
|
||||
(*protobuf.CmsTagsItem)(nil), // 6: blocks.CmsTagsItem
|
||||
(*protobuf.IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*protobuf.StatusReply)(nil), // 8: blocks.StatusReply
|
||||
(*GetPagesByKeyRequest)(nil), // 0: cms.GetPagesByKeyRequest
|
||||
(*PagesItem)(nil), // 1: cms.PagesItem
|
||||
(*PagesListRequest)(nil), // 2: cms.PagesListRequest
|
||||
(*PagesListReply)(nil), // 3: cms.PagesListReply
|
||||
(*GetPagesRequest)(nil), // 4: cms.GetPagesRequest
|
||||
(*CmsAccessoryItem)(nil), // 5: blocks.CmsAccessoryItem
|
||||
(*CmsTagsItem)(nil), // 6: blocks.CmsTagsItem
|
||||
(*IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*StatusReply)(nil), // 8: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cms_proto_pages_proto_depIdxs = []int32{
|
||||
5, // 0: cms.PagesItem.accessory_data:type_name -> blocks.CmsAccessoryItem
|
||||
@@ -509,6 +508,7 @@ func file_module_base_cms_proto_pages_proto_init() {
|
||||
if File_module_base_cms_proto_pages_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cms_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cms
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -173,7 +172,7 @@ func local_request_Pages_Modify_0(ctx context.Context, marshaler runtime.Marshal
|
||||
|
||||
func request_Pages_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client PagesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -188,7 +187,7 @@ func request_Pages_Delete_0(ctx context.Context, marshaler runtime.Marshaler, cl
|
||||
|
||||
func local_request_Pages_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server PagesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -41,11 +40,11 @@ type PagesClient interface {
|
||||
// 获取单页详情 By Key
|
||||
GetByKey(ctx context.Context, in *GetPagesByKeyRequest, opts ...grpc.CallOption) (*PagesItem, error)
|
||||
// 发布单页
|
||||
Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改单页
|
||||
Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除单页
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type pagesClient struct {
|
||||
@@ -86,9 +85,9 @@ func (c *pagesClient) GetByKey(ctx context.Context, in *GetPagesByKeyRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pagesClient) Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *pagesClient) Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Pages_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -96,9 +95,9 @@ func (c *pagesClient) Create(ctx context.Context, in *PagesItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Pages_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -106,9 +105,9 @@ func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pagesClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *pagesClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Pages_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -129,11 +128,11 @@ type PagesServer interface {
|
||||
// 获取单页详情 By Key
|
||||
GetByKey(context.Context, *GetPagesByKeyRequest) (*PagesItem, error)
|
||||
// 发布单页
|
||||
Create(context.Context, *PagesItem) (*protobuf.StatusReply, error)
|
||||
Create(context.Context, *PagesItem) (*StatusReply, error)
|
||||
// 修改单页
|
||||
Modify(context.Context, *PagesItem) (*protobuf.StatusReply, error)
|
||||
Modify(context.Context, *PagesItem) (*StatusReply, error)
|
||||
// 删除单页
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedPagesServer should be embedded to have
|
||||
@@ -152,13 +151,13 @@ func (UnimplementedPagesServer) GetByIdentity(context.Context, *GetPagesRequest)
|
||||
func (UnimplementedPagesServer) GetByKey(context.Context, *GetPagesByKeyRequest) (*PagesItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetByKey not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) Create(context.Context, *PagesItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPagesServer) Create(context.Context, *PagesItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) Modify(context.Context, *PagesItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPagesServer) Modify(context.Context, *PagesItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPagesServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedPagesServer) testEmbeddedByValue() {}
|
||||
@@ -272,7 +271,7 @@ func _Pages_Modify_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
|
||||
func _Pages_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -284,7 +283,7 @@ func _Pages_Delete_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Pages_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PagesServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(PagesServer).Delete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cms
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -119,7 +118,7 @@ func local_request_Post_GetByKey_0(ctx context.Context, marshaler runtime.Marsha
|
||||
|
||||
func request_Post_Search_0(ctx context.Context, marshaler runtime.Marshaler, client PostClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsSearchRequest
|
||||
protoReq CmsSearchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Post_Search_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Post_Search_0(ctx context.Context, marshaler runtime.Marshaler, server PostServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsSearchRequest
|
||||
protoReq CmsSearchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -200,7 +199,7 @@ func local_request_Post_Modify_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func request_Post_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client PostClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -215,7 +214,7 @@ func request_Post_Delete_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Post_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server PostServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -54,37 +53,37 @@ type PostClient interface {
|
||||
// 获取文章详情 By Key
|
||||
GetByKey(ctx context.Context, in *GetPostByKeyRequest, opts ...grpc.CallOption) (*PostItem, error)
|
||||
// 搜索文章
|
||||
Search(ctx context.Context, in *protobuf.CmsSearchRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
Search(ctx context.Context, in *CmsSearchRequest, opts ...grpc.CallOption) (*PostListReply, error)
|
||||
// 发布文章
|
||||
Create(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Create(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改文章
|
||||
Modify(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Modify(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除文章
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 文章点赞处理
|
||||
IncrPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
IncrPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 文章点赞取消处理
|
||||
DescPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DescPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 文章点踩处理
|
||||
IncrPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
IncrPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 文章点踩取消处理
|
||||
DescPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DescPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论列表
|
||||
CommentList(ctx context.Context, in *CommentListRequest, opts ...grpc.CallOption) (*CommentListResponse, error)
|
||||
// 发布评论
|
||||
AddComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
AddComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改评论
|
||||
ModifyComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
ModifyComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除评论
|
||||
DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论点赞处理
|
||||
IncrCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
IncrCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论点赞取消处理
|
||||
DescCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DescCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论点踩处理
|
||||
IncrCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
IncrCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 评论点踩取消处理
|
||||
DescCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DescCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type postClient struct {
|
||||
@@ -125,7 +124,7 @@ func (c *postClient) GetByKey(ctx context.Context, in *GetPostByKeyRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) Search(ctx context.Context, in *protobuf.CmsSearchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
func (c *postClient) Search(ctx context.Context, in *CmsSearchRequest, opts ...grpc.CallOption) (*PostListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PostListReply)
|
||||
err := c.cc.Invoke(ctx, Post_Search_FullMethodName, in, out, cOpts...)
|
||||
@@ -135,9 +134,9 @@ func (c *postClient) Search(ctx context.Context, in *protobuf.CmsSearchRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) Create(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) Create(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -145,9 +144,9 @@ func (c *postClient) Create(ctx context.Context, in *PostItem, opts ...grpc.Call
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) Modify(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) Modify(ctx context.Context, in *PostItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -155,9 +154,9 @@ func (c *postClient) Modify(ctx context.Context, in *PostItem, opts ...grpc.Call
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -165,9 +164,9 @@ func (c *postClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) IncrPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrPostLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -175,9 +174,9 @@ func (c *postClient) IncrPostLike(ctx context.Context, in *PostOpIdentityRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) DescPostLike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescPostLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -185,9 +184,9 @@ func (c *postClient) DescPostLike(ctx context.Context, in *PostOpIdentityRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) IncrPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrPostUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -195,9 +194,9 @@ func (c *postClient) IncrPostUnlike(ctx context.Context, in *PostOpIdentityReque
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) DescPostUnlike(ctx context.Context, in *PostOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescPostUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -215,9 +214,9 @@ func (c *postClient) CommentList(ctx context.Context, in *CommentListRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) AddComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) AddComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_AddComment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -225,9 +224,9 @@ func (c *postClient) AddComment(ctx context.Context, in *CommentItem, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) ModifyComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) ModifyComment(ctx context.Context, in *CommentItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_ModifyComment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -235,9 +234,9 @@ func (c *postClient) ModifyComment(ctx context.Context, in *CommentItem, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DeleteComment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -245,9 +244,9 @@ func (c *postClient) DeleteComment(ctx context.Context, in *DeleteCommentRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) IncrCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrCommentLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -255,9 +254,9 @@ func (c *postClient) IncrCommentLike(ctx context.Context, in *CommentOpIdentityR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) DescCommentLike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescCommentLike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -265,9 +264,9 @@ func (c *postClient) DescCommentLike(ctx context.Context, in *CommentOpIdentityR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) IncrCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) IncrCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_IncrCommentUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -275,9 +274,9 @@ func (c *postClient) IncrCommentUnlike(ctx context.Context, in *CommentOpIdentit
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *postClient) DescCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *postClient) DescCommentUnlike(ctx context.Context, in *CommentOpIdentityRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Post_DescCommentUnlike_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -298,37 +297,37 @@ type PostServer interface {
|
||||
// 获取文章详情 By Key
|
||||
GetByKey(context.Context, *GetPostByKeyRequest) (*PostItem, error)
|
||||
// 搜索文章
|
||||
Search(context.Context, *protobuf.CmsSearchRequest) (*PostListReply, error)
|
||||
Search(context.Context, *CmsSearchRequest) (*PostListReply, error)
|
||||
// 发布文章
|
||||
Create(context.Context, *PostItem) (*protobuf.StatusReply, error)
|
||||
Create(context.Context, *PostItem) (*StatusReply, error)
|
||||
// 修改文章
|
||||
Modify(context.Context, *PostItem) (*protobuf.StatusReply, error)
|
||||
Modify(context.Context, *PostItem) (*StatusReply, error)
|
||||
// 删除文章
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 文章点赞处理
|
||||
IncrPostLike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
IncrPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
// 文章点赞取消处理
|
||||
DescPostLike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
DescPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
// 文章点踩处理
|
||||
IncrPostUnlike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
IncrPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
// 文章点踩取消处理
|
||||
DescPostUnlike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
DescPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error)
|
||||
// 评论列表
|
||||
CommentList(context.Context, *CommentListRequest) (*CommentListResponse, error)
|
||||
// 发布评论
|
||||
AddComment(context.Context, *CommentItem) (*protobuf.StatusReply, error)
|
||||
AddComment(context.Context, *CommentItem) (*StatusReply, error)
|
||||
// 修改评论
|
||||
ModifyComment(context.Context, *CommentItem) (*protobuf.StatusReply, error)
|
||||
ModifyComment(context.Context, *CommentItem) (*StatusReply, error)
|
||||
// 删除评论
|
||||
DeleteComment(context.Context, *DeleteCommentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteComment(context.Context, *DeleteCommentRequest) (*StatusReply, error)
|
||||
// 评论点赞处理
|
||||
IncrCommentLike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
IncrCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
// 评论点赞取消处理
|
||||
DescCommentLike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
DescCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
// 评论点踩处理
|
||||
IncrCommentUnlike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
IncrCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
// 评论点踩取消处理
|
||||
DescCommentUnlike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error)
|
||||
DescCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedPostServer should be embedded to have
|
||||
@@ -347,52 +346,52 @@ func (UnimplementedPostServer) GetByIdentity(context.Context, *GetPostRequest) (
|
||||
func (UnimplementedPostServer) GetByKey(context.Context, *GetPostByKeyRequest) (*PostItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetByKey not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) Search(context.Context, *protobuf.CmsSearchRequest) (*PostListReply, error) {
|
||||
func (UnimplementedPostServer) Search(context.Context, *CmsSearchRequest) (*PostListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Search not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) Create(context.Context, *PostItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) Create(context.Context, *PostItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) Modify(context.Context, *PostItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) Modify(context.Context, *PostItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrPostLike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) IncrPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IncrPostLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescPostLike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) DescPostLike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DescPostLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrPostUnlike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) IncrPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IncrPostUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescPostUnlike(context.Context, *PostOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) DescPostUnlike(context.Context, *PostOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DescPostUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) CommentList(context.Context, *CommentListRequest) (*CommentListResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CommentList not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) AddComment(context.Context, *CommentItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) AddComment(context.Context, *CommentItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddComment not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) ModifyComment(context.Context, *CommentItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) ModifyComment(context.Context, *CommentItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ModifyComment not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DeleteComment(context.Context, *DeleteCommentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) DeleteComment(context.Context, *DeleteCommentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteComment not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrCommentLike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) IncrCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IncrCommentLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescCommentLike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) DescCommentLike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DescCommentLike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) IncrCommentUnlike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) IncrCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IncrCommentUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) DescCommentUnlike(context.Context, *CommentOpIdentityRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPostServer) DescCommentUnlike(context.Context, *CommentOpIdentityRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DescCommentUnlike not implemented")
|
||||
}
|
||||
func (UnimplementedPostServer) testEmbeddedByValue() {}
|
||||
@@ -470,7 +469,7 @@ func _Post_GetByKey_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
}
|
||||
|
||||
func _Post_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.CmsSearchRequest)
|
||||
in := new(CmsSearchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -482,7 +481,7 @@ func _Post_Search_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Post_Search_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).Search(ctx, req.(*protobuf.CmsSearchRequest))
|
||||
return srv.(PostServer).Search(ctx, req.(*CmsSearchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -524,7 +523,7 @@ func _Post_Modify_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
}
|
||||
|
||||
func _Post_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -536,7 +535,7 @@ func _Post_Delete_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Post_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PostServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(PostServer).Delete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
@@ -198,7 +197,7 @@ var File_module_base_cms_proto_site_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cms_proto_site_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
" module/base/cms/proto/site.proto\x12\x03cms\x1a\x15protobuf/blocks.proto\"H\n" +
|
||||
" module/base/cms/proto/site.proto\x12\x03cms\x1a!module/base/cms/proto/const.proto\"H\n" +
|
||||
"\rSiteListReply\x12!\n" +
|
||||
"\x04data\x18\x01 \x03(\v2\r.cms.SiteItemR\x04data\x12\x14\n" +
|
||||
"\x05count\x18\x02 \x01(\x03R\x05count\"\x82\x02\n" +
|
||||
@@ -235,11 +234,11 @@ func file_module_base_cms_proto_site_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cms_proto_site_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_module_base_cms_proto_site_proto_goTypes = []any{
|
||||
(*SiteListReply)(nil), // 0: cms.SiteListReply
|
||||
(*SiteItem)(nil), // 1: cms.SiteItem
|
||||
(*protobuf.Empty)(nil), // 2: blocks.Empty
|
||||
(*protobuf.IdentRequest)(nil), // 3: blocks.IdentRequest
|
||||
(*protobuf.StatusReply)(nil), // 4: blocks.StatusReply
|
||||
(*SiteListReply)(nil), // 0: cms.SiteListReply
|
||||
(*SiteItem)(nil), // 1: cms.SiteItem
|
||||
(*Empty)(nil), // 2: blocks.Empty
|
||||
(*IdentRequest)(nil), // 3: blocks.IdentRequest
|
||||
(*StatusReply)(nil), // 4: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cms_proto_site_proto_depIdxs = []int32{
|
||||
1, // 0: cms.SiteListReply.data:type_name -> cms.SiteItem
|
||||
@@ -265,6 +264,7 @@ func file_module_base_cms_proto_site_proto_init() {
|
||||
if File_module_base_cms_proto_site_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cms_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cms
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -38,7 +37,7 @@ var (
|
||||
|
||||
func request_Site_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client SiteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.Empty
|
||||
protoReq Empty
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -53,7 +52,7 @@ func request_Site_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, clie
|
||||
|
||||
func local_request_Site_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server SiteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.Empty
|
||||
protoReq Empty
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -65,7 +64,7 @@ func local_request_Site_Fetch_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func request_Site_Get_0(ctx context.Context, marshaler runtime.Marshaler, client SiteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Site_Get_0(ctx context.Context, marshaler runtime.Marshaler, client
|
||||
|
||||
func local_request_Site_Get_0(ctx context.Context, marshaler runtime.Marshaler, server SiteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -146,7 +145,7 @@ func local_request_Site_Modify_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func request_Site_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client SiteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -161,7 +160,7 @@ func request_Site_Delete_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Site_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server SiteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -34,15 +33,15 @@ const (
|
||||
// CMS - 站点
|
||||
type SiteClient interface {
|
||||
// 站点列表
|
||||
Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*SiteListReply, error)
|
||||
Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SiteListReply, error)
|
||||
// 站点详情
|
||||
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*SiteItem, error)
|
||||
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SiteItem, error)
|
||||
// 添加站点
|
||||
Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改站点
|
||||
Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除站点
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type siteClient struct {
|
||||
@@ -53,7 +52,7 @@ func NewSiteClient(cc grpc.ClientConnInterface) SiteClient {
|
||||
return &siteClient{cc}
|
||||
}
|
||||
|
||||
func (c *siteClient) Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*SiteListReply, error) {
|
||||
func (c *siteClient) Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SiteListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SiteListReply)
|
||||
err := c.cc.Invoke(ctx, Site_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -63,7 +62,7 @@ func (c *siteClient) Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*SiteItem, error) {
|
||||
func (c *siteClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SiteItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SiteItem)
|
||||
err := c.cc.Invoke(ctx, Site_Get_FullMethodName, in, out, cOpts...)
|
||||
@@ -73,9 +72,9 @@ func (c *siteClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ..
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *siteClient) Create(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Site_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -83,9 +82,9 @@ func (c *siteClient) Create(ctx context.Context, in *SiteItem, opts ...grpc.Call
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *siteClient) Modify(ctx context.Context, in *SiteItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Site_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -93,9 +92,9 @@ func (c *siteClient) Modify(ctx context.Context, in *SiteItem, opts ...grpc.Call
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *siteClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *siteClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Site_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -110,15 +109,15 @@ func (c *siteClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts
|
||||
// CMS - 站点
|
||||
type SiteServer interface {
|
||||
// 站点列表
|
||||
Fetch(context.Context, *protobuf.Empty) (*SiteListReply, error)
|
||||
Fetch(context.Context, *Empty) (*SiteListReply, error)
|
||||
// 站点详情
|
||||
Get(context.Context, *protobuf.IdentRequest) (*SiteItem, error)
|
||||
Get(context.Context, *IdentRequest) (*SiteItem, error)
|
||||
// 添加站点
|
||||
Create(context.Context, *SiteItem) (*protobuf.StatusReply, error)
|
||||
Create(context.Context, *SiteItem) (*StatusReply, error)
|
||||
// 修改站点
|
||||
Modify(context.Context, *SiteItem) (*protobuf.StatusReply, error)
|
||||
Modify(context.Context, *SiteItem) (*StatusReply, error)
|
||||
// 删除站点
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedSiteServer should be embedded to have
|
||||
@@ -128,19 +127,19 @@ type SiteServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSiteServer struct{}
|
||||
|
||||
func (UnimplementedSiteServer) Fetch(context.Context, *protobuf.Empty) (*SiteListReply, error) {
|
||||
func (UnimplementedSiteServer) Fetch(context.Context, *Empty) (*SiteListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Get(context.Context, *protobuf.IdentRequest) (*SiteItem, error) {
|
||||
func (UnimplementedSiteServer) Get(context.Context, *IdentRequest) (*SiteItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Create(context.Context, *SiteItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedSiteServer) Create(context.Context, *SiteItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Modify(context.Context, *SiteItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedSiteServer) Modify(context.Context, *SiteItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedSiteServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedSiteServer) testEmbeddedByValue() {}
|
||||
@@ -164,7 +163,7 @@ func RegisterSiteServer(s grpc.ServiceRegistrar, srv SiteServer) {
|
||||
}
|
||||
|
||||
func _Site_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.Empty)
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -176,13 +175,13 @@ func _Site_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
FullMethod: Site_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SiteServer).Fetch(ctx, req.(*protobuf.Empty))
|
||||
return srv.(SiteServer).Fetch(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Site_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -194,7 +193,7 @@ func _Site_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{
|
||||
FullMethod: Site_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SiteServer).Get(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(SiteServer).Get(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -236,7 +235,7 @@ func _Site_Modify_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
}
|
||||
|
||||
func _Site_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -248,7 +247,7 @@ func _Site_Delete_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Site_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SiteServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(SiteServer).Delete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
@@ -24,9 +23,9 @@ const (
|
||||
|
||||
// 标签列表
|
||||
type TagsListReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Data []*protobuf.CmsTagsItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // 数据
|
||||
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // 总数
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Data []*CmsTagsItem `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // 数据
|
||||
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // 总数
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -61,7 +60,7 @@ func (*TagsListReply) Descriptor() ([]byte, []int) {
|
||||
return file_module_base_cms_proto_tags_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TagsListReply) GetData() []*protobuf.CmsTagsItem {
|
||||
func (x *TagsListReply) GetData() []*CmsTagsItem {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
@@ -79,7 +78,7 @@ var File_module_base_cms_proto_tags_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cms_proto_tags_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
" module/base/cms/proto/tags.proto\x12\x03cms\x1a\x15protobuf/blocks.proto\"N\n" +
|
||||
" module/base/cms/proto/tags.proto\x12\x03cms\x1a!module/base/cms/proto/const.proto\"N\n" +
|
||||
"\rTagsListReply\x12'\n" +
|
||||
"\x04data\x18\x01 \x03(\v2\x13.blocks.CmsTagsItemR\x04data\x12\x14\n" +
|
||||
"\x05count\x18\x02 \x01(\x03R\x05count2\xde\x01\n" +
|
||||
@@ -103,10 +102,10 @@ func file_module_base_cms_proto_tags_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cms_proto_tags_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_module_base_cms_proto_tags_proto_goTypes = []any{
|
||||
(*TagsListReply)(nil), // 0: cms.TagsListReply
|
||||
(*protobuf.CmsTagsItem)(nil), // 1: blocks.CmsTagsItem
|
||||
(*protobuf.IdentRequest)(nil), // 2: blocks.IdentRequest
|
||||
(*protobuf.StatusReply)(nil), // 3: blocks.StatusReply
|
||||
(*TagsListReply)(nil), // 0: cms.TagsListReply
|
||||
(*CmsTagsItem)(nil), // 1: blocks.CmsTagsItem
|
||||
(*IdentRequest)(nil), // 2: blocks.IdentRequest
|
||||
(*StatusReply)(nil), // 3: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cms_proto_tags_proto_depIdxs = []int32{
|
||||
1, // 0: cms.TagsListReply.data:type_name -> blocks.CmsTagsItem
|
||||
@@ -130,6 +129,7 @@ func file_module_base_cms_proto_tags_proto_init() {
|
||||
if File_module_base_cms_proto_tags_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cms_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cms
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -38,7 +37,7 @@ var (
|
||||
|
||||
func request_Tags_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client TagsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -53,7 +52,7 @@ func request_Tags_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, clie
|
||||
|
||||
func local_request_Tags_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server TagsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -65,7 +64,7 @@ func local_request_Tags_Fetch_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func request_Tags_Create_0(ctx context.Context, marshaler runtime.Marshaler, client TagsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsTagsItem
|
||||
protoReq CmsTagsItem
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Tags_Create_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Tags_Create_0(ctx context.Context, marshaler runtime.Marshaler, server TagsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsTagsItem
|
||||
protoReq CmsTagsItem
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -92,7 +91,7 @@ func local_request_Tags_Create_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func request_Tags_Modify_0(ctx context.Context, marshaler runtime.Marshaler, client TagsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsTagsItem
|
||||
protoReq CmsTagsItem
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -107,7 +106,7 @@ func request_Tags_Modify_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Tags_Modify_0(ctx context.Context, marshaler runtime.Marshaler, server TagsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.CmsTagsItem
|
||||
protoReq CmsTagsItem
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Tags_Modify_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func request_Tags_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client TagsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Tags_Delete_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Tags_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server TagsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -33,13 +32,13 @@ const (
|
||||
// 标签
|
||||
type TagsClient interface {
|
||||
// 标签列表
|
||||
Fetch(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error)
|
||||
Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error)
|
||||
// 创建标签
|
||||
Create(ctx context.Context, in *protobuf.CmsTagsItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Create(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 修改标签
|
||||
Modify(ctx context.Context, in *protobuf.CmsTagsItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Modify(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除标签
|
||||
Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type tagsClient struct {
|
||||
@@ -50,7 +49,7 @@ func NewTagsClient(cc grpc.ClientConnInterface) TagsClient {
|
||||
return &tagsClient{cc}
|
||||
}
|
||||
|
||||
func (c *tagsClient) Fetch(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error) {
|
||||
func (c *tagsClient) Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TagsListReply)
|
||||
err := c.cc.Invoke(ctx, Tags_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -60,9 +59,9 @@ func (c *tagsClient) Fetch(ctx context.Context, in *protobuf.IdentRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tagsClient) Create(ctx context.Context, in *protobuf.CmsTagsItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *tagsClient) Create(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Tags_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -70,9 +69,9 @@ func (c *tagsClient) Create(ctx context.Context, in *protobuf.CmsTagsItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tagsClient) Modify(ctx context.Context, in *protobuf.CmsTagsItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *tagsClient) Modify(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Tags_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -80,9 +79,9 @@ func (c *tagsClient) Modify(ctx context.Context, in *protobuf.CmsTagsItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *tagsClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *tagsClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Tags_Delete_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -97,13 +96,13 @@ func (c *tagsClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts
|
||||
// 标签
|
||||
type TagsServer interface {
|
||||
// 标签列表
|
||||
Fetch(context.Context, *protobuf.IdentRequest) (*TagsListReply, error)
|
||||
Fetch(context.Context, *IdentRequest) (*TagsListReply, error)
|
||||
// 创建标签
|
||||
Create(context.Context, *protobuf.CmsTagsItem) (*protobuf.StatusReply, error)
|
||||
Create(context.Context, *CmsTagsItem) (*StatusReply, error)
|
||||
// 修改标签
|
||||
Modify(context.Context, *protobuf.CmsTagsItem) (*protobuf.StatusReply, error)
|
||||
Modify(context.Context, *CmsTagsItem) (*StatusReply, error)
|
||||
// 删除标签
|
||||
Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
Delete(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedTagsServer should be embedded to have
|
||||
@@ -113,16 +112,16 @@ type TagsServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedTagsServer struct{}
|
||||
|
||||
func (UnimplementedTagsServer) Fetch(context.Context, *protobuf.IdentRequest) (*TagsListReply, error) {
|
||||
func (UnimplementedTagsServer) Fetch(context.Context, *IdentRequest) (*TagsListReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) Create(context.Context, *protobuf.CmsTagsItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedTagsServer) Create(context.Context, *CmsTagsItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) Modify(context.Context, *protobuf.CmsTagsItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedTagsServer) Modify(context.Context, *CmsTagsItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedTagsServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedTagsServer) testEmbeddedByValue() {}
|
||||
@@ -146,7 +145,7 @@ func RegisterTagsServer(s grpc.ServiceRegistrar, srv TagsServer) {
|
||||
}
|
||||
|
||||
func _Tags_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -158,13 +157,13 @@ func _Tags_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
FullMethod: Tags_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).Fetch(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(TagsServer).Fetch(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Tags_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.CmsTagsItem)
|
||||
in := new(CmsTagsItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -176,13 +175,13 @@ func _Tags_Create_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Tags_Create_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).Create(ctx, req.(*protobuf.CmsTagsItem))
|
||||
return srv.(TagsServer).Create(ctx, req.(*CmsTagsItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Tags_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.CmsTagsItem)
|
||||
in := new(CmsTagsItem)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -194,13 +193,13 @@ func _Tags_Modify_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Tags_Modify_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).Modify(ctx, req.(*protobuf.CmsTagsItem))
|
||||
return srv.(TagsServer).Modify(ctx, req.(*CmsTagsItem))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Tags_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -212,7 +211,7 @@ func _Tags_Delete_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Tags_Delete_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TagsServer).Delete(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(TagsServer).Delete(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = "bsm/full/module/base/cms/pb;cms";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cms/proto/const.proto";
|
||||
|
||||
// CMS - 分类
|
||||
service Category {
|
||||
|
||||
326
module/base/cms/proto/const.proto
Normal file
326
module/base/cms/proto/const.proto
Normal file
@@ -0,0 +1,326 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package blocks;
|
||||
|
||||
option go_package = "bsm/full/module/base/cms/pb;cms";
|
||||
|
||||
// Shared request and response messages.
|
||||
message Empty {}
|
||||
|
||||
message FetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"];
|
||||
int64 page_size = 2 [json_name = "page_size"];
|
||||
map<string, string> params = 3;
|
||||
}
|
||||
|
||||
message IdentRequest {
|
||||
int64 id = 1;
|
||||
string identity = 2;
|
||||
}
|
||||
|
||||
message VersionRequest {
|
||||
int64 version = 1;
|
||||
}
|
||||
|
||||
message SearchRequest {
|
||||
string keyword = 1;
|
||||
}
|
||||
|
||||
message StatusReply {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
string details = 3;
|
||||
int64 timeseq = 4;
|
||||
}
|
||||
|
||||
// Service-specific variants whose wire formats differ from the shared types.
|
||||
message CmsSearchRequest {
|
||||
string keyword = 1;
|
||||
int64 page_no = 2 [json_name = "page_no"];
|
||||
int64 page_size = 3 [json_name = "page_size"];
|
||||
}
|
||||
|
||||
message MallFetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"];
|
||||
int64 page_size = 2 [json_name = "page_size"];
|
||||
map<string, string> params = 3;
|
||||
string store_identity = 4 [json_name = "store_identity"];
|
||||
string keyword = 5;
|
||||
repeated int64 category_id = 6;
|
||||
string sort = 7;
|
||||
int64 min_price = 8 [json_name = "min_price"];
|
||||
int64 max_price = 9 [json_name = "max_price"];
|
||||
}
|
||||
|
||||
message MarketFetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"];
|
||||
int64 page_size = 2 [json_name = "page_size"];
|
||||
map<string, string> params = 3;
|
||||
string identity = 4;
|
||||
string keyword = 5;
|
||||
int32 status = 6;
|
||||
int32 approve = 7;
|
||||
}
|
||||
|
||||
message OrderIdentRequest {
|
||||
int64 id = 1;
|
||||
string identity = 2;
|
||||
string reason = 3;
|
||||
int32 approve = 4;
|
||||
string agency = 5;
|
||||
string store_identity = 6;
|
||||
}
|
||||
|
||||
message DeliveryStatusReply {
|
||||
int64 status = 1;
|
||||
string identity = 2;
|
||||
string message = 3;
|
||||
int64 timeseq = 4;
|
||||
}
|
||||
|
||||
message IdentityStatusReply {
|
||||
int32 code = 1;
|
||||
string identity = 2;
|
||||
string message = 3;
|
||||
int64 timeseq = 4;
|
||||
}
|
||||
|
||||
message OrderStatusReply {
|
||||
int32 code = 1;
|
||||
string identity = 2;
|
||||
string message = 3;
|
||||
int64 timeseq = 4;
|
||||
string reason = 5;
|
||||
}
|
||||
|
||||
message DataStatusReply {
|
||||
string data = 1;
|
||||
int64 timeseq = 2;
|
||||
}
|
||||
|
||||
message StoreSerialRequest {
|
||||
string store_identity = 1 [json_name = "store_identity"];
|
||||
repeated string serial_id = 2 [json_name = "serial_id"];
|
||||
}
|
||||
|
||||
// Cloud messages.
|
||||
message IDRequest {
|
||||
uint64 id = 1;
|
||||
}
|
||||
|
||||
message IDListRequest {
|
||||
repeated uint64 ids = 1;
|
||||
}
|
||||
|
||||
message StdIicuds {
|
||||
uint64 id = 1;
|
||||
string created_at = 2;
|
||||
string updated_at = 3;
|
||||
string deleted_at = 4;
|
||||
}
|
||||
|
||||
message StdPassport {
|
||||
uint64 passport_id = 1;
|
||||
string passport_identity = 2;
|
||||
}
|
||||
|
||||
message CloudBase {
|
||||
uint64 cloud_id = 1;
|
||||
string cloud_identity = 2;
|
||||
}
|
||||
|
||||
// CMS messages.
|
||||
message CmsCategoryItem {
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
int64 id = 2;
|
||||
string identity = 3;
|
||||
int64 parent_id = 4 [json_name = "parent_id"];
|
||||
string title = 5;
|
||||
string cover_path = 6 [json_name = "cover_path"];
|
||||
string intro = 7;
|
||||
string created_at = 8 [json_name = "created_at"];
|
||||
string updated_at = 9 [json_name = "updated_at"];
|
||||
repeated CmsCategoryItem child = 10;
|
||||
string category_key = 11 [json_name = "category_key"];
|
||||
}
|
||||
|
||||
message CmsTagsItem {
|
||||
int64 id = 1;
|
||||
string identity = 2;
|
||||
string title = 3;
|
||||
string cover_path = 4 [json_name = "cover_path"];
|
||||
string intro = 5;
|
||||
string created_at = 6 [json_name = "created_at"];
|
||||
}
|
||||
|
||||
message CmsAccessoryItem {
|
||||
string identity = 1;
|
||||
string title = 2;
|
||||
string file_path = 3 [json_name = "file_path"];
|
||||
string created_at = 4 [json_name = "created_at"];
|
||||
}
|
||||
|
||||
// Passport messages.
|
||||
message VerifyStatus {
|
||||
int32 email_verify = 1;
|
||||
int32 phone_verify = 2;
|
||||
int32 face_verify = 3;
|
||||
int32 document_verify = 4;
|
||||
int32 kyc_verify = 5;
|
||||
}
|
||||
|
||||
// Market messages.
|
||||
message MarketLoginReply {
|
||||
string token = 1;
|
||||
string identity = 2;
|
||||
string market_identity = 3 [json_name = "market_identity"];
|
||||
string name = 4;
|
||||
string account = 5;
|
||||
string role = 6;
|
||||
int32 status = 7;
|
||||
string created_at = 8 [json_name = "created_at"];
|
||||
string market_name = 9 [json_name = "market_name"];
|
||||
}
|
||||
|
||||
// Order messages.
|
||||
message OrderSummaryItem {
|
||||
int64 id = 1;
|
||||
string order_no = 2 [json_name = "order_no"];
|
||||
int64 partner_id = 3 [json_name = "partner_id"];
|
||||
string identity = 4;
|
||||
int64 total_price = 7 [json_name = "total_price"];
|
||||
int64 trans_price = 8 [json_name = "trans_price"];
|
||||
int64 refund_price = 9 [json_name = "refund_price"];
|
||||
int64 logistics_fee = 11 [json_name = "logistics_fee"];
|
||||
int64 coupon_amount = 12 [json_name = "coupon_amount"];
|
||||
string remark = 13;
|
||||
int32 status = 14;
|
||||
string logistics_number = 15 [json_name = "logistics_number"];
|
||||
string address_identity = 16 [json_name = "address_identity"];
|
||||
string county = 17;
|
||||
string province = 18;
|
||||
string city = 19;
|
||||
string area = 20;
|
||||
string address = 21;
|
||||
string contact = 22;
|
||||
string phone = 23;
|
||||
string delivery_time = 24 [json_name = "delivery_time"];
|
||||
string delivery_identity = 25 [json_name = "delivery_identity"];
|
||||
int32 pay_type = 26 [json_name = "pay_type"];
|
||||
int64 pay_amount = 27 [json_name = "pay_amount"];
|
||||
string pay_trade_no = 28 [json_name = "pay_trade_no"];
|
||||
string pay_time = 29 [json_name = "pay_time"];
|
||||
string pay_remark = 30 [json_name = "pay_remark"];
|
||||
string created = 31;
|
||||
string updated = 32;
|
||||
repeated OrderDetails details = 33;
|
||||
string addr = 34;
|
||||
string car_identity = 35 [json_name = "car_identity"];
|
||||
string delivery_address = 36 [json_name = "delivery_address"];
|
||||
string brand = 37;
|
||||
string version = 38;
|
||||
string license_number = 39 [json_name = "license_number"];
|
||||
string member_name = 40 [json_name = "member_name"];
|
||||
string member_phone = 41 [json_name = "member_phone"];
|
||||
int32 approve = 42;
|
||||
}
|
||||
|
||||
message OrderDetails {
|
||||
int64 id = 1;
|
||||
int64 product_id = 2 [json_name = "product_id"];
|
||||
string spec_no = 3 [json_name = "spec_no"];
|
||||
string spec = 4;
|
||||
int64 type = 5;
|
||||
string title = 6;
|
||||
string cover_image = 7 [json_name = "cover_image"];
|
||||
int64 sales_price = 8 [json_name = "sales_price"];
|
||||
string product_args = 9 [json_name = "product_args"];
|
||||
int64 number = 10;
|
||||
int64 unit_price = 11 [json_name = "unit_price"];
|
||||
int64 spec_id = 12 [json_name = "spec_id"];
|
||||
string product_identity = 13 [json_name = "product_identity"];
|
||||
int64 gas_types = 14 [json_name = "gas_types"];
|
||||
int64 total_price = 15 [json_name = "total_price"];
|
||||
}
|
||||
|
||||
// Social feed messages.
|
||||
message FeedPostListReply {
|
||||
repeated FeedPostItem list = 1;
|
||||
int64 cnt = 2;
|
||||
}
|
||||
|
||||
message FeedPostItem {
|
||||
string identity = 1;
|
||||
string content = 2;
|
||||
int64 feed_id = 3;
|
||||
string feed_identity = 4;
|
||||
bool is_open = 5;
|
||||
int64 cnt_unlike = 6;
|
||||
int64 cnt_comment = 7;
|
||||
int64 cnt_like = 8;
|
||||
repeated FeedAttachItem attachs = 9;
|
||||
repeated FeedTagItem tags = 10;
|
||||
}
|
||||
|
||||
message FeedAttachItem {
|
||||
string identity = 1;
|
||||
string attach_type = 2;
|
||||
string url = 3;
|
||||
}
|
||||
|
||||
message FeedTagItem {
|
||||
string key = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
// Social group messages.
|
||||
message GroupPostListReply {
|
||||
repeated GroupPostItem list = 1;
|
||||
int64 cnt = 2;
|
||||
}
|
||||
|
||||
message GroupPostItem {
|
||||
string identity = 1;
|
||||
string content = 2;
|
||||
int64 passport_id = 3;
|
||||
string passport_identity = 4;
|
||||
bool is_open = 5;
|
||||
int64 cnt_unlike = 6;
|
||||
int64 cnt_comment = 7;
|
||||
int64 cnt_like = 8;
|
||||
repeated GroupAttachItem attachs = 9;
|
||||
repeated GroupTagItem tags = 10;
|
||||
}
|
||||
|
||||
message GroupAttachItem {
|
||||
string identity = 1;
|
||||
string attach_type = 2;
|
||||
string url = 3;
|
||||
}
|
||||
|
||||
message GroupTagItem {
|
||||
string key = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
// Social relation messages.
|
||||
message RelationItem {
|
||||
string identity = 1;
|
||||
string nickname = 2;
|
||||
string remark_name = 3;
|
||||
int32 popular = 4;
|
||||
string avatar = 5;
|
||||
string birthday = 6;
|
||||
int32 sex = 7;
|
||||
int32 province = 8;
|
||||
int32 city = 9;
|
||||
int32 area = 10;
|
||||
string sign = 11;
|
||||
repeated string tags = 12;
|
||||
int32 foreign_status = 13;
|
||||
}
|
||||
|
||||
message FetchRelationItemReply {
|
||||
int64 total = 1;
|
||||
repeated RelationItem data = 2;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = "bsm/full/module/base/cms/pb;cms";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cms/proto/const.proto";
|
||||
|
||||
// 单页管理
|
||||
service Pages{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = "bsm/full/module/base/cms/pb;cms";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cms/proto/const.proto";
|
||||
|
||||
// 正文
|
||||
service Post{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = "bsm/full/module/base/cms/pb;cms";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cms/proto/const.proto";
|
||||
|
||||
// CMS - 站点
|
||||
service Site {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cms;
|
||||
option go_package = "bsm/full/module/base/cms/pb;cms";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cms/proto/const.proto";
|
||||
|
||||
// 标签
|
||||
service Tags {
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
filebeat.inputs:
|
||||
- type: log
|
||||
enabled: true
|
||||
# 开启json解析
|
||||
json.keys_under_root: true
|
||||
json.add_error_key: true
|
||||
# 日志文件路径
|
||||
paths:
|
||||
- ./logs/Cms/error.log
|
||||
- ./logs/Cms/slow.log
|
||||
|
||||
setup.template.settings:
|
||||
index.number_of_shards: 1
|
||||
|
||||
# 定义kafka topic field
|
||||
fields:
|
||||
log_topic: scf.pb.dev
|
||||
|
||||
# 输出到kafka
|
||||
output.kafka:
|
||||
hosts: ["127.0.0.1:9092"]
|
||||
topic: '%{[fields.log_topic]}'
|
||||
partition.round_robin:
|
||||
reachable_only: false
|
||||
required_acks: 1
|
||||
keep_alive: 10s
|
||||
|
||||
# ================================= Processors =================================
|
||||
processors:
|
||||
- decode_json_fields:
|
||||
fields: ['@timestamp','level','Cms','trace','span','duration']
|
||||
target: ""
|
||||
@@ -1,5 +0,0 @@
|
||||
#install
|
||||
go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||
|
||||
#run
|
||||
gosec -fmt=json -out=./test/lint/gosec.json ./...
|
||||
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "blocks.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "Category"
|
||||
},
|
||||
{
|
||||
"name": "Pages"
|
||||
},
|
||||
{
|
||||
"name": "Post"
|
||||
},
|
||||
{
|
||||
"name": "Site"
|
||||
},
|
||||
{
|
||||
"name": "Tags"
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user