Ver Fonte

新微服务

wfz há 3 anos atrás
pai
commit
1f356b1a0a

+ 73 - 0
api/chat/chat.pb.go

@@ -0,0 +1,73 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.26.0-devel
+// 	protoc        v3.15.8
+// source: chat.proto
+
+package chat
+
+import (
+	_ "google.golang.org/genproto/googleapis/api/annotations"
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	_ "google.golang.org/protobuf/types/known/emptypb"
+	_ "google.golang.org/protobuf/types/known/structpb"
+	reflect "reflect"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+var File_chat_proto protoreflect.FileDescriptor
+
+var file_chat_proto_rawDesc = []byte{
+	0x0a, 0x0a, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x61, 0x70,
+	0x69, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
+	0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
+	0x06, 0x0a, 0x04, 0x43, 0x68, 0x61, 0x74, 0x42, 0x3d, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x63,
+	0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61,
+	0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x68, 0x61,
+	0x74, 0x3b, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var file_chat_proto_goTypes = []interface{}{}
+var file_chat_proto_depIdxs = []int32{
+	0, // [0:0] is the sub-list for method output_type
+	0, // [0:0] 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
+}
+
+func init() { file_chat_proto_init() }
+func file_chat_proto_init() {
+	if File_chat_proto != nil {
+		return
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_chat_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   0,
+			NumExtensions: 0,
+			NumServices:   1,
+		},
+		GoTypes:           file_chat_proto_goTypes,
+		DependencyIndexes: file_chat_proto_depIdxs,
+	}.Build()
+	File_chat_proto = out.File
+	file_chat_proto_rawDesc = nil
+	file_chat_proto_goTypes = nil
+	file_chat_proto_depIdxs = nil
+}

+ 14 - 0
api/chat/chat.proto

@@ -0,0 +1,14 @@
+syntax = "proto3";
+
+package api.chat;
+
+import "google/api/annotations.proto";
+import "google/protobuf/struct.proto";
+import "google/protobuf/empty.proto";
+
+option go_package = "git.ikuban.com/server/pw-protobuf/api/chat;chat";
+option java_multiple_files = true;
+option java_package = "api.chat";
+
+service Chat {
+}

+ 61 - 0
api/chat/chat_grpc.pb.go

@@ -0,0 +1,61 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+
+package chat
+
+import (
+	grpc "google.golang.org/grpc"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// ChatClient is the client API for Chat service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type ChatClient interface {
+}
+
+type chatClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewChatClient(cc grpc.ClientConnInterface) ChatClient {
+	return &chatClient{cc}
+}
+
+// ChatServer is the server API for Chat service.
+// All implementations must embed UnimplementedChatServer
+// for forward compatibility
+type ChatServer interface {
+	mustEmbedUnimplementedChatServer()
+}
+
+// UnimplementedChatServer must be embedded to have forward compatible implementations.
+type UnimplementedChatServer struct {
+}
+
+func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
+
+// UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to ChatServer will
+// result in compilation errors.
+type UnsafeChatServer interface {
+	mustEmbedUnimplementedChatServer()
+}
+
+func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer) {
+	s.RegisterService(&Chat_ServiceDesc, srv)
+}
+
+// Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var Chat_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "api.chat.Chat",
+	HandlerType: (*ChatServer)(nil),
+	Methods:     []grpc.MethodDesc{},
+	Streams:     []grpc.StreamDesc{},
+	Metadata:    "chat.proto",
+}

+ 228 - 0
api/companion/companion.pb.go

