feat: service-lark update
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-01-12 00:40:37 +08:00
parent 6dab1ffda3
commit c048909a9d
13 changed files with 420 additions and 88 deletions
View File
+173 -45
View File
@@ -64,18 +64,7 @@ func (m *LoginRequest) GetCode() string {
}
type LoginResponse struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
EnName string `protobuf:"bytes,3,opt,name=en_name,json=enName,proto3" json:"en_name,omitempty"`
AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
AvatarThumb string `protobuf:"bytes,5,opt,name=avatar_thumb,json=avatarThumb,proto3" json:"avatar_thumb,omitempty"`
AvatarMiddle string `protobuf:"bytes,6,opt,name=avatar_middle,json=avatarMiddle,proto3" json:"avatar_middle,omitempty"`
AvatarBig string `protobuf:"bytes,7,opt,name=avatar_big,json=avatarBig,proto3" json:"avatar_big,omitempty"`
OpenId string `protobuf:"bytes,8,opt,name=open_id,json=openId,proto3" json:"open_id,omitempty"`
UnionId string `protobuf:"bytes,9,opt,name=union_id,json=unionId,proto3" json:"union_id,omitempty"`
Email string `protobuf:"bytes,10,opt,name=email,proto3" json:"email,omitempty"`
UserId string `protobuf:"bytes,11,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Mobile string `protobuf:"bytes,12,opt,name=mobile,proto3" json:"mobile,omitempty"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -106,84 +95,181 @@ func (m *LoginResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_LoginResponse proto.InternalMessageInfo
func (m *LoginResponse) GetAccessToken() string {
func (m *LoginResponse) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
type InfoRequest struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *InfoRequest) Reset() { *m = InfoRequest{} }
func (m *InfoRequest) String() string { return proto.CompactTextString(m) }
func (*InfoRequest) ProtoMessage() {}
func (*InfoRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{2}
}
func (m *InfoRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InfoRequest.Unmarshal(m, b)
}
func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic)
}
func (m *InfoRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_InfoRequest.Merge(m, src)
}
func (m *InfoRequest) XXX_Size() int {
return xxx_messageInfo_InfoRequest.Size(m)
}
func (m *InfoRequest) XXX_DiscardUnknown() {
xxx_messageInfo_InfoRequest.DiscardUnknown(m)
}
var xxx_messageInfo_InfoRequest proto.InternalMessageInfo
func (m *InfoRequest) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
type InfoResponse struct {
Id uint64 `protobuf:"varint,13,opt,name=id,proto3" json:"id,omitempty"`
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
EnName string `protobuf:"bytes,3,opt,name=en_name,json=enName,proto3" json:"en_name,omitempty"`
AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
AvatarThumb string `protobuf:"bytes,5,opt,name=avatar_thumb,json=avatarThumb,proto3" json:"avatar_thumb,omitempty"`
AvatarMiddle string `protobuf:"bytes,6,opt,name=avatar_middle,json=avatarMiddle,proto3" json:"avatar_middle,omitempty"`
AvatarBig string `protobuf:"bytes,7,opt,name=avatar_big,json=avatarBig,proto3" json:"avatar_big,omitempty"`
OpenId string `protobuf:"bytes,8,opt,name=open_id,json=openId,proto3" json:"open_id,omitempty"`
UnionId string `protobuf:"bytes,9,opt,name=union_id,json=unionId,proto3" json:"union_id,omitempty"`
Email string `protobuf:"bytes,10,opt,name=email,proto3" json:"email,omitempty"`
UserId string `protobuf:"bytes,11,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Mobile string `protobuf:"bytes,12,opt,name=mobile,proto3" json:"mobile,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *InfoResponse) Reset() { *m = InfoResponse{} }
func (m *InfoResponse) String() string { return proto.CompactTextString(m) }
func (*InfoResponse) ProtoMessage() {}
func (*InfoResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{3}
}
func (m *InfoResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InfoResponse.Unmarshal(m, b)
}
func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic)
}
func (m *InfoResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_InfoResponse.Merge(m, src)
}
func (m *InfoResponse) XXX_Size() int {
return xxx_messageInfo_InfoResponse.Size(m)
}
func (m *InfoResponse) XXX_DiscardUnknown() {
xxx_messageInfo_InfoResponse.DiscardUnknown(m)
}
var xxx_messageInfo_InfoResponse proto.InternalMessageInfo
func (m *InfoResponse) GetId() uint64 {
if m != nil {
return m.Id
}
return 0
}
func (m *InfoResponse) GetAccessToken() string {
if m != nil {
return m.AccessToken
}
return ""
}
func (m *LoginResponse) GetName() string {
func (m *InfoResponse) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *LoginResponse) GetEnName() string {
func (m *InfoResponse) GetEnName() string {
if m != nil {
return m.EnName
}
return ""
}
func (m *LoginResponse) GetAvatarUrl() string {
func (m *InfoResponse) GetAvatarUrl() string {
if m != nil {
return m.AvatarUrl
}
return ""
}
func (m *LoginResponse) GetAvatarThumb() string {
func (m *InfoResponse) GetAvatarThumb() string {
if m != nil {
return m.AvatarThumb
}
return ""
}
func (m *LoginResponse) GetAvatarMiddle() string {
func (m *InfoResponse) GetAvatarMiddle() string {
if m != nil {
return m.AvatarMiddle
}
return ""
}
func (m *LoginResponse) GetAvatarBig() string {
func (m *InfoResponse) GetAvatarBig() string {
if m != nil {
return m.AvatarBig
}
return ""
}
func (m *LoginResponse) GetOpenId() string {
func (m *InfoResponse) GetOpenId() string {
if m != nil {
return m.OpenId
}
return ""
}
func (m *LoginResponse) GetUnionId() string {
func (m *InfoResponse) GetUnionId() string {
if m != nil {
return m.UnionId
}
return ""
}
func (m *LoginResponse) GetEmail() string {
func (m *InfoResponse) GetEmail() string {
if m != nil {
return m.Email
}
return ""
}
func (m *LoginResponse) GetUserId() string {
func (m *InfoResponse) GetUserId() string {
if m != nil {
return m.UserId
}
return ""
}
func (m *LoginResponse) GetMobile() string {
func (m *InfoResponse) GetMobile() string {
if m != nil {
return m.Mobile
}
@@ -193,32 +279,38 @@ func (m *LoginResponse) GetMobile() string {
func init() {
proto.RegisterType((*LoginRequest)(nil), "example_service.LoginRequest")
proto.RegisterType((*LoginResponse)(nil), "example_service.LoginResponse")
proto.RegisterType((*InfoRequest)(nil), "example_service.InfoRequest")
proto.RegisterType((*InfoResponse)(nil), "example_service.InfoResponse")
}
func init() { proto.RegisterFile("user.proto", fileDescriptor_116e343673f7ffaf) }
var fileDescriptor_116e343673f7ffaf = []byte{
// 320 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x4b, 0x03, 0x31,
0x10, 0x85, 0x6d, 0xdd, 0x6e, 0xdb, 0x69, 0x8b, 0x10, 0x44, 0xa3, 0x50, 0xd1, 0xf5, 0xe2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26, 0x57, 0x92, 0x8f, 0xe2, 0xf3, 0x82,
0x5c, 0x49, 0x76, 0x05, 0xa3, 0xd6, 0x28, 0x4b, 0xce, 0x98, 0x9c, 0x21, 0xe9, 0x95, 0x64, 0xe7,
0x30, 0xc0, 0x4a, 0x28, 0xcd, 0x81, 0x78, 0x14, 0x61, 0x52, 0xf8, 0xf4, 0x90, 0x9f, 0xc4, 0x49,
0x41, 0xae, 0x24, 0xbb, 0x80, 0xb4, 0xb2, 0x85, 0xd2, 0xc8, 0xa7, 0x91, 0x47, 0xf5, 0xf8, 0x0e,
0xc9, 0xd6, 0xa3, 0x63, 0xcf, 0x30, 0xa0, 0x9f, 0x66, 0xf3, 0xc5, 0x9f, 0xa6, 0x16, 0xc7, 0x35,
0x5d, 0xdf, 0xfc, 0x67, 0xc7, 0x82, 0xb2, 0x93, 0x65, 0xfa, 0x91, 0x68, 0xe1, 0xf6, 0x45, 0x4a,
0xc5, 0x3f, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x68, 0x47, 0xbc, 0x3c, 0x06, 0x02, 0x00, 0x00,
// 380 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0x8e, 0xd3, 0x30,
0x10, 0x26, 0x21, 0x4d, 0xdb, 0x69, 0x0a, 0x92, 0x85, 0xc0, 0x54, 0x14, 0x95, 0x54, 0x48, 0x3d,
0xf5, 0x00, 0x6f, 0x50, 0x09, 0x89, 0x48, 0xc0, 0xa1, 0x6a, 0x2f, 0x5c, 0x22, 0x27, 0x1e, 0x8a,
0xd5, 0xc4, 0x0e, 0x76, 0x52, 0xf1, 0x26, 0xfb, 0x98, 0xfb, 0x0a, 0x2b, 0xdb, 0xa9, 0x14, 0xed,
0x6e, 0x6f, 0xfe, 0x7e, 0xfc, 0xcd, 0x68, 0x66, 0x00, 0x3a, 0x83, 0x7a, 0xdb, 0x68, 0xd5, 0x2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0x85, 0x19, 0x27, 0xef, 0x61, 0xd2, 0x49, 0xa1,
0x9c, 0x32, 0x75, 0xca, 0xd8, 0xe1, 0x8c, 0xdb, 0x01, 0x62, 0xcd, 0x44, 0x45, 0xc1, 0x0f, 0xd0,
0x01, 0x9b, 0x64, 0xf7, 0x69, 0xfd, 0x33, 0x9f, 0x64, 0x61, 0xc6, 0xc9, 0x5b, 0x88, 0x6b, 0x55,
0x88, 0x0a, 0x69, 0xe2, 0x79, 0x8f, 0xbe, 0xdc, 0x05, 0x10, 0x1d, 0x0d, 0x6a, 0xf2, 0x1d, 0x46,
0x6e, 0x8d, 0x64, 0xb9, 0x7d, 0x74, 0x05, 0xdb, 0xe1, 0x09, 0x2c, 0x3e, 0xde, 0x92, 0xfd, 0xc6,
0xd2, 0x17, 0xe4, 0x1b, 0x44, 0x76, 0x87, 0xe4, 0xc3, 0x13, 0xe7, 0xe0, 0x00, 0x16, 0xcb, 0x1b,
0xea, 0x35, 0x66, 0x17, 0xff, 0x8e, 0x2a, 0xa6, 0xcf, 0x45, 0xec, 0x6e, 0xf3, 0xeb, 0x43, 0x00,
0x00, 0x00, 0xff, 0xff, 0x46, 0x1e, 0x8d, 0x0a, 0xa9, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -234,6 +326,7 @@ const _ = grpc.SupportPackageIsVersion4
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type UserClient interface {
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
}
type userClient struct {
@@ -253,9 +346,19 @@ func (c *userClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.C
return out, nil
}
func (c *userClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
out := new(InfoResponse)
err := c.cc.Invoke(ctx, "/example_service.User/Info", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServer is the server API for User service.
type UserServer interface {
Login(context.Context, *LoginRequest) (*LoginResponse, error)
Info(context.Context, *InfoRequest) (*InfoResponse, error)
}
// UnimplementedUserServer can be embedded to have forward compatible implementations.
@@ -265,6 +368,9 @@ type UnimplementedUserServer struct {
func (*UnimplementedUserServer) Login(ctx context.Context, req *LoginRequest) (*LoginResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
}
func (*UnimplementedUserServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
}
func RegisterUserServer(s *grpc.Server, srv UserServer) {
s.RegisterService(&_User_serviceDesc, srv)
@@ -288,6 +394,24 @@ func _User_Login_Handler(srv interface{}, ctx context.Context, dec func(interfac
return interceptor(ctx, in, info, handler)
}
func _User_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).Info(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/example_service.User/Info",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).Info(ctx, req.(*InfoRequest))
}
return interceptor(ctx, in, info, handler)
}
var _User_serviceDesc = grpc.ServiceDesc{
ServiceName: "example_service.User",
HandlerType: (*UserServer)(nil),
@@ -296,6 +420,10 @@ var _User_serviceDesc = grpc.ServiceDesc{
MethodName: "Login",
Handler: _User_Login_Handler,
},
{
MethodName: "Info",
Handler: _User_Info_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
+9
View File
@@ -6,6 +6,7 @@ package example_service;
service User {
rpc Login (LoginRequest) returns (LoginResponse) {}
rpc Info (InfoRequest) returns (InfoResponse) {}
}
message LoginRequest {
@@ -13,6 +14,14 @@ message LoginRequest {
}
message LoginResponse {
string token = 1;
}
message InfoRequest {
string token = 1;
}
message InfoResponse {
uint64 id = 13;
string access_token = 1;
string name = 2;