fix: wecom types agent
CI / changes (push) Successful in 12s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 3s
CI / chore (push) Successful in 0s
CI / express (push) Successful in 0s
CI / product (push) Successful in 1s
CI / sale (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 31s

This commit is contained in:
zzw
2026-08-31 14:22:46 +08:00
parent 90a195c9ca
commit 1d41d7ca7e
15 changed files with 349 additions and 48 deletions
+84 -39
View File
@@ -82,20 +82,56 @@ func (x *Response) GetData() string {
return ""
}
type EmptyReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *EmptyReq) Reset() {
*x = EmptyReq{}
mi := &file_wecom_wecom_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EmptyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EmptyReq) ProtoMessage() {}
func (x *EmptyReq) ProtoReflect() protoreflect.Message {
mi := &file_wecom_wecom_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EmptyReq.ProtoReflect.Descriptor instead.
func (*EmptyReq) Descriptor() ([]byte, []int) {
return file_wecom_wecom_proto_rawDescGZIP(), []int{1}
}
type ItemsUserReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page uint32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Type uint32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` // 1: 管理员,2: 销售
Status uint32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` // 1: 启用,2: 禁用
Type uint32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"`
Status uint32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ItemsUserReq) Reset() {
*x = ItemsUserReq{}
mi := &file_wecom_wecom_proto_msgTypes[1]
mi := &file_wecom_wecom_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -107,7 +143,7 @@ func (x *ItemsUserReq) String() string {
func (*ItemsUserReq) ProtoMessage() {}
func (x *ItemsUserReq) ProtoReflect() protoreflect.Message {
mi := &file_wecom_wecom_proto_msgTypes[1]
mi := &file_wecom_wecom_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -120,7 +156,7 @@ func (x *ItemsUserReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use ItemsUserReq.ProtoReflect.Descriptor instead.
func (*ItemsUserReq) Descriptor() ([]byte, []int) {
return file_wecom_wecom_proto_rawDescGZIP(), []int{1}
return file_wecom_wecom_proto_rawDescGZIP(), []int{2}
}
func (x *ItemsUserReq) GetPage() uint32 {
@@ -172,7 +208,7 @@ type CreateUserReq struct {
func (x *CreateUserReq) Reset() {
*x = CreateUserReq{}
mi := &file_wecom_wecom_proto_msgTypes[2]
mi := &file_wecom_wecom_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -184,7 +220,7 @@ func (x *CreateUserReq) String() string {
func (*CreateUserReq) ProtoMessage() {}
func (x *CreateUserReq) ProtoReflect() protoreflect.Message {
mi := &file_wecom_wecom_proto_msgTypes[2]
mi := &file_wecom_wecom_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -197,7 +233,7 @@ func (x *CreateUserReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateUserReq.ProtoReflect.Descriptor instead.
func (*CreateUserReq) Descriptor() ([]byte, []int) {
return file_wecom_wecom_proto_rawDescGZIP(), []int{2}
return file_wecom_wecom_proto_rawDescGZIP(), []int{3}
}
func (x *CreateUserReq) GetUserId() int64 {
@@ -257,7 +293,7 @@ type UpdateUserReq struct {
func (x *UpdateUserReq) Reset() {
*x = UpdateUserReq{}
mi := &file_wecom_wecom_proto_msgTypes[3]
mi := &file_wecom_wecom_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -269,7 +305,7 @@ func (x *UpdateUserReq) String() string {
func (*UpdateUserReq) ProtoMessage() {}
func (x *UpdateUserReq) ProtoReflect() protoreflect.Message {
mi := &file_wecom_wecom_proto_msgTypes[3]
mi := &file_wecom_wecom_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -282,7 +318,7 @@ func (x *UpdateUserReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateUserReq.ProtoReflect.Descriptor instead.
func (*UpdateUserReq) Descriptor() ([]byte, []int) {
return file_wecom_wecom_proto_rawDescGZIP(), []int{3}
return file_wecom_wecom_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateUserReq) GetId() int64 {
@@ -344,7 +380,7 @@ type StatusUserReq struct {
func (x *StatusUserReq) Reset() {
*x = StatusUserReq{}
mi := &file_wecom_wecom_proto_msgTypes[4]
mi := &file_wecom_wecom_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -356,7 +392,7 @@ func (x *StatusUserReq) String() string {
func (*StatusUserReq) ProtoMessage() {}
func (x *StatusUserReq) ProtoReflect() protoreflect.Message {
mi := &file_wecom_wecom_proto_msgTypes[4]
mi := &file_wecom_wecom_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -369,7 +405,7 @@ func (x *StatusUserReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatusUserReq.ProtoReflect.Descriptor instead.
func (*StatusUserReq) Descriptor() ([]byte, []int) {
return file_wecom_wecom_proto_rawDescGZIP(), []int{4}
return file_wecom_wecom_proto_rawDescGZIP(), []int{5}
}
func (x *StatusUserReq) GetId() int64 {
@@ -395,7 +431,7 @@ type DeleteUserReq struct {
func (x *DeleteUserReq) Reset() {
*x = DeleteUserReq{}
mi := &file_wecom_wecom_proto_msgTypes[5]
mi := &file_wecom_wecom_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -407,7 +443,7 @@ func (x *DeleteUserReq) String() string {
func (*DeleteUserReq) ProtoMessage() {}
func (x *DeleteUserReq) ProtoReflect() protoreflect.Message {
mi := &file_wecom_wecom_proto_msgTypes[5]
mi := &file_wecom_wecom_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -420,7 +456,7 @@ func (x *DeleteUserReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteUserReq.ProtoReflect.Descriptor instead.
func (*DeleteUserReq) Descriptor() ([]byte, []int) {
return file_wecom_wecom_proto_rawDescGZIP(), []int{5}
return file_wecom_wecom_proto_rawDescGZIP(), []int{6}
}
func (x *DeleteUserReq) GetId() int64 {
@@ -438,7 +474,9 @@ const file_wecom_wecom_proto_rawDesc = "" +
"\bResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" +
"\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" +
"\x04data\x18\x03 \x01(\tR\x04data\"\x7f\n" +
"\x04data\x18\x03 \x01(\tR\x04data\"\n" +
"\n" +
"\bEmptyReq\"\x7f\n" +
"\fItemsUserReq\x12\x12\n" +
"\x04page\x18\x01 \x01(\rR\x04page\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\rR\bpageSize\x12\x12\n" +
@@ -464,7 +502,7 @@ const file_wecom_wecom_proto_rawDesc = "" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" +
"\x06status\x18\x02 \x01(\rR\x06status\"\x1f\n" +
"\rDeleteUserReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id2\xc2\x03\n" +
"\x02id\x18\x01 \x01(\x03R\x02id2\xe2\x04\n" +
"\x05Wecom\x12S\n" +
"\n" +
"ItemsUsers\x12\x13.wecom.ItemsUserReq\x1a\x0f.wecom.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/wecom/user\x12T\n" +
@@ -475,7 +513,9 @@ const file_wecom_wecom_proto_rawDesc = "" +
"\n" +
"StatusUser\x12\x14.wecom.StatusUserReq\x1a\x0f.wecom.Response\"&\x82\xd3\xe4\x93\x02 :\x01*\x1a\x1b/admin/v3/wecom/user/status\x12[\n" +
"\n" +
"DeleteUser\x12\x14.wecom.DeleteUserReq\x1a\x0f.wecom.Response\"&\x82\xd3\xe4\x93\x02 :\x01*\x1a\x1b/admin/v3/wecom/user/deleteB\x19Z\x17lone-services/rpc/wecomb\x06proto3"
"DeleteUser\x12\x14.wecom.DeleteUserReq\x1a\x0f.wecom.Response\"&\x82\xd3\xe4\x93\x02 :\x01*\x1a\x1b/admin/v3/wecom/user/delete\x12Q\n" +
"\vItemsAgents\x12\x0f.wecom.EmptyReq\x1a\x0f.wecom.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/wecom/agent\x12K\n" +
"\x05Types\x12\x0f.wecom.EmptyReq\x1a\x0f.wecom.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\x12\x15/admin/v3/wecom/typesB\x19Z\x17lone-services/rpc/wecomb\x06proto3"
var (
file_wecom_wecom_proto_rawDescOnce sync.Once
@@ -489,28 +529,33 @@ func file_wecom_wecom_proto_rawDescGZIP() []byte {
return file_wecom_wecom_proto_rawDescData
}
var file_wecom_wecom_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_wecom_wecom_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_wecom_wecom_proto_goTypes = []any{
(*Response)(nil), // 0: wecom.Response
(*ItemsUserReq)(nil), // 1: wecom.ItemsUserReq
(*CreateUserReq)(nil), // 2: wecom.CreateUserReq
(*UpdateUserReq)(nil), // 3: wecom.UpdateUserReq
(*StatusUserReq)(nil), // 4: wecom.StatusUserReq
(*DeleteUserReq)(nil), // 5: wecom.DeleteUserReq
(*EmptyReq)(nil), // 1: wecom.EmptyReq
(*ItemsUserReq)(nil), // 2: wecom.ItemsUserReq
(*CreateUserReq)(nil), // 3: wecom.CreateUserReq
(*UpdateUserReq)(nil), // 4: wecom.UpdateUserReq
(*StatusUserReq)(nil), // 5: wecom.StatusUserReq
(*DeleteUserReq)(nil), // 6: wecom.DeleteUserReq
}
var file_wecom_wecom_proto_depIdxs = []int32{
1, // 0: wecom.Wecom.ItemsUsers:input_type -> wecom.ItemsUserReq
2, // 1: wecom.Wecom.CreateUser:input_type -> wecom.CreateUserReq
3, // 2: wecom.Wecom.UpdateUser:input_type -> wecom.UpdateUserReq
4, // 3: wecom.Wecom.StatusUser:input_type -> wecom.StatusUserReq
5, // 4: wecom.Wecom.DeleteUser:input_type -> wecom.DeleteUserReq
0, // 5: wecom.Wecom.ItemsUsers:output_type -> wecom.Response
0, // 6: wecom.Wecom.CreateUser:output_type -> wecom.Response
0, // 7: wecom.Wecom.UpdateUser:output_type -> wecom.Response
0, // 8: wecom.Wecom.StatusUser:output_type -> wecom.Response
0, // 9: wecom.Wecom.DeleteUser:output_type -> wecom.Response
5, // [5:10] is the sub-list for method output_type
0, // [0:5] is the sub-list for method input_type
2, // 0: wecom.Wecom.ItemsUsers:input_type -> wecom.ItemsUserReq
3, // 1: wecom.Wecom.CreateUser:input_type -> wecom.CreateUserReq
4, // 2: wecom.Wecom.UpdateUser:input_type -> wecom.UpdateUserReq
5, // 3: wecom.Wecom.StatusUser:input_type -> wecom.StatusUserReq
6, // 4: wecom.Wecom.DeleteUser:input_type -> wecom.DeleteUserReq
1, // 5: wecom.Wecom.ItemsAgents:input_type -> wecom.EmptyReq
1, // 6: wecom.Wecom.Types:input_type -> wecom.EmptyReq
0, // 7: wecom.Wecom.ItemsUsers:output_type -> wecom.Response
0, // 8: wecom.Wecom.CreateUser:output_type -> wecom.Response
0, // 9: wecom.Wecom.UpdateUser:output_type -> wecom.Response
0, // 10: wecom.Wecom.StatusUser:output_type -> wecom.Response
0, // 11: wecom.Wecom.DeleteUser:output_type -> wecom.Response
0, // 12: wecom.Wecom.ItemsAgents:output_type -> wecom.Response
0, // 13: wecom.Wecom.Types:output_type -> wecom.Response
7, // [7:14] is the sub-list for method output_type
0, // [0:7] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
@@ -527,7 +572,7 @@ func file_wecom_wecom_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_wecom_wecom_proto_rawDesc), len(file_wecom_wecom_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
+81 -5
View File
@@ -19,11 +19,13 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
Wecom_ItemsUsers_FullMethodName = "/wecom.Wecom/ItemsUsers"
Wecom_CreateUser_FullMethodName = "/wecom.Wecom/CreateUser"
Wecom_UpdateUser_FullMethodName = "/wecom.Wecom/UpdateUser"
Wecom_StatusUser_FullMethodName = "/wecom.Wecom/StatusUser"
Wecom_DeleteUser_FullMethodName = "/wecom.Wecom/DeleteUser"
Wecom_ItemsUsers_FullMethodName = "/wecom.Wecom/ItemsUsers"
Wecom_CreateUser_FullMethodName = "/wecom.Wecom/CreateUser"
Wecom_UpdateUser_FullMethodName = "/wecom.Wecom/UpdateUser"
Wecom_StatusUser_FullMethodName = "/wecom.Wecom/StatusUser"
Wecom_DeleteUser_FullMethodName = "/wecom.Wecom/DeleteUser"
Wecom_ItemsAgents_FullMethodName = "/wecom.Wecom/ItemsAgents"
Wecom_Types_FullMethodName = "/wecom.Wecom/Types"
)
// WecomClient is the client API for Wecom service.
@@ -35,6 +37,8 @@ type WecomClient interface {
UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*Response, error)
StatusUser(ctx context.Context, in *StatusUserReq, opts ...grpc.CallOption) (*Response, error)
DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*Response, error)
ItemsAgents(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error)
Types(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error)
}
type wecomClient struct {
@@ -95,6 +99,26 @@ func (c *wecomClient) DeleteUser(ctx context.Context, in *DeleteUserReq, opts ..
return out, nil
}
func (c *wecomClient) ItemsAgents(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Wecom_ItemsAgents_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *wecomClient) Types(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Response)
err := c.cc.Invoke(ctx, Wecom_Types_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// WecomServer is the server API for Wecom service.
// All implementations must embed UnimplementedWecomServer
// for forward compatibility.
@@ -104,6 +128,8 @@ type WecomServer interface {
UpdateUser(context.Context, *UpdateUserReq) (*Response, error)
StatusUser(context.Context, *StatusUserReq) (*Response, error)
DeleteUser(context.Context, *DeleteUserReq) (*Response, error)
ItemsAgents(context.Context, *EmptyReq) (*Response, error)
Types(context.Context, *EmptyReq) (*Response, error)
mustEmbedUnimplementedWecomServer()
}
@@ -129,6 +155,12 @@ func (UnimplementedWecomServer) StatusUser(context.Context, *StatusUserReq) (*Re
func (UnimplementedWecomServer) DeleteUser(context.Context, *DeleteUserReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteUser not implemented")
}
func (UnimplementedWecomServer) ItemsAgents(context.Context, *EmptyReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method ItemsAgents not implemented")
}
func (UnimplementedWecomServer) Types(context.Context, *EmptyReq) (*Response, error) {
return nil, status.Error(codes.Unimplemented, "method Types not implemented")
}
func (UnimplementedWecomServer) mustEmbedUnimplementedWecomServer() {}
func (UnimplementedWecomServer) testEmbeddedByValue() {}
@@ -240,6 +272,42 @@ func _Wecom_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _Wecom_ItemsAgents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WecomServer).ItemsAgents(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Wecom_ItemsAgents_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WecomServer).ItemsAgents(ctx, req.(*EmptyReq))
}
return interceptor(ctx, in, info, handler)
}
func _Wecom_Types_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WecomServer).Types(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Wecom_Types_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WecomServer).Types(ctx, req.(*EmptyReq))
}
return interceptor(ctx, in, info, handler)
}
// Wecom_ServiceDesc is the grpc.ServiceDesc for Wecom service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -267,6 +335,14 @@ var Wecom_ServiceDesc = grpc.ServiceDesc{
MethodName: "DeleteUser",
Handler: _Wecom_DeleteUser_Handler,
},
{
MethodName: "ItemsAgents",
Handler: _Wecom_ItemsAgents_Handler,
},
{
MethodName: "Types",
Handler: _Wecom_Types_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "wecom/wecom.proto",
Binary file not shown.
+18 -2
View File
@@ -35,6 +35,20 @@ service Wecom {
body: "*"
};
}
rpc ItemsAgents(EmptyReq) returns (Response) {
option (google.api.http) = {
get: "/admin/v3/wecom/agent"
body: "*"
};
}
rpc Types(EmptyReq) returns (Response) {
option (google.api.http) = {
get: "/admin/v3/wecom/types"
body: "*"
};
}
}
message Response {
@@ -43,12 +57,14 @@ message Response {
string data = 3;
}
message EmptyReq {}
message ItemsUserReq {
uint32 page = 1;
uint32 page_size = 2;
string name = 3;
uint32 type = 4; // 1: 管理员,2: 销售
uint32 status = 5; // 1: 启用,2: 禁用
uint32 type = 4;
uint32 status = 5;
}
message CreateUserReq {