@@ -0,0 +1,228 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.26.0-devel
+// 	protoc        v3.15.8
+// source: companion.proto
+
+package companion
+
+import (
+	_ "google.golang.org/genproto/googleapis/api/annotations"
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	_ "google.golang.org/protobuf/types/known/emptypb"
+	_ "google.golang.org/protobuf/types/known/structpb"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type AuthorizationRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	JsCode string `protobuf:"bytes,1,opt,name=jsCode,proto3" json:"jsCode"`
+}
+
+func (x *AuthorizationRequest) Reset() {
+	*x = AuthorizationRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_companion_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *AuthorizationRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AuthorizationRequest) ProtoMessage() {}
+
+func (x *AuthorizationRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_companion_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use AuthorizationRequest.ProtoReflect.Descriptor instead.
+func (*AuthorizationRequest) Descriptor() ([]byte, []int) {
+	return file_companion_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *AuthorizationRequest) GetJsCode() string {
+	if x != nil {
+		return x.JsCode
+	}
+	return ""
+}
+
+type TokenReply struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token"`
+}
+
+func (x *TokenReply) Reset() {
+	*x = TokenReply{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_companion_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TokenReply) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TokenReply) ProtoMessage() {}
+
+func (x *TokenReply) ProtoReflect() protoreflect.Message {
+	mi := &file_companion_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use TokenReply.ProtoReflect.Descriptor instead.
+func (*TokenReply) Descriptor() ([]byte, []int) {
+	return file_companion_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *TokenReply) GetToken() string {
+	if x != nil {
+		return x.Token
+	}
+	return ""
+}
+
+var File_companion_proto protoreflect.FileDescriptor
+
+var file_companion_proto_rawDesc = []byte{
+	0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x12, 0x0d, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e,
+	0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e,
+	0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,
+	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
+	0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,
+	0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,
+	0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, 0x14, 0x41, 0x75, 0x74,
+	0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+	0x74, 0x12, 0x16, 0x0a, 0x06, 0x6a, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x06, 0x6a, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x54, 0x6f, 0x6b,
+	0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x80, 0x01,
+	0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x12, 0x73, 0x0a, 0x0d, 0x41,
+	0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x61,
+	0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74,
+	0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+	0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f,
+	0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x22, 0x82, 0xd3,
+	0xe4, 0x93, 0x02, 0x1c, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f,
+	0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a,
+	0x42, 0x4c, 0x0a, 0x0d, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f,
+	0x6e, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e,
+	0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
+	0x6e, 0x69, 0x6f, 0x6e, 0x3b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_companion_proto_rawDescOnce sync.Once
+	file_companion_proto_rawDescData = file_companion_proto_rawDesc
+)
+
+func file_companion_proto_rawDescGZIP() []byte {
+	file_companion_proto_rawDescOnce.Do(func() {
+		file_companion_proto_rawDescData = protoimpl.X.CompressGZIP(file_companion_proto_rawDescData)
+	})
+	return file_companion_proto_rawDescData
+}
+
+var file_companion_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_companion_proto_goTypes = []interface{}{
+	(*AuthorizationRequest)(nil), // 0: api.companion.AuthorizationRequest
+	(*TokenReply)(nil),           // 1: api.companion.TokenReply
+}
+var file_companion_proto_depIdxs = []int32{
+	0, // 0: api.companion.Companion.Authorization:input_type -> api.companion.AuthorizationRequest
+	1, // 1: api.companion.Companion.Authorization:output_type -> api.companion.TokenReply
+	1, // [1:2] is the sub-list for method output_type
+	0, // [0:1] 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
+}
+
+func init() { file_companion_proto_init() }
+func file_companion_proto_init() {
+	if File_companion_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_companion_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*AuthorizationRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_companion_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TokenReply); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_companion_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   2,
+			NumExtensions: 0,
+			NumServices:   1,
+		},
+		GoTypes:           file_companion_proto_goTypes,
+		DependencyIndexes: file_companion_proto_depIdxs,
+		MessageInfos:      file_companion_proto_msgTypes,
+	}.Build()
+	File_companion_proto = out.File
+	file_companion_proto_rawDesc = nil
+	file_companion_proto_goTypes = nil
+	file_companion_proto_depIdxs = nil
+}

+ 28 - 0
api/companion/companion.proto

@@ -0,0 +1,28 @@
+syntax = "proto3";
+
+package api.companion;
+
+import "google/api/annotations.proto";
+import "google/protobuf/struct.proto";
+import "google/protobuf/empty.proto";
+
+option go_package = "git.ikuban.com/server/pw-protobuf/api/companion;companion";
+option java_multiple_files = true;
+option java_package = "api.companion";
+
+service Companion {
+  rpc Authorization (AuthorizationRequest) returns (TokenReply){
+    option (google.api.http) = {
+      post: "/api/user/authorization",
+      body:"*"
+    };
+  };
+}
+
+message AuthorizationRequest {
+  string jsCode = 1;
+}
+
+message TokenReply {
+  string token = 1;
+}

+ 101 - 0
api/companion/companion_grpc.pb.go

