refactor: localize protobuf definitions
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user