修改配置

This commit is contained in:
徐俊杰 2023-02-24 10:51:35 +08:00
parent fd37281a63
commit 51425ada2f
8 changed files with 1255 additions and 548 deletions

View File

@ -17,9 +17,9 @@ import (
func main() { func main() {
fmt.Println("第一处") fmt.Println("第一处")
config.SetProviderService(&controller.ArtistInfoProvider{}) config.SetProviderService(&controller.ArtistInfoProvider{})
config.SetProviderService(&controller.ContractProvider{}) //config.SetProviderService(&controller.ContractProvider{})
config.SetProviderService(&controller.ArtWorkProvider{}) //config.SetProviderService(&controller.ArtWorkProvider{})
config.SetProviderService(&controller.SupplyProvider{}) //config.SetProviderService(&controller.SupplyProvider{})
db.Init(m.SERVER_CONFIG) db.Init(m.SERVER_CONFIG)
cache.InitRedis(m.SERVER_CONFIG) cache.InitRedis(m.SERVER_CONFIG)
if err := config.Load(); err != nil { if err := config.Load(); err != nil {

View File

@ -2,6 +2,7 @@ package dao
import ( import (
"context" "context"
_ "dubbo.apache.org/dubbo-go/v3/imports"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@ -511,7 +512,7 @@ func FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err er
func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, err error) { func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, err error) {
var ( var (
preUpdateData model.User preUpdateData model.User
tx = db.DB.Preload("RealNameInfo") tx = db.DB.Begin().Preload("RealNameInfo")
needUpdateMobile bool needUpdateMobile bool
) )
if req.Id != 0 { if req.Id != 0 {
@ -602,7 +603,7 @@ func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, e
// Htmltype: req.Htmltype, // Htmltype: req.Htmltype,
// Envtype: req.Envtype, // Envtype: req.Envtype,
//} //}
err = db.DB.Save(&preUpdateData).Error err = tx.Save(&preUpdateData).Error
//更新实名信息 //更新实名信息
if req.RealName != nil { if req.RealName != nil {
var realName = model.RealName{} var realName = model.RealName{}
@ -642,7 +643,7 @@ func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, e
//更新手机号码 //更新手机号码
if needUpdateMobile { if needUpdateMobile {
// 更新账号服务中手机号 // 更新账号服务中手机号
if _, err = service.AccountImpl.UpdateTelNum(context.Background(), &account.SendNewTelNumMsgRequest{ if _, err = service.AccountProvider.UpdateTelNum(context.Background(), &account.SendNewTelNumMsgRequest{
Domain: req.Domain, Domain: req.Domain,
ID: uint64(preUpdateData.MgmtAccId), ID: uint64(preUpdateData.MgmtAccId),
NewTelNum: preUpdateData.TelNum, NewTelNum: preUpdateData.TelNum,
@ -650,14 +651,17 @@ func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, e
Project: "", Project: "",
}); err != nil { }); err != nil {
fmt.Println("错误1-needUpdateMobile-AccountImpl.UpdateTelNum:", err.Error()) fmt.Println("错误1-needUpdateMobile-AccountImpl.UpdateTelNum:", err.Error())
tx.Rollback()
return return
} }
//更新画家服务中的手机号 //更新画家服务中的手机号
if _, err = service.GrpcArtistImpl.UpdateProfile(context.Background(), &artist.ProfileRequest{Uid: preUpdateData.MgmtArtistUid, Phone: preUpdateData.TelNum}); err != nil { if _, err = service.GrpcArtistImpl.UpdateProfile(context.Background(), &artist.ProfileRequest{Uid: preUpdateData.MgmtArtistUid, Phone: preUpdateData.TelNum}); err != nil {
fmt.Println("错误2-needUpdateMobile-rpcArtistImpl.UpdateProfile:", err.Error()) fmt.Println("错误2-needUpdateMobile-rpcArtistImpl.UpdateProfile:", err.Error())
tx.Rollback()
return return
} }
} }
tx.Commit()
return nil, nil return nil, nil
} }

View File

@ -44,6 +44,26 @@ dubbo:
ArtistClientImpl: ArtistClientImpl:
protocol: tri protocol: tri
interface: com.fontree.microservices.common.Artist interface: com.fontree.microservices.common.Artist
ArtistInfoClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtistInfo
ContractClientImpl:
timeout: 15s
protocol: tri
interface: com.fontree.microservices.common.contract
filter: cshutdown,sign
params:
.accessKeyId: "SYD8-Chain-04"
.secretAccessKey: "Al-Chain-FDF112"
ArtworkClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Artwork
ArtworkQueryClientImpl:
protocol: tri
interface: com.fontree.microservices.common.ArtworkQuery
SupplyClientImpl:
protocol: tri
interface: com.fontree.microservices.common.Supply
logger: logger:
zap-config: zap-config:
level: info # 日志级别 level: info # 日志级别

File diff suppressed because it is too large Load Diff

View File

@ -17,12 +17,15 @@
syntax = "proto3"; syntax = "proto3";
package account; package account;
import "github.com/mwitkow/go-proto-validators/validator.proto"; import "github.com/mwitkow/go-proto-validators@v0.3.2/validator.proto";
option go_package = "./;account"; option go_package = "./;account";
service Account { service Account {
rpc Login (LoginRequest) returns (TokenInfo) {} rpc Login (LoginRequest) returns (TokenInfo) {}
rpc Logout (DecryptJwtRequest) returns (CommonResponse) {}
rpc OffLine (CommonRequest) returns (CommonResponse) {}
rpc OnlineLog (LoginInfosByUserIdRequest) returns (LoginLogsResponse) {}//id获取登录的信息
rpc CheckPwd (CheckPwdRequest) returns (UpdateResponse) {}// rpc CheckPwd (CheckPwdRequest) returns (UpdateResponse) {}//
rpc Register (RegistRequest) returns (RequestStatus) {} rpc Register (RegistRequest) returns (RequestStatus) {}
rpc SendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {} rpc SendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {}
@ -43,6 +46,31 @@ service Account {
rpc UserByTel (UserByTelRequest) returns (InfoResponse) {} rpc UserByTel (UserByTelRequest) returns (InfoResponse) {}
} }
message CommonRequest {
uint64 ID = 1 [json_name = "ID"];
}
message LoginLogsResponse {
repeated LoginLog Data = 1 [json_name = "data"];
}
message LoginLog {
string Domain = 1 [json_name = "domain"];
uint64 ID = 2 [json_name = "ID"];
uint64 UserId = 3 [json_name = "userId"];
string Ip = 4 [json_name = "ip"];
string Token = 5 [json_name = "token"];
uint64 Status = 6 [json_name = "status"];
string ExpireDate = 7 [json_name = "expireDate"];
string LastDate = 8 [json_name = "lastDate"];
string LogoutDate = 9 [json_name = "logoutDate"];
}
message LoginInfosByUserIdRequest {
string Domain = 1 [json_name = "domain"];
uint64 UserId = 2 [json_name = "userId"];
}
message SendNewTelNumMsgRequest { message SendNewTelNumMsgRequest {
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ]; string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
uint64 ID = 2 [json_name = "ID",(validator.field) = {string_not_empty: true,human_error: "缺少参数"} ]; uint64 ID = 2 [json_name = "ID",(validator.field) = {string_not_empty: true,human_error: "缺少参数"} ];
@ -56,6 +84,9 @@ message UserByTelRequest {
string Tel =2 [json_name = "tel"]; string Tel =2 [json_name = "tel"];
} }
message CommonResponse {
}
message UsersByTelRequest { message UsersByTelRequest {
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ]; string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
repeated string Tels =2 [json_name = "tels"]; repeated string Tels =2 [json_name = "tels"];
@ -63,11 +94,13 @@ message UsersByTelRequest {
message ListByIDsRequest { message ListByIDsRequest {
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ]; string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
repeated uint64 IDs =2 [json_name = "IDs"]; repeated uint64 IDs = 2 [json_name = "IDs"];
uint64 OrderType =3 [json_name = "OrderType"]; uint64 OrderType = 3 [json_name = "OrderType"];
uint64 Page =4 [json_name = "page"]; uint64 Page = 4 [json_name = "page"];
uint64 PageSize =5 [json_name = "pageSize"]; uint64 PageSize = 5 [json_name = "pageSize"];
string NickName =6 [json_name = "nickName"]; string NickName = 6 [json_name = "nickName"];
repeated string InvitationCode = 7 [json_name = "invitationCode"];
} }
message SendMsgRequest { message SendMsgRequest {
@ -144,14 +177,16 @@ message InfoResponse {
} }
message DecryptJwtResponse { message DecryptJwtResponse {
string Domain = 1 [json_name = "status"]; string Domain = 1 [json_name = "status"];
uint64 ID = 2 [json_name = "id"]; uint64 ID = 2 [json_name = "id"];
string Account = 3 [json_name = "account"]; string Account = 3 [json_name = "account"];
string NickName = 4 [json_name = "nickName"]; string NickName = 4 [json_name = "nickName"];
bool IsOffline = 5 [json_name = "isOffline"];
} }
message DecryptJwtRequest { message DecryptJwtRequest {
string token = 1 [json_name = "token"]; string token = 1 [json_name = "token"];
string Domain = 2 [json_name = "Domain"];
} }
message CheckPwdRequest { message CheckPwdRequest {
@ -189,6 +224,7 @@ message LoginRequest {
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}]; string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
string Code = 3 [json_name = "code"]; string Code = 3 [json_name = "code"];
string Password = 4 [json_name = "password"]; string Password = 4 [json_name = "password"];
string Ip = 5 [json_name = "ip"];
} }
message TokenInfo { message TokenInfo {
@ -231,4 +267,7 @@ message AccountInfo {
uint64 Sex = 21 [json_name = "sex"]; uint64 Sex = 21 [json_name = "sex"];
string Title = 22 [json_name = "title"]; string Title = 22 [json_name = "title"];
repeated Department Departments = 23 [json_name = "departments"]; repeated Department Departments = 23 [json_name = "departments"];
string Ip = 24 [json_name = "ip"];
string LoginDate = 25 [json_name = "loginDate"];
string InvitationCode = 26 [json_name = "invitationCode"];
} }

View File

@ -17,6 +17,25 @@ var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
func (this *CommonRequest) Validate() error {
return nil
}
func (this *LoginLogsResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *LoginLog) Validate() error {
return nil
}
func (this *LoginInfosByUserIdRequest) Validate() error {
return nil
}
func (this *SendNewTelNumMsgRequest) Validate() error { func (this *SendNewTelNumMsgRequest) Validate() error {
if this.Domain == "" { if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`)) return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
@ -29,6 +48,9 @@ func (this *UserByTelRequest) Validate() error {
} }
return nil return nil
} }
func (this *CommonResponse) Validate() error {
return nil
}
func (this *UsersByTelRequest) Validate() error { func (this *UsersByTelRequest) Validate() error {
if this.Domain == "" { if this.Domain == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`)) return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT. // Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-triple v1.0.5 // - protoc-gen-go-triple v1.0.8
// - protoc v3.21.2 // - protoc v3.21.12
// source: api/account/account.proto // source: api/account/account.proto
package account package account
@ -29,6 +29,9 @@ const _ = grpc_go.SupportPackageIsVersion7
// 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. // 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 AccountClient interface { type AccountClient interface {
Login(ctx context.Context, in *LoginRequest, opts ...grpc_go.CallOption) (*TokenInfo, common.ErrorWithAttachment) Login(ctx context.Context, in *LoginRequest, opts ...grpc_go.CallOption) (*TokenInfo, common.ErrorWithAttachment)
Logout(ctx context.Context, in *DecryptJwtRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
OffLine(ctx context.Context, in *CommonRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
OnlineLog(ctx context.Context, in *LoginInfosByUserIdRequest, opts ...grpc_go.CallOption) (*LoginLogsResponse, common.ErrorWithAttachment)
CheckPwd(ctx context.Context, in *CheckPwdRequest, opts ...grpc_go.CallOption) (*UpdateResponse, common.ErrorWithAttachment) CheckPwd(ctx context.Context, in *CheckPwdRequest, opts ...grpc_go.CallOption) (*UpdateResponse, common.ErrorWithAttachment)
Register(ctx context.Context, in *RegistRequest, opts ...grpc_go.CallOption) (*RequestStatus, common.ErrorWithAttachment) Register(ctx context.Context, in *RegistRequest, opts ...grpc_go.CallOption) (*RequestStatus, common.ErrorWithAttachment)
SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment) SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
@ -55,6 +58,9 @@ type accountClient struct {
type AccountClientImpl struct { type AccountClientImpl struct {
Login func(ctx context.Context, in *LoginRequest) (*TokenInfo, error) Login func(ctx context.Context, in *LoginRequest) (*TokenInfo, error)
Logout func(ctx context.Context, in *DecryptJwtRequest) (*CommonResponse, error)
OffLine func(ctx context.Context, in *CommonRequest) (*CommonResponse, error)
OnlineLog func(ctx context.Context, in *LoginInfosByUserIdRequest) (*LoginLogsResponse, error)
CheckPwd func(ctx context.Context, in *CheckPwdRequest) (*UpdateResponse, error) CheckPwd func(ctx context.Context, in *CheckPwdRequest) (*UpdateResponse, error)
Register func(ctx context.Context, in *RegistRequest) (*RequestStatus, error) Register func(ctx context.Context, in *RegistRequest) (*RequestStatus, error)
SendMsg func(ctx context.Context, in *SendMsgRequest) (*SendMsgStatusResponse, error) SendMsg func(ctx context.Context, in *SendMsgRequest) (*SendMsgStatusResponse, error)
@ -93,6 +99,24 @@ func (c *accountClient) Login(ctx context.Context, in *LoginRequest, opts ...grp
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Login", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Login", in, out)
} }
func (c *accountClient) Logout(ctx context.Context, in *DecryptJwtRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Logout", in, out)
}
func (c *accountClient) OffLine(ctx context.Context, in *CommonRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OffLine", in, out)
}
func (c *accountClient) OnlineLog(ctx context.Context, in *LoginInfosByUserIdRequest, opts ...grpc_go.CallOption) (*LoginLogsResponse, common.ErrorWithAttachment) {
out := new(LoginLogsResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlineLog", in, out)
}
func (c *accountClient) CheckPwd(ctx context.Context, in *CheckPwdRequest, opts ...grpc_go.CallOption) (*UpdateResponse, common.ErrorWithAttachment) { func (c *accountClient) CheckPwd(ctx context.Context, in *CheckPwdRequest, opts ...grpc_go.CallOption) (*UpdateResponse, common.ErrorWithAttachment) {
out := new(UpdateResponse) out := new(UpdateResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -206,6 +230,9 @@ func (c *accountClient) UserByTel(ctx context.Context, in *UserByTelRequest, opt
// for forward compatibility // for forward compatibility
type AccountServer interface { type AccountServer interface {
Login(context.Context, *LoginRequest) (*TokenInfo, error) Login(context.Context, *LoginRequest) (*TokenInfo, error)
Logout(context.Context, *DecryptJwtRequest) (*CommonResponse, error)
OffLine(context.Context, *CommonRequest) (*CommonResponse, error)
OnlineLog(context.Context, *LoginInfosByUserIdRequest) (*LoginLogsResponse, error)
CheckPwd(context.Context, *CheckPwdRequest) (*UpdateResponse, error) CheckPwd(context.Context, *CheckPwdRequest) (*UpdateResponse, error)
Register(context.Context, *RegistRequest) (*RequestStatus, error) Register(context.Context, *RegistRequest) (*RequestStatus, error)
SendMsg(context.Context, *SendMsgRequest) (*SendMsgStatusResponse, error) SendMsg(context.Context, *SendMsgRequest) (*SendMsgStatusResponse, error)
@ -235,6 +262,15 @@ type UnimplementedAccountServer struct {
func (UnimplementedAccountServer) Login(context.Context, *LoginRequest) (*TokenInfo, error) { func (UnimplementedAccountServer) Login(context.Context, *LoginRequest) (*TokenInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
} }
func (UnimplementedAccountServer) Logout(context.Context, *DecryptJwtRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
}
func (UnimplementedAccountServer) OffLine(context.Context, *CommonRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OffLine not implemented")
}
func (UnimplementedAccountServer) OnlineLog(context.Context, *LoginInfosByUserIdRequest) (*LoginLogsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OnlineLog not implemented")
}
func (UnimplementedAccountServer) CheckPwd(context.Context, *CheckPwdRequest) (*UpdateResponse, error) { func (UnimplementedAccountServer) CheckPwd(context.Context, *CheckPwdRequest) (*UpdateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckPwd not implemented") return nil, status.Errorf(codes.Unimplemented, "method CheckPwd not implemented")
} }
@ -346,6 +382,93 @@ func _Account_Login_Handler(srv interface{}, ctx context.Context, dec func(inter
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Account_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DecryptJwtRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Logout", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Account_OffLine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CommonRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("OffLine", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Account_OnlineLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginInfosByUserIdRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("OnlineLog", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Account_CheckPwd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Account_CheckPwd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckPwdRequest) in := new(CheckPwdRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -879,6 +1002,18 @@ var Account_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "Login", MethodName: "Login",
Handler: _Account_Login_Handler, Handler: _Account_Login_Handler,
}, },
{
MethodName: "Logout",
Handler: _Account_Logout_Handler,
},
{
MethodName: "OffLine",
Handler: _Account_OffLine_Handler,
},
{
MethodName: "OnlineLog",
Handler: _Account_OnlineLog_Handler,
},
{ {
MethodName: "CheckPwd", MethodName: "CheckPwd",
Handler: _Account_CheckPwd_Handler, Handler: _Account_CheckPwd_Handler,

View File

@ -2,16 +2,25 @@ package service
import ( import (
"dubbo.apache.org/dubbo-go/v3/config" "dubbo.apache.org/dubbo-go/v3/config"
//_ "dubbo.apache.org/dubbo-go/v3/imports"
"github.com/fonchain/fonchain-artistinfo/pb/account" "github.com/fonchain/fonchain-artistinfo/pb/account"
"github.com/fonchain/fonchain-artistinfo/pb/artist" "github.com/fonchain/fonchain-artistinfo/pb/artist"
) )
var ( var (
GrpcArtistImpl = new(artist.ArtistClientImpl) GrpcArtistImpl = new(artist.ArtistClientImpl)
AccountImpl = new(account.AccountClientImpl)
AccountProvider = new(account.AccountClientImpl)
) )
func init() { func init() {
config.SetConsumerService(GrpcArtistImpl) config.SetConsumerService(GrpcArtistImpl)
config.SetConsumerService(AccountImpl) config.SetConsumerService(AccountProvider)
//if os.Args[len(os.Args)-1] == "unit-test" {
// _ = os.Setenv(constant.ConfigFileEnvKey, "../../conf/dubbogo.yaml")
//}
//fmt.Println(os.Getenv(constant.ConfigFileEnvKey))
//if err := config.Load(); err != nil {
// panic(err)
//}
} }