refactor: localize protobuf definitions
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// 创建群组
|
||||
func Create(ctx context.Context, in *pb.GroupItem) (reply *pb.StatusReply, err error) {
|
||||
func Create(ctx context.Context, in *pb.GroupItem) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,7 +54,7 @@ func Create(ctx context.Context, in *pb.GroupItem) (reply *pb.StatusReply, err e
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: record.Identity,
|
||||
Timeseq: time.Now().UnixNano(),
|
||||
}, nil
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// 解散群组
|
||||
func Disband(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func Disband(ctx context.Context, in *pb.IdentRequest) (reply *pb.DataStatusReply, err error) {
|
||||
// parse authorization meta.
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
@@ -25,7 +25,7 @@ func Disband(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, e
|
||||
|
||||
// TODO: add your logic code & delete this line.
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 修改群组信息
|
||||
func Modify(ctx context.Context, in *pb.GroupItem) (reply *pb.StatusReply, err error) {
|
||||
func Modify(ctx context.Context, in *pb.GroupItem) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -38,7 +38,7 @@ func Modify(ctx context.Context, in *pb.GroupItem) (reply *pb.StatusReply, err e
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// 申请加群
|
||||
func DoJoin(ctx context.Context, in *pb.DoJoinRequest) (reply *pb.StatusReply, err error) {
|
||||
func DoJoin(ctx context.Context, in *pb.DoJoinRequest) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,7 +54,7 @@ func DoJoin(ctx context.Context, in *pb.DoJoinRequest) (reply *pb.StatusReply, e
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: identity,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// 踢人
|
||||
func DoKick(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusReply, err error) {
|
||||
func DoKick(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -37,7 +37,7 @@ func DoKick(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusReply,
|
||||
//更新群组表数据统计
|
||||
models.UpsetGroupMemberTotal(in.GroupIdentity, "-")
|
||||
}
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// 退群
|
||||
func DoQuit(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusReply, err error) {
|
||||
func DoQuit(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -39,7 +39,7 @@ func DoQuit(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusReply,
|
||||
models.UpsetGroupMemberTotal(in.GroupIdentity, "-")
|
||||
|
||||
}
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 设置或取消管理员
|
||||
func DoSetManager(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusReply, err error) {
|
||||
func DoSetManager(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -39,7 +39,7 @@ func DoSetManager(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusR
|
||||
//取消管理员
|
||||
impl.DBService.Model(&models.GroupMember{}).Where("identity=?", in.Identity).UpdateColumn("role", ROLE_MEMBER)
|
||||
}
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 申请加群处理
|
||||
func JoinDoHandle(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusReply, err error) {
|
||||
func JoinDoHandle(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.DataStatusReply, err error) {
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -60,7 +60,7 @@ func JoinDoHandle(ctx context.Context, in *pb.GroupOPRequest) (reply *pb.StatusR
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: identity,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/social/group/internal/logic/basic"
|
||||
pb "bsm/full/module/social/group/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type BasicServer struct {
|
||||
@@ -31,16 +31,16 @@ func (s *BasicServer) Get(ctx context.Context, in *pb.IdentRequest) (*pb.GroupIt
|
||||
}
|
||||
|
||||
// 创建群组
|
||||
func (s *BasicServer) Create(ctx context.Context, in *pb.GroupItem) (*pb.StatusReply, error) {
|
||||
func (s *BasicServer) Create(ctx context.Context, in *pb.GroupItem) (*pb.DataStatusReply, error) {
|
||||
return basic.Create(ctx, in)
|
||||
}
|
||||
|
||||
// 修改群组信息
|
||||
func (s *BasicServer) Modify(ctx context.Context, in *pb.GroupItem) (*pb.StatusReply, error) {
|
||||
func (s *BasicServer) Modify(ctx context.Context, in *pb.GroupItem) (*pb.DataStatusReply, error) {
|
||||
return basic.Modify(ctx, in)
|
||||
}
|
||||
|
||||
// 解散群组
|
||||
func (s *BasicServer) Disband(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *BasicServer) Disband(ctx context.Context, in *pb.IdentRequest) (*pb.DataStatusReply, error) {
|
||||
return basic.Disband(ctx, in)
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/social/group/internal/logic/member"
|
||||
pb "bsm/full/module/social/group/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type MemberServer struct {
|
||||
@@ -21,7 +21,7 @@ func (s *MemberServer) Fetch(ctx context.Context, in *pb.IdentRequest) (*pb.Grou
|
||||
}
|
||||
|
||||
// 申请加群
|
||||
func (s *MemberServer) DoJoin(ctx context.Context, in *pb.DoJoinRequest) (*pb.StatusReply, error) {
|
||||
func (s *MemberServer) DoJoin(ctx context.Context, in *pb.DoJoinRequest) (*pb.DataStatusReply, error) {
|
||||
return member.DoJoin(ctx, in)
|
||||
}
|
||||
|
||||
@@ -31,21 +31,21 @@ func (s *MemberServer) JoinFetch(ctx context.Context, in *pb.Empty) (*pb.JoinFet
|
||||
}
|
||||
|
||||
// 申请加群处理
|
||||
func (s *MemberServer) JoinDoHandle(ctx context.Context, in *pb.GroupOPRequest) (*pb.StatusReply, error) {
|
||||
func (s *MemberServer) JoinDoHandle(ctx context.Context, in *pb.GroupOPRequest) (*pb.DataStatusReply, error) {
|
||||
return member.JoinDoHandle(ctx, in)
|
||||
}
|
||||
|
||||
// 设置或取消管理员
|
||||
func (s *MemberServer) DoSetManager(ctx context.Context, in *pb.GroupOPRequest) (*pb.StatusReply, error) {
|
||||
func (s *MemberServer) DoSetManager(ctx context.Context, in *pb.GroupOPRequest) (*pb.DataStatusReply, error) {
|
||||
return member.DoSetManager(ctx, in)
|
||||
}
|
||||
|
||||
// 踢人
|
||||
func (s *MemberServer) DoKick(ctx context.Context, in *pb.GroupOPRequest) (*pb.StatusReply, error) {
|
||||
func (s *MemberServer) DoKick(ctx context.Context, in *pb.GroupOPRequest) (*pb.DataStatusReply, error) {
|
||||
return member.DoKick(ctx, in)
|
||||
}
|
||||
|
||||
// 退群
|
||||
func (s *MemberServer) DoQuit(ctx context.Context, in *pb.GroupOPRequest) (*pb.StatusReply, error) {
|
||||
func (s *MemberServer) DoQuit(ctx context.Context, in *pb.GroupOPRequest) (*pb.DataStatusReply, error) {
|
||||
return member.DoQuit(ctx, in)
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
pb "bsm/full/module/social/group/pb"
|
||||
"context"
|
||||
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/reflection"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Grpc *grpc.Server
|
||||
Ctx context.Context
|
||||
Mux *gwRuntime.ServeMux
|
||||
Grpc *grpc.Server
|
||||
Ctx context.Context
|
||||
Mux *gwRuntime.ServeMux
|
||||
grpcConns map[string]*grpc.ClientConn // 连接池
|
||||
}
|
||||
|
||||
func New(addr string) *Server {
|
||||
srv := &Server{Ctx: context.Background(), Grpc: grpc.NewServer(), Mux: gwRuntime.NewServeMux(
|
||||
gwRuntime.WithForwardResponseRewriter(responseEnvelope),
|
||||
)}
|
||||
srv := &Server{
|
||||
Ctx: context.Background(),
|
||||
Grpc: grpc.NewServer(),
|
||||
grpcConns: make(map[string]*grpc.ClientConn),
|
||||
}
|
||||
|
||||
// register service to grpc.Server
|
||||
pb.RegisterBasicServer(srv.Grpc, NewBasicServer())
|
||||
@@ -31,43 +30,5 @@ func New(addr string) *Server {
|
||||
|
||||
reflection.Register(srv.Grpc)
|
||||
|
||||
// 将服务注册到Gateway
|
||||
opts := []grpc.DialOption{grpc.WithInsecure()}
|
||||
pb.RegisterBasicHandlerFromEndpoint(srv.Ctx, srv.Mux, addr, opts)
|
||||
pb.RegisterMemberHandlerFromEndpoint(srv.Ctx, srv.Mux, addr, opts)
|
||||
|
||||
// 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": "OK",
|
||||
"result": response,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
package group
|
||||
|
||||
import blocks "bsm/full/protobuf"
|
||||
|
||||
type Empty = blocks.Empty
|
||||
type FetchRequest = blocks.FetchRequest
|
||||
type IdentRequest = blocks.IdentRequest
|
||||
type VersionRequest = blocks.VersionRequest
|
||||
type SearchRequest = blocks.SearchRequest
|
||||
type StatusReply = blocks.DataStatusReply
|
||||
type PostListReply = blocks.GroupPostListReply
|
||||
type PostItem = blocks.GroupPostItem
|
||||
type AttachItem = blocks.GroupAttachItem
|
||||
type TagItem = blocks.GroupTagItem
|
||||
type PostListReply = GroupPostListReply
|
||||
type PostItem = GroupPostItem
|
||||
type AttachItem = GroupAttachItem
|
||||
type TagItem = GroupTagItem
|
||||
|
||||
3368
module/social/group/pb/const.pb.go
Normal file
3368
module/social/group/pb/const.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,6 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -258,7 +257,7 @@ var File_module_social_group_proto_group_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_social_group_proto_group_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"%module/social/group/proto/group.proto\x12\x05group\x1a\x15protobuf/blocks.proto\"\x94\x04\n" +
|
||||
"%module/social/group/proto/group.proto\x12\x05group\x1a%module/social/group/proto/const.proto\"\x94\x04\n" +
|
||||
"\tGroupItem\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||
"\bidentity\x18\x02 \x01(\tR\bidentity\x12\x16\n" +
|
||||
@@ -308,12 +307,12 @@ func file_module_social_group_proto_group_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_social_group_proto_group_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_module_social_group_proto_group_proto_goTypes = []any{
|
||||
(*GroupItem)(nil), // 0: group.GroupItem
|
||||
(*GroupsReply)(nil), // 1: group.GroupsReply
|
||||
(*protobuf.SearchRequest)(nil), // 2: blocks.SearchRequest
|
||||
(*protobuf.Empty)(nil), // 3: blocks.Empty
|
||||
(*protobuf.IdentRequest)(nil), // 4: blocks.IdentRequest
|
||||
(*protobuf.DataStatusReply)(nil), // 5: blocks.DataStatusReply
|
||||
(*GroupItem)(nil), // 0: group.GroupItem
|
||||
(*GroupsReply)(nil), // 1: group.GroupsReply
|
||||
(*SearchRequest)(nil), // 2: blocks.SearchRequest
|
||||
(*Empty)(nil), // 3: blocks.Empty
|
||||
(*IdentRequest)(nil), // 4: blocks.IdentRequest
|
||||
(*DataStatusReply)(nil), // 5: blocks.DataStatusReply
|
||||
}
|
||||
var file_module_social_group_proto_group_proto_depIdxs = []int32{
|
||||
0, // 0: group.GroupsReply.groups:type_name -> group.GroupItem
|
||||
@@ -341,6 +340,7 @@ func file_module_social_group_proto_group_proto_init() {
|
||||
if File_module_social_group_proto_group_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_social_group_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 group
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -38,7 +37,7 @@ var (
|
||||
|
||||
func request_Basic_Search_0(ctx context.Context, marshaler runtime.Marshaler, client BasicClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.SearchRequest
|
||||
protoReq SearchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -53,7 +52,7 @@ func request_Basic_Search_0(ctx context.Context, marshaler runtime.Marshaler, cl
|
||||
|
||||
func local_request_Basic_Search_0(ctx context.Context, marshaler runtime.Marshaler, server BasicServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.SearchRequest
|
||||
protoReq SearchRequest
|
||||
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_Basic_Search_0(ctx context.Context, marshaler runtime.Marshal
|
||||
|
||||
func request_Basic_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client BasicClient, 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) {
|
||||
@@ -80,7 +79,7 @@ func request_Basic_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Basic_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server BasicServer, 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) {
|
||||
@@ -92,7 +91,7 @@ func local_request_Basic_Fetch_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func request_Basic_Get_0(ctx context.Context, marshaler runtime.Marshaler, client BasicClient, 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) {
|
||||
@@ -107,7 +106,7 @@ func request_Basic_Get_0(ctx context.Context, marshaler runtime.Marshaler, clien
|
||||
|
||||
func local_request_Basic_Get_0(ctx context.Context, marshaler runtime.Marshaler, server BasicServer, 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) {
|
||||
@@ -173,7 +172,7 @@ func local_request_Basic_Modify_0(ctx context.Context, marshaler runtime.Marshal
|
||||
|
||||
func request_Basic_Disband_0(ctx context.Context, marshaler runtime.Marshaler, client BasicClient, 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_Basic_Disband_0(ctx context.Context, marshaler runtime.Marshaler, c
|
||||
|
||||
func local_request_Basic_Disband_0(ctx context.Context, marshaler runtime.Marshaler, server BasicServer, 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 group
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -35,17 +34,17 @@ const (
|
||||
// 群组
|
||||
type BasicClient interface {
|
||||
// 搜索
|
||||
Search(ctx context.Context, in *protobuf.SearchRequest, opts ...grpc.CallOption) (*GroupsReply, error)
|
||||
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*GroupsReply, error)
|
||||
// 获取群组列表
|
||||
Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*GroupsReply, error)
|
||||
Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GroupsReply, error)
|
||||
// 获取群组信息
|
||||
Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*GroupItem, error)
|
||||
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*GroupItem, error)
|
||||
// 创建群组
|
||||
Create(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
Create(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
// 修改群组信息
|
||||
Modify(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
Modify(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
// 解散群组
|
||||
Disband(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
Disband(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
}
|
||||
|
||||
type basicClient struct {
|
||||
@@ -56,7 +55,7 @@ func NewBasicClient(cc grpc.ClientConnInterface) BasicClient {
|
||||
return &basicClient{cc}
|
||||
}
|
||||
|
||||
func (c *basicClient) Search(ctx context.Context, in *protobuf.SearchRequest, opts ...grpc.CallOption) (*GroupsReply, error) {
|
||||
func (c *basicClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*GroupsReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GroupsReply)
|
||||
err := c.cc.Invoke(ctx, Basic_Search_FullMethodName, in, out, cOpts...)
|
||||
@@ -66,7 +65,7 @@ func (c *basicClient) Search(ctx context.Context, in *protobuf.SearchRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *basicClient) Fetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*GroupsReply, error) {
|
||||
func (c *basicClient) Fetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GroupsReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GroupsReply)
|
||||
err := c.cc.Invoke(ctx, Basic_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -76,7 +75,7 @@ func (c *basicClient) Fetch(ctx context.Context, in *protobuf.Empty, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *basicClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*GroupItem, error) {
|
||||
func (c *basicClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*GroupItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GroupItem)
|
||||
err := c.cc.Invoke(ctx, Basic_Get_FullMethodName, in, out, cOpts...)
|
||||
@@ -86,9 +85,9 @@ func (c *basicClient) Get(ctx context.Context, in *protobuf.IdentRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *basicClient) Create(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *basicClient) Create(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Basic_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -96,9 +95,9 @@ func (c *basicClient) Create(ctx context.Context, in *GroupItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *basicClient) Modify(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *basicClient) Modify(ctx context.Context, in *GroupItem, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Basic_Modify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -106,9 +105,9 @@ func (c *basicClient) Modify(ctx context.Context, in *GroupItem, opts ...grpc.Ca
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *basicClient) Disband(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *basicClient) Disband(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Basic_Disband_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -123,17 +122,17 @@ func (c *basicClient) Disband(ctx context.Context, in *protobuf.IdentRequest, op
|
||||
// 群组
|
||||
type BasicServer interface {
|
||||
// 搜索
|
||||
Search(context.Context, *protobuf.SearchRequest) (*GroupsReply, error)
|
||||
Search(context.Context, *SearchRequest) (*GroupsReply, error)
|
||||
// 获取群组列表
|
||||
Fetch(context.Context, *protobuf.Empty) (*GroupsReply, error)
|
||||
Fetch(context.Context, *Empty) (*GroupsReply, error)
|
||||
// 获取群组信息
|
||||
Get(context.Context, *protobuf.IdentRequest) (*GroupItem, error)
|
||||
Get(context.Context, *IdentRequest) (*GroupItem, error)
|
||||
// 创建群组
|
||||
Create(context.Context, *GroupItem) (*protobuf.DataStatusReply, error)
|
||||
Create(context.Context, *GroupItem) (*DataStatusReply, error)
|
||||
// 修改群组信息
|
||||
Modify(context.Context, *GroupItem) (*protobuf.DataStatusReply, error)
|
||||
Modify(context.Context, *GroupItem) (*DataStatusReply, error)
|
||||
// 解散群组
|
||||
Disband(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error)
|
||||
Disband(context.Context, *IdentRequest) (*DataStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedBasicServer should be embedded to have
|
||||
@@ -143,22 +142,22 @@ type BasicServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedBasicServer struct{}
|
||||
|
||||
func (UnimplementedBasicServer) Search(context.Context, *protobuf.SearchRequest) (*GroupsReply, error) {
|
||||
func (UnimplementedBasicServer) Search(context.Context, *SearchRequest) (*GroupsReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Search not implemented")
|
||||
}
|
||||
func (UnimplementedBasicServer) Fetch(context.Context, *protobuf.Empty) (*GroupsReply, error) {
|
||||
func (UnimplementedBasicServer) Fetch(context.Context, *Empty) (*GroupsReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedBasicServer) Get(context.Context, *protobuf.IdentRequest) (*GroupItem, error) {
|
||||
func (UnimplementedBasicServer) Get(context.Context, *IdentRequest) (*GroupItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedBasicServer) Create(context.Context, *GroupItem) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedBasicServer) Create(context.Context, *GroupItem) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedBasicServer) Modify(context.Context, *GroupItem) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedBasicServer) Modify(context.Context, *GroupItem) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
|
||||
}
|
||||
func (UnimplementedBasicServer) Disband(context.Context, *protobuf.IdentRequest) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedBasicServer) Disband(context.Context, *IdentRequest) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Disband not implemented")
|
||||
}
|
||||
func (UnimplementedBasicServer) testEmbeddedByValue() {}
|
||||
@@ -182,7 +181,7 @@ func RegisterBasicServer(s grpc.ServiceRegistrar, srv BasicServer) {
|
||||
}
|
||||
|
||||
func _Basic_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.SearchRequest)
|
||||
in := new(SearchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -194,13 +193,13 @@ func _Basic_Search_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Basic_Search_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BasicServer).Search(ctx, req.(*protobuf.SearchRequest))
|
||||
return srv.(BasicServer).Search(ctx, req.(*SearchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Basic_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
|
||||
}
|
||||
@@ -212,13 +211,13 @@ func _Basic_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Basic_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BasicServer).Fetch(ctx, req.(*protobuf.Empty))
|
||||
return srv.(BasicServer).Fetch(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Basic_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
|
||||
}
|
||||
@@ -230,7 +229,7 @@ func _Basic_Get_Handler(srv interface{}, ctx context.Context, dec func(interface
|
||||
FullMethod: Basic_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BasicServer).Get(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(BasicServer).Get(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -272,7 +271,7 @@ func _Basic_Modify_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
|
||||
func _Basic_Disband_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 _Basic_Disband_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
FullMethod: Basic_Disband_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BasicServer).Disband(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(BasicServer).Disband(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -566,7 +565,7 @@ var File_module_social_group_proto_member_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_social_group_proto_member_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"&module/social/group/proto/member.proto\x12\x05group\x1a\x15protobuf/blocks.proto\"\xaf\x01\n" +
|
||||
"&module/social/group/proto/member.proto\x12\x05group\x1a%module/social/group/proto/const.proto\"\xaf\x01\n" +
|
||||
"\x16PassportInfoSimpleCard\x12\x1a\n" +
|
||||
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\x1a\n" +
|
||||
"\bnickname\x18\x02 \x01(\tR\bnickname\x12\x1f\n" +
|
||||
@@ -637,16 +636,16 @@ func file_module_social_group_proto_member_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_social_group_proto_member_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_module_social_group_proto_member_proto_goTypes = []any{
|
||||
(*PassportInfoSimpleCard)(nil), // 0: group.PassportInfoSimpleCard
|
||||
(*PassportInfoDetailCard)(nil), // 1: group.PassportInfoDetailCard
|
||||
(*GroupMemberReply)(nil), // 2: group.GroupMemberReply
|
||||
(*DoJoinRequest)(nil), // 3: group.DoJoinRequest
|
||||
(*JoinFetchReply)(nil), // 4: group.JoinFetchReply
|
||||
(*ApplyJoinGroupItem)(nil), // 5: group.ApplyJoinGroupItem
|
||||
(*GroupOPRequest)(nil), // 6: group.GroupOPRequest
|
||||
(*protobuf.IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*protobuf.Empty)(nil), // 8: blocks.Empty
|
||||
(*protobuf.DataStatusReply)(nil), // 9: blocks.DataStatusReply
|
||||
(*PassportInfoSimpleCard)(nil), // 0: group.PassportInfoSimpleCard
|
||||
(*PassportInfoDetailCard)(nil), // 1: group.PassportInfoDetailCard
|
||||
(*GroupMemberReply)(nil), // 2: group.GroupMemberReply
|
||||
(*DoJoinRequest)(nil), // 3: group.DoJoinRequest
|
||||
(*JoinFetchReply)(nil), // 4: group.JoinFetchReply
|
||||
(*ApplyJoinGroupItem)(nil), // 5: group.ApplyJoinGroupItem
|
||||
(*GroupOPRequest)(nil), // 6: group.GroupOPRequest
|
||||
(*IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*Empty)(nil), // 8: blocks.Empty
|
||||
(*DataStatusReply)(nil), // 9: blocks.DataStatusReply
|
||||
}
|
||||
var file_module_social_group_proto_member_proto_depIdxs = []int32{
|
||||
0, // 0: group.GroupMemberReply.members:type_name -> group.PassportInfoSimpleCard
|
||||
@@ -678,6 +677,7 @@ func file_module_social_group_proto_member_proto_init() {
|
||||
if File_module_social_group_proto_member_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_social_group_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 group
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -38,7 +37,7 @@ var (
|
||||
|
||||
func request_Member_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client MemberClient, 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_Member_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, cl
|
||||
|
||||
func local_request_Member_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server MemberServer, 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) {
|
||||
@@ -92,7 +91,7 @@ func local_request_Member_DoJoin_0(ctx context.Context, marshaler runtime.Marsha
|
||||
|
||||
func request_Member_JoinFetch_0(ctx context.Context, marshaler runtime.Marshaler, client MemberClient, 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) {
|
||||
@@ -107,7 +106,7 @@ func request_Member_JoinFetch_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func local_request_Member_JoinFetch_0(ctx context.Context, marshaler runtime.Marshaler, server MemberServer, 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) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -36,19 +35,19 @@ const (
|
||||
// relation-关系管理:群组
|
||||
type MemberClient interface {
|
||||
// 获取群组成员列表
|
||||
Fetch(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*GroupMemberReply, error)
|
||||
Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*GroupMemberReply, error)
|
||||
// 申请加群
|
||||
DoJoin(ctx context.Context, in *DoJoinRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
DoJoin(ctx context.Context, in *DoJoinRequest, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
// 申请加群列表
|
||||
JoinFetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*JoinFetchReply, error)
|
||||
JoinFetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*JoinFetchReply, error)
|
||||
// 申请加群处理
|
||||
JoinDoHandle(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
JoinDoHandle(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
// 设置或取消管理员
|
||||
DoSetManager(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
DoSetManager(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
// 踢人
|
||||
DoKick(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
DoKick(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
// 退群
|
||||
DoQuit(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
|
||||
DoQuit(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error)
|
||||
}
|
||||
|
||||
type memberClient struct {
|
||||
@@ -59,7 +58,7 @@ func NewMemberClient(cc grpc.ClientConnInterface) MemberClient {
|
||||
return &memberClient{cc}
|
||||
}
|
||||
|
||||
func (c *memberClient) Fetch(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*GroupMemberReply, error) {
|
||||
func (c *memberClient) Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*GroupMemberReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GroupMemberReply)
|
||||
err := c.cc.Invoke(ctx, Member_Fetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -69,9 +68,9 @@ func (c *memberClient) Fetch(ctx context.Context, in *protobuf.IdentRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memberClient) DoJoin(ctx context.Context, in *DoJoinRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *memberClient) DoJoin(ctx context.Context, in *DoJoinRequest, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Member_DoJoin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -79,7 +78,7 @@ func (c *memberClient) DoJoin(ctx context.Context, in *DoJoinRequest, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memberClient) JoinFetch(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*JoinFetchReply, error) {
|
||||
func (c *memberClient) JoinFetch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*JoinFetchReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(JoinFetchReply)
|
||||
err := c.cc.Invoke(ctx, Member_JoinFetch_FullMethodName, in, out, cOpts...)
|
||||
@@ -89,9 +88,9 @@ func (c *memberClient) JoinFetch(ctx context.Context, in *protobuf.Empty, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memberClient) JoinDoHandle(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *memberClient) JoinDoHandle(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Member_JoinDoHandle_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -99,9 +98,9 @@ func (c *memberClient) JoinDoHandle(ctx context.Context, in *GroupOPRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memberClient) DoSetManager(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *memberClient) DoSetManager(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Member_DoSetManager_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -109,9 +108,9 @@ func (c *memberClient) DoSetManager(ctx context.Context, in *GroupOPRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memberClient) DoKick(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *memberClient) DoKick(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Member_DoKick_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -119,9 +118,9 @@ func (c *memberClient) DoKick(ctx context.Context, in *GroupOPRequest, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memberClient) DoQuit(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
|
||||
func (c *memberClient) DoQuit(ctx context.Context, in *GroupOPRequest, opts ...grpc.CallOption) (*DataStatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.DataStatusReply)
|
||||
out := new(DataStatusReply)
|
||||
err := c.cc.Invoke(ctx, Member_DoQuit_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -136,19 +135,19 @@ func (c *memberClient) DoQuit(ctx context.Context, in *GroupOPRequest, opts ...g
|
||||
// relation-关系管理:群组
|
||||
type MemberServer interface {
|
||||
// 获取群组成员列表
|
||||
Fetch(context.Context, *protobuf.IdentRequest) (*GroupMemberReply, error)
|
||||
Fetch(context.Context, *IdentRequest) (*GroupMemberReply, error)
|
||||
// 申请加群
|
||||
DoJoin(context.Context, *DoJoinRequest) (*protobuf.DataStatusReply, error)
|
||||
DoJoin(context.Context, *DoJoinRequest) (*DataStatusReply, error)
|
||||
// 申请加群列表
|
||||
JoinFetch(context.Context, *protobuf.Empty) (*JoinFetchReply, error)
|
||||
JoinFetch(context.Context, *Empty) (*JoinFetchReply, error)
|
||||
// 申请加群处理
|
||||
JoinDoHandle(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error)
|
||||
JoinDoHandle(context.Context, *GroupOPRequest) (*DataStatusReply, error)
|
||||
// 设置或取消管理员
|
||||
DoSetManager(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error)
|
||||
DoSetManager(context.Context, *GroupOPRequest) (*DataStatusReply, error)
|
||||
// 踢人
|
||||
DoKick(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error)
|
||||
DoKick(context.Context, *GroupOPRequest) (*DataStatusReply, error)
|
||||
// 退群
|
||||
DoQuit(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error)
|
||||
DoQuit(context.Context, *GroupOPRequest) (*DataStatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedMemberServer should be embedded to have
|
||||
@@ -158,25 +157,25 @@ type MemberServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedMemberServer struct{}
|
||||
|
||||
func (UnimplementedMemberServer) Fetch(context.Context, *protobuf.IdentRequest) (*GroupMemberReply, error) {
|
||||
func (UnimplementedMemberServer) Fetch(context.Context, *IdentRequest) (*GroupMemberReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) DoJoin(context.Context, *DoJoinRequest) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedMemberServer) DoJoin(context.Context, *DoJoinRequest) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DoJoin not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) JoinFetch(context.Context, *protobuf.Empty) (*JoinFetchReply, error) {
|
||||
func (UnimplementedMemberServer) JoinFetch(context.Context, *Empty) (*JoinFetchReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method JoinFetch not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) JoinDoHandle(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedMemberServer) JoinDoHandle(context.Context, *GroupOPRequest) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method JoinDoHandle not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) DoSetManager(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedMemberServer) DoSetManager(context.Context, *GroupOPRequest) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DoSetManager not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) DoKick(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedMemberServer) DoKick(context.Context, *GroupOPRequest) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DoKick not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) DoQuit(context.Context, *GroupOPRequest) (*protobuf.DataStatusReply, error) {
|
||||
func (UnimplementedMemberServer) DoQuit(context.Context, *GroupOPRequest) (*DataStatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DoQuit not implemented")
|
||||
}
|
||||
func (UnimplementedMemberServer) testEmbeddedByValue() {}
|
||||
@@ -200,7 +199,7 @@ func RegisterMemberServer(s grpc.ServiceRegistrar, srv MemberServer) {
|
||||
}
|
||||
|
||||
func _Member_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
|
||||
}
|
||||
@@ -212,7 +211,7 @@ func _Member_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Member_Fetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemberServer).Fetch(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(MemberServer).Fetch(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -236,7 +235,7 @@ func _Member_DoJoin_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
}
|
||||
|
||||
func _Member_JoinFetch_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
|
||||
}
|
||||
@@ -248,7 +247,7 @@ func _Member_JoinFetch_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Member_JoinFetch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemberServer).JoinFetch(ctx, req.(*protobuf.Empty))
|
||||
return srv.(MemberServer).JoinFetch(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
326
module/social/group/proto/const.proto
Normal file
326
module/social/group/proto/const.proto
Normal file
@@ -0,0 +1,326 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package blocks;
|
||||
|
||||
option go_package = "bsm/full/module/social/group/pb;group";
|
||||
|
||||
// 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 group;
|
||||
option go_package = "bsm/full/module/social/group/pb;group";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/social/group/proto/const.proto";
|
||||
|
||||
// 群组
|
||||
service Basic{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package group;
|
||||
option go_package = "bsm/full/module/social/group/pb;group";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/social/group/proto/const.proto";
|
||||
|
||||
// relation-关系管理:群组
|
||||
service Member{
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
filebeat.inputs:
|
||||
- type: log
|
||||
enabled: true
|
||||
# 开启json解析
|
||||
json.keys_under_root: true
|
||||
json.add_error_key: true
|
||||
# 日志文件路径
|
||||
paths:
|
||||
- ./logs/group/error.log
|
||||
- ./logs/group/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','content','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,336 +0,0 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "blocks.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "Basic"
|
||||
},
|
||||
{
|
||||
"name": "Member"
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"groupApplyJoinGroupItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identity": {
|
||||
"type": "string",
|
||||
"title": "唯一标识"
|
||||
},
|
||||
"groupId": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "主键"
|
||||
},
|
||||
"from": {
|
||||
"$ref": "#/definitions/groupPassportInfoDetailCard"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"title": "时间"
|
||||
},
|
||||
"status": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "状态"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupGroupItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "主键"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string",
|
||||
"title": "唯一标识"
|
||||
},
|
||||
"number": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "群组编号"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string",
|
||||
"title": "群组头像"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "群组名称"
|
||||
},
|
||||
"introduce": {
|
||||
"type": "string",
|
||||
"title": "群组简介"
|
||||
},
|
||||
"creatorId": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "创建者ID"
|
||||
},
|
||||
"cretorIdentity": {
|
||||
"type": "string",
|
||||
"title": "创建者Identity"
|
||||
},
|
||||
"memberLimit": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "最大成员数,0代表不限制"
|
||||
},
|
||||
"master": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": "管理员"
|
||||
},
|
||||
"notice": {
|
||||
"type": "string",
|
||||
"title": "群组公告"
|
||||
},
|
||||
"background": {
|
||||
"type": "string",
|
||||
"title": "群组背景"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": "群组标签"
|
||||
},
|
||||
"memberTotal": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "群组成员数"
|
||||
},
|
||||
"enableSearchByNumber": {
|
||||
"type": "boolean",
|
||||
"title": "是否开启群号搜索"
|
||||
},
|
||||
"enableSearchByName": {
|
||||
"type": "boolean",
|
||||
"title": "是否开启群名搜索"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"title": "群组创建时间"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupGroupMemberReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "总记录数"
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "版本号"
|
||||
},
|
||||
"members": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/groupPassportInfoSimpleCard"
|
||||
},
|
||||
"title": "成员信息"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupGroupsReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "总记录数"
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "版本号"
|
||||
},
|
||||
"groups": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/groupGroupItem"
|
||||
},
|
||||
"title": "群组信息"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupJoinFetchReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "总记录数"
|
||||
},
|
||||
"applys": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/groupApplyJoinGroupItem"
|
||||
},
|
||||
"title": "群组信息"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupPassportInfoDetailCard": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string",
|
||||
"title": "昵称"
|
||||
},
|
||||
"remarkName": {
|
||||
"type": "string",
|
||||
"title": "备注名称"
|
||||
},
|
||||
"popular": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "是否置顶"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"birthday": {
|
||||
"type": "string",
|
||||
"title": "生日"
|
||||
},
|
||||
"sex": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "性别,1为男性,2为女性"
|
||||
},
|
||||
"province": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "省"
|
||||
},
|
||||
"city": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "市"
|
||||
},
|
||||
"area": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "区"
|
||||
},
|
||||
"sign": {
|
||||
"type": "string",
|
||||
"title": "签名"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": "所属标签组"
|
||||
},
|
||||
"foreignStatus": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "外表的状态值,根据表不同,值的作用不同"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupPassportInfoSimpleCard": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string",
|
||||
"title": "昵称"
|
||||
},
|
||||
"remarkName": {
|
||||
"type": "string",
|
||||
"title": "备注名称"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"sex": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "性别,1为男性,2为女性"
|
||||
},
|
||||
"role": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "角色,主要是群组内的角色使用"
|
||||
}
|
||||
}
|
||||
},
|
||||
"groupStatusReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "string",
|
||||
"title": "数据"
|
||||
},
|
||||
"timeseq": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "响应时间序列"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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