@@ -0,0 +1,101 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+
+package companion
+
+import (
+	context "context"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// CompanionClient is the client API for Companion service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type CompanionClient interface {
+	Authorization(ctx context.Context, in *AuthorizationRequest, opts ...grpc.CallOption) (*TokenReply, error)
+}
+
+type companionClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewCompanionClient(cc grpc.ClientConnInterface) CompanionClient {
+	return &companionClient{cc}
+}
+
+func (c *companionClient) Authorization(ctx context.Context, in *AuthorizationRequest, opts ...grpc.CallOption) (*TokenReply, error) {
+	out := new(TokenReply)
+	err := c.cc.Invoke(ctx, "/api.companion.Companion/Authorization", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// CompanionServer is the server API for Companion service.
+// All implementations must embed UnimplementedCompanionServer
+// for forward compatibility
+type CompanionServer interface {
+	Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)
+	mustEmbedUnimplementedCompanionServer()
+}
+
+// UnimplementedCompanionServer must be embedded to have forward compatible implementations.
+type UnimplementedCompanionServer struct {
+}
+
+func (UnimplementedCompanionServer) Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method Authorization not implemented")
+}
+func (UnimplementedCompanionServer) mustEmbedUnimplementedCompanionServer() {}
+
+// UnsafeCompanionServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to CompanionServer will
+// result in compilation errors.
+type UnsafeCompanionServer interface {
+	mustEmbedUnimplementedCompanionServer()
+}
+
+func RegisterCompanionServer(s grpc.ServiceRegistrar, srv CompanionServer) {
+	s.RegisterService(&Companion_ServiceDesc, srv)
+}
+
+func _Companion_Authorization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(AuthorizationRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(CompanionServer).Authorization(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.companion.Companion/Authorization",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(CompanionServer).Authorization(ctx, req.(*AuthorizationRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+// Companion_ServiceDesc is the grpc.ServiceDesc for Companion service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var Companion_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "api.companion.Companion",
+	HandlerType: (*CompanionServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "Authorization",
+			Handler:    _Companion_Authorization_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "companion.proto",
+}

+ 87 - 0
api/companion/companion_http.pb.go

@@ -0,0 +1,87 @@
+// Code generated by protoc-gen-go-http. DO NOT EDIT.
+// versions:
+// protoc-gen-go-http v2.0.0
+
+package companion
+
+import (
+	context "context"
+	base "git.ikuban.com/server/base-protobuf/kuban/api/base"
+	reply "git.ikuban.com/server/kratos-utils/http/reply"
+	http "github.com/go-kratos/kratos/v2/transport/http"
+	binding "github.com/go-kratos/kratos/v2/transport/http/binding"
+	ioutil "io/ioutil"
+	time "time"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the kratos package it is being compiled against.
+var _ = new(context.Context)
+var _ = binding.EncodeURL
+var _ = ioutil.Discard
+var _ = new(time.Time)
+var _ = new(reply.SuccessReply)
+var _ = new(base.Html)
+
+const _ = http.SupportPackageIsVersion1
+
+type CompanionHTTPServer interface {
+	Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)
+}
+
+func RegisterCompanionHTTPServer(s *http.Server, srv CompanionHTTPServer) {
+	r := s.Route("/")
+	r.POST("/api/user/authorization", _Companion_Authorization0_HTTP_Handler(srv))
+}
+
+func _Companion_Authorization0_HTTP_Handler(srv CompanionHTTPServer) func(ctx http.Context) error {
+	return func(ctx http.Context) error {
+		var in AuthorizationRequest
+		if err := ctx.Bind(&in); err != nil {
+			return err
+		}
+		if err := ctx.BindQuery(&in); err != nil {
+			return err
+		}
+		http.SetOperation(ctx, "/api.companion.Companion/Authorization")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.Authorization(ctx, req.(*AuthorizationRequest))
+		})
+		out, err := h(ctx, &in)
+		if err != nil {
+			return err
+		}
+		success := &reply.SuccessReply{
+			Code: 0,
+		}
+		if out != nil {
+			success.Data = out
+		}
+		return ctx.Result(200, success)
+	}
+}
+
+type CompanionHTTPClient interface {
+	Authorization(ctx context.Context, req *AuthorizationRequest, opts ...http.CallOption) (rsp *TokenReply, err error)
+}
+
+type CompanionHTTPClientImpl struct {
+	cc *http.Client
+}
+
+func NewCompanionHTTPClient(client *http.Client) CompanionHTTPClient {
+	return &CompanionHTTPClientImpl{client}
+}
+
+func (c *CompanionHTTPClientImpl) Authorization(ctx context.Context, in *AuthorizationRequest, opts ...http.CallOption) (*TokenReply, error) {
+	var out TokenReply
+	pattern := "/api/user/authorization"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.companion.Companion/Authorization"))
+	opts = append(opts, http.PathTemplate(pattern))
+	err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return &out, err
+}

