From b8a0b291ed5bc370c6c23cbe2ec25747aee832e5 Mon Sep 17 00:00:00 2001 From: univero <1449610641@qq.com> Date: Wed, 8 Jan 2025 16:12:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=93=8D=E5=BA=94=E7=9A=84=E5=8F=AF=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=E4=BA=86=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- biz/application/dto/basic/app.pb.go | 2 +- biz/application/dto/http/http.pb.go | 2 +- .../dto/platform/core_api/auth.pb.go | 77 +++++++++++-------- .../dto/platform/core_api/core_api.pb.go | 2 +- .../dto/platform/core_api/data.pb.go | 2 +- biz/application/service/auth.go | 3 + go.mod | 2 +- go.sum | 2 + 9 files changed, 55 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index e2fe09a..94a02e8 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build_and_run: wire: wire ./provider update: - hz update $(IDL_OPTIONS) --mod $(MODULE_NAME) $(EXTRA_OPTIONS) + hz.exe update $(IDL_OPTIONS) --mod $(MODULE_NAME) $(EXTRA_OPTIONS) @files=$$(find biz/application/dto -type f); \ for file in $$files; do \ sed -i -e 's/func init\(\).*//' $$file; \ diff --git a/biz/application/dto/basic/app.pb.go b/biz/application/dto/basic/app.pb.go index 8930686..fbf4635 100644 --- a/biz/application/dto/basic/app.pb.go +++ b/biz/application/dto/basic/app.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v5.27.3 // source: basic/app.proto package basic diff --git a/biz/application/dto/http/http.pb.go b/biz/application/dto/http/http.pb.go index 42e547b..86539aa 100644 --- a/biz/application/dto/http/http.pb.go +++ b/biz/application/dto/http/http.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v5.27.3 // source: http/http.proto package http diff --git a/biz/application/dto/platform/core_api/auth.pb.go b/biz/application/dto/platform/core_api/auth.pb.go index 2094e57..190b43d 100644 --- a/biz/application/dto/platform/core_api/auth.pb.go +++ b/biz/application/dto/platform/core_api/auth.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v5.27.3 // source: platform/core_api/auth.proto package core_api @@ -113,9 +113,10 @@ type SignInResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" form:"userId" json:"userId" query:"userId"` - AccessToken string `protobuf:"bytes,2,opt,name=accessToken,proto3" form:"accessToken" json:"accessToken" query:"accessToken"` - AccessExpire int64 `protobuf:"varint,3,opt,name=accessExpire,proto3" form:"accessExpire" json:"accessExpire" query:"accessExpire"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" form:"userId" json:"userId" query:"userId"` + AccessToken string `protobuf:"bytes,2,opt,name=accessToken,proto3" form:"accessToken" json:"accessToken" query:"accessToken"` + AccessExpire int64 `protobuf:"varint,3,opt,name=accessExpire,proto3" form:"accessExpire" json:"accessExpire" query:"accessExpire"` + Option *string `protobuf:"bytes,4,opt,name=option,proto3,oneof" form:"option" json:"option" query:"option"` // 可选参数 } func (x *SignInResp) Reset() { @@ -171,6 +172,13 @@ func (x *SignInResp) GetAccessExpire() int64 { return 0 } +func (x *SignInResp) GetOption() string { + if x != nil && x.Option != nil { + return *x.Option + } + return "" +} + type SetPasswordReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -387,35 +395,37 @@ var file_platform_core_api_auth_proto_rawDesc = []byte{ 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x43, 0x6f, 0x64, 0x65, 0x22, 0x6a, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x22, 0x0a, 0x0c, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, - 0x22, 0x2c, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, - 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x11, - 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x47, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, - 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x84, 0x01, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x68, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x2e, 0x69, 0x64, 0x6c, 0x67, 0x65, 0x6e, 0x2e, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, - 0x69, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x68, 0x2d, 0x70, 0x6f, - 0x6c, 0x61, 0x72, 0x69, 0x73, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x64, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x22, 0x0a, + 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, + 0x0a, 0x07, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x0e, 0x53, 0x65, 0x74, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x47, 0x0a, 0x11, 0x53, 0x65, + 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x75, 0x74, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, + 0x68, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, + 0x84, 0x01, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x68, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, + 0x73, 0x2e, 0x69, 0x64, 0x6c, 0x67, 0x65, 0x6e, 0x2e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x68, 0x2d, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x2f, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2d, 0x61, 0x70, 0x69, + 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -528,6 +538,7 @@ func file_platform_core_api_auth_proto_init() { } } file_platform_core_api_auth_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_platform_core_api_auth_proto_msgTypes[1].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/biz/application/dto/platform/core_api/core_api.pb.go b/biz/application/dto/platform/core_api/core_api.pb.go index d5c72d5..466348e 100644 --- a/biz/application/dto/platform/core_api/core_api.pb.go +++ b/biz/application/dto/platform/core_api/core_api.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v5.27.3 // source: core_api.proto package core_api diff --git a/biz/application/dto/platform/core_api/data.pb.go b/biz/application/dto/platform/core_api/data.pb.go index 6ff3273..27b65b2 100644 --- a/biz/application/dto/platform/core_api/data.pb.go +++ b/biz/application/dto/platform/core_api/data.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v5.27.3 // source: platform/core_api/data.proto package core_api diff --git a/biz/application/service/auth.go b/biz/application/service/auth.go index 62b0039..9fc0a68 100644 --- a/biz/application/service/auth.go +++ b/biz/application/service/auth.go @@ -51,6 +51,9 @@ func (s *AuthService) SignIn(ctx context.Context, req *core_api.SignInReq) (*cor return nil, err } resp.UserId = rpcResp.GetUserId() + if rpcResp.Options != nil { + resp.Option = rpcResp.Options + } return resp, nil } diff --git a/go.mod b/go.mod index 3c3e7a4..ff756e3 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/xh-polaris/service-idl-gen-go v0.0.0-20241008070604-1ac5105f5c13 + github.com/xh-polaris/service-idl-gen-go v0.0.0-20250108075223-4036ab37c8b4 go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect diff --git a/go.sum b/go.sum index 80bd75f..9236649 100644 --- a/go.sum +++ b/go.sum @@ -397,6 +397,8 @@ github.com/xh-polaris/gopkg v0.0.0-20240424152329-9162fdb0eef9 h1:C77LIsAjkwP5B1 github.com/xh-polaris/gopkg v0.0.0-20240424152329-9162fdb0eef9/go.mod h1:iuTX4c9raQCv45PeZ1s6Ixy1/CP37kSjOxHpkhiNQLc= github.com/xh-polaris/service-idl-gen-go v0.0.0-20241008070604-1ac5105f5c13 h1:JJn3mPPWBlJnMH3ukBuKCAXeK9Q/Kq6P63/ZlTOIG1I= github.com/xh-polaris/service-idl-gen-go v0.0.0-20241008070604-1ac5105f5c13/go.mod h1:3ixuadpEpTumm8RftVwtXYH8Zfmu6shi33Hh5GKC6cU= +github.com/xh-polaris/service-idl-gen-go v0.0.0-20250108075223-4036ab37c8b4 h1:SQE9JSehJufW87A3374EW90w+E9EonWozha+YW/277Q= +github.com/xh-polaris/service-idl-gen-go v0.0.0-20250108075223-4036ab37c8b4/go.mod h1:3ixuadpEpTumm8RftVwtXYH8Zfmu6shi33Hh5GKC6cU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=