+ 43 - 42
api/user/user.pb.go

@@ -463,51 +463,52 @@ var file_user_proto_rawDesc = []byte{
 	0x0a, 0x06, 0x6a, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
 	0x6a, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52,
 	0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xf8, 0x04, 0x0a, 0x04, 0x55,
-	0x73, 0x65, 0x72, 0x12, 0x5c, 0x0a, 0x0a, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x69,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x82, 0x05, 0x0a, 0x04, 0x55,
+	0x73, 0x65, 0x72, 0x12, 0x61, 0x0a, 0x0a, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4c, 0x6f, 0x67, 0x69,
 	0x6e, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x62,
 	0x75, 0x67, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
 	0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52,
-	0x65, 0x70, 0x6c, 0x79, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61,
-	0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x3a, 0x01,
-	0x2a, 0x12, 0x64, 0x0a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69,
-	0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x75,
-	0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
-	0x73, 0x74, 0x1a, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x54, 0x6f,
-	0x6b, 0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17,
-	0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x80, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61,
-	0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69,
-	0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
-	0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
-	0x79, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f,
-	0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x6f,
-	0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x54, 0x0a, 0x0b, 0x47, 0x65,
-	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
-	0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
-	0x79, 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65,
-	0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x0e, 0x2f,
-	0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x3a, 0x01, 0x2a,
-	0x12, 0x67, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64,
-	0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x6e,
-	0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
-	0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-	0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02,
-	0x18, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64,
-	0x65, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x6a, 0x0a, 0x0e, 0x43, 0x68, 0x65,
-	0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70,
-	0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e,
-	0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,
-	0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
-	0x6d, 0x70, 0x74, 0x79, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x61,
-	0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x63, 0x68, 0x65,
-	0x63, 0x6b, 0x3a, 0x01, 0x2a, 0x42, 0x3d, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65,
-	0x72, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e,
-	0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72,
-	0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x3b,
-	0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x70, 0x6c, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x61,
+	0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2f, 0x64, 0x65,
+	0x62, 0x75, 0x67, 0x3a, 0x01, 0x2a, 0x12, 0x69, 0x0a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
+	0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73,
+	0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73,
+	0x65, 0x72, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x22, 0x82,
+	0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72,
+	0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01,
+	0x2a, 0x12, 0x80, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
+	0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x61, 0x70,
+	0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,
+	0x72, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
+	0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x27, 0x82, 0xd3, 0xe4,
+	0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75,
+	0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x54, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49,
+	0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x61, 0x70,
+	0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22,
+	0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73,
+	0x65, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x3a, 0x01, 0x2a, 0x12, 0x67, 0x0a, 0x0d, 0x53, 0x65,
+	0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70,
+	0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65,
+	0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
+	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
+	0x70, 0x74, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x61, 0x70,
+	0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x73, 0x65, 0x6e, 0x64,
+	0x3a, 0x01, 0x2a, 0x12, 0x6a, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e,
+	0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72,
+	0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52,
+	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1f,
+	0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65,
+	0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x3a, 0x01, 0x2a, 0x42,
+	0x3d, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2f, 0x67,
+	0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65,
+	0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+	0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 2 - 2
api/user/user.proto

@@ -13,13 +13,13 @@ option java_package = "api.user";
 service User {
   rpc DebugLogin (DebugLoginRequest) returns (TokenReply){
     option (google.api.http) = {
-      post: "/api/login/debug",
+      post: "/api/user/login/debug",
       body:"*"
     };
   };
   rpc Authorization (AuthorizationRequest) returns (TokenReply){
     option (google.api.http) = {
-      post: "/api/authorization",
+      post: "/api/user/authorization",
       body:"*"
     };
   };

+ 4 - 4
api/user/user_http.pb.go

@@ -37,8 +37,8 @@ type UserHTTPServer interface {
 
 func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer) {
 	r := s.Route("/")
-	r.POST("/api/login/debug", _User_DebugLogin0_HTTP_Handler(srv))
-	r.POST("/api/authorization", _User_Authorization0_HTTP_Handler(srv))
+	r.POST("/api/user/login/debug", _User_DebugLogin0_HTTP_Handler(srv))
+	r.POST("/api/user/authorization", _User_Authorization0_HTTP_Handler(srv))
 	r.POST("/api/user/update/information", _User_UpdateUserInformation0_HTTP_Handler(srv))
 	r.POST("/api/user/info", _User_GetUserInfo0_HTTP_Handler(srv))
 	r.POST("/api/user/code/send", _User_SendPhoneCode0_HTTP_Handler(srv))
@@ -226,7 +226,7 @@ func NewUserHTTPClient(client *http.Client) UserHTTPClient {
 
 func (c *UserHTTPClientImpl) Authorization(ctx context.Context, in *AuthorizationRequest, opts ...http.CallOption) (*TokenReply, error) {
 	var out TokenReply
-	pattern := "/api/authorization"
+	pattern := "/api/user/authorization"
 	path := binding.EncodeURL(pattern, in, false)
 	opts = append(opts, http.Operation("/api.user.User/Authorization"))
 	opts = append(opts, http.PathTemplate(pattern))
@@ -252,7 +252,7 @@ func (c *UserHTTPClientImpl) CheckPhoneCode(ctx context.Context, in *CheckPhoneC
 
 func (c *UserHTTPClientImpl) DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...http.CallOption) (*TokenReply, error) {
 	var out TokenReply
-	pattern := "/api/login/debug"
+	pattern := "/api/user/login/debug"
 	path := binding.EncodeURL(pattern, in, false)
 	opts = append(opts, http.Operation("/api.user.User/DebugLogin"))
 	opts = append(opts, http.PathTemplate(pattern))

+ 19 - 0
client/chat.go

@@ -0,0 +1,19 @@
+package client
+
+import (
+	"git.ikuban.com/server/kratos-nacos/registry"
+	"git.ikuban.com/server/pw-protobuf/api/chat"
+	"github.com/go-kratos/kratos/v2/log"
+)
+
+func NewChatClient(r *registry.Registry, logger log.Logger) chat.ChatClient {
+	conn, err := getDialInsecure(r, logger, "discovery://pw/pw-chat")
+	if err != nil {
+		panic(err)
+	}
+	if conn == nil {
+		return nil
+	}
+	client := chat.NewChatClient(conn)
+	return client
+}

+ 19 - 0
client/companion.go

@@ -0,0 +1,19 @@
+package client
+
+import (
+	"git.ikuban.com/server/kratos-nacos/registry"
+	"git.ikuban.com/server/pw-protobuf/api/companion"
+	"github.com/go-kratos/kratos/v2/log"
+)
+
+func NewCompanionClient(r *registry.Registry, logger log.Logger) companion.CompanionClient {
+	conn, err := getDialInsecure(r, logger, "discovery://pw/pw-companion")
+	if err != nil {
+		panic(err)
+	}
+	if conn == nil {
+		return nil
+	}
+	client := companion.NewCompanionClient(conn)
+	return client
+}

+ 13 - 0
js/api/companion/companion_http_pb.ts

@@ -0,0 +1,13 @@
+// @ts-ignore
+import { request } from 'ice';
+import {AuthorizationRequest,TokenReply} from "./companion_pb";
+
+const CompanionService = {
+  Authorization: async (req?: AuthorizationRequest) => {
+	const res = await request.post<{ data: TokenReply, code: string, message: string }>('/api/user/authorization', req);
+    return res.data;
+  },
+
+};
+
+export default CompanionService;

+ 7 - 0
js/api/companion/companion_pb.ts

@@ -0,0 +1,7 @@
+export interface AuthorizationRequest{
+    jsCode?:string;
+}
+export interface TokenReply{
+    token?:string;
+}
+

+ 2 - 2
js/api/user/user_http_pb.ts

@@ -4,11 +4,11 @@ import {DebugLoginRequest,TokenReply,AuthorizationRequest,UpdateUserInformationR
 
 const UserService = {
   DebugLogin: async (req?: DebugLoginRequest) => {
-	const res = await request.post<{ data: TokenReply, code: string, message: string }>('/api/login/debug', req);
+	const res = await request.post<{ data: TokenReply, code: string, message: string }>('/api/user/login/debug', req);
     return res.data;
   },
   Authorization: async (req?: AuthorizationRequest) => {
-	const res = await request.post<{ data: TokenReply, code: string, message: string }>('/api/authorization', req);
+	const res = await request.post<{ data: TokenReply, code: string, message: string }>('/api/user/authorization', req);
     return res.data;
   },
   UpdateUserInformation: async (req?: UpdateUserInformationRequest) => {