Selaa lähdekoodia

获取公众号配置

wfz 3 vuotta sitten
vanhempi
commit
fba464caee

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 418 - 318
api/account/account.pb.go


+ 15 - 0
api/account/account.proto

@@ -37,6 +37,13 @@ service Account {
       body:"*"
     };
   };
+  // 获取公众号配置
+  rpc GetGetGzhConfig (google.protobuf.Empty) returns (GetGetGzhConfigReply){
+    option (google.api.http) = {
+      post: "/api/common/gzh/conf",
+      body:"*"
+    };
+  };
   rpc RandomAvatarList (common.SexReq) returns (RandomAvatarListReply){};
   // 通过openID和appID查询
   rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
@@ -85,6 +92,14 @@ service Account {
   rpc UserUnsubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
 }
 
+message GetGetGzhConfigReply{
+  string appId  = 1;// 公众号Id
+  string name  = 2;// 公众号名称
+  string imageUrl  = 3;// 公众号图片
+  string privacyPolicyUrl  = 4;// 公众号隐私政策链接
+  string userAgreementUrl  = 5;// 公众号用户协议链接
+}
+
 message GetIdentifyByAccountIDRequest{
   int64 accountId = 1;
   string appid = 2;

+ 38 - 0
api/account/account_grpc.pb.go

@@ -24,6 +24,8 @@ type AccountClient interface {
 	Authorization(ctx context.Context, in *AuthorizationRequest, opts ...grpc.CallOption) (*TokenReply, error)
 	RandomNickname(ctx context.Context, in *common.SexReq, opts ...grpc.CallOption) (*RandomNicknameReply, error)
 	RandomAvatar(ctx context.Context, in *common.SexReq, opts ...grpc.CallOption) (*RandomAvatarReply, error)
+	// 获取公众号配置
+	GetGetGzhConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetGetGzhConfigReply, error)
 	RandomAvatarList(ctx context.Context, in *common.SexReq, opts ...grpc.CallOption) (*RandomAvatarListReply, error)
 	// 通过openID和appID查询
 	GetIdentityByOpenIDAndAppID(ctx context.Context, in *OpenIDAndAppIDRequest, opts ...grpc.CallOption) (*IdentityInfo, error)
@@ -101,6 +103,15 @@ func (c *accountClient) RandomAvatar(ctx context.Context, in *common.SexReq, opt
 	return out, nil
 }
 
+func (c *accountClient) GetGetGzhConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetGetGzhConfigReply, error) {
+	out := new(GetGetGzhConfigReply)
+	err := c.cc.Invoke(ctx, "/api.account.Account/GetGetGzhConfig", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *accountClient) RandomAvatarList(ctx context.Context, in *common.SexReq, opts ...grpc.CallOption) (*RandomAvatarListReply, error) {
 	out := new(RandomAvatarListReply)
 	err := c.cc.Invoke(ctx, "/api.account.Account/RandomAvatarList", in, out, opts...)
@@ -253,6 +264,8 @@ type AccountServer interface {
 	Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)
 	RandomNickname(context.Context, *common.SexReq) (*RandomNicknameReply, error)
 	RandomAvatar(context.Context, *common.SexReq) (*RandomAvatarReply, error)
+	// 获取公众号配置
+	GetGetGzhConfig(context.Context, *emptypb.Empty) (*GetGetGzhConfigReply, error)
 	RandomAvatarList(context.Context, *common.SexReq) (*RandomAvatarListReply, error)
 	// 通过openID和appID查询
 	GetIdentityByOpenIDAndAppID(context.Context, *OpenIDAndAppIDRequest) (*IdentityInfo, error)
@@ -303,6 +316,9 @@ func (UnimplementedAccountServer) RandomNickname(context.Context, *common.SexReq
 func (UnimplementedAccountServer) RandomAvatar(context.Context, *common.SexReq) (*RandomAvatarReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method RandomAvatar not implemented")
 }
+func (UnimplementedAccountServer) GetGetGzhConfig(context.Context, *emptypb.Empty) (*GetGetGzhConfigReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetGetGzhConfig not implemented")
+}
 func (UnimplementedAccountServer) RandomAvatarList(context.Context, *common.SexReq) (*RandomAvatarListReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method RandomAvatarList not implemented")
 }
@@ -436,6 +452,24 @@ func _Account_RandomAvatar_Handler(srv interface{}, ctx context.Context, dec fun
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Account_GetGetGzhConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(emptypb.Empty)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(AccountServer).GetGetGzhConfig(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.account.Account/GetGetGzhConfig",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(AccountServer).GetGetGzhConfig(ctx, req.(*emptypb.Empty))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Account_RandomAvatarList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(common.SexReq)
 	if err := dec(in); err != nil {
@@ -747,6 +781,10 @@ var Account_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "RandomAvatar",
 			Handler:    _Account_RandomAvatar_Handler,
 		},
+		{
+			MethodName: "GetGetGzhConfig",
+			Handler:    _Account_GetGetGzhConfig_Handler,
+		},
 		{
 			MethodName: "RandomAvatarList",
 			Handler:    _Account_RandomAvatarList_Handler,

+ 44 - 0
api/account/account_http.pb.go

@@ -11,6 +11,7 @@ import (
 	common "git.ikuban.com/server/pw-protobuf/api/common"
 	http "github.com/go-kratos/kratos/v2/transport/http"
 	binding "github.com/go-kratos/kratos/v2/transport/http/binding"
+	emptypb "google.golang.org/protobuf/types/known/emptypb"
 	ioutil "io/ioutil"
 	time "time"
 )
@@ -29,6 +30,7 @@ const _ = http.SupportPackageIsVersion1
 type AccountHTTPServer interface {
 	Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)
 	DebugLogin(context.Context, *DebugLoginRequest) (*TokenReply, error)
+	GetGetGzhConfig(context.Context, *emptypb.Empty) (*GetGetGzhConfigReply, error)
 	GetUserLoginConfig(context.Context, *common.GetLoginConfigRequest) (*common.GetLoginConfigReply, error)
 	RandomAvatar(context.Context, *common.SexReq) (*RandomAvatarReply, error)
 	RandomIntroduce(context.Context, *common.SexReq) (*common.RandomIntroduceReply, error)
@@ -42,6 +44,7 @@ func RegisterAccountHTTPServer(s *http.Server, srv AccountHTTPServer) {
 	r.POST("/api/login/authorization", _Account_Authorization0_HTTP_Handler(srv))
 	r.POST("/api/common/random/nickname", _Account_RandomNickname0_HTTP_Handler(srv))
 	r.POST("/api/common/random/avatar", _Account_RandomAvatar0_HTTP_Handler(srv))
+	r.POST("/api/common/gzh/conf", _Account_GetGetGzhConfig0_HTTP_Handler(srv))
 	r.POST("/api/common/random/introduce", _Account_RandomIntroduce0_HTTP_Handler(srv))
 	r.POST("/api/common/material/upload/voice", _Account_UploadMaterialVoice0_HTTP_Handler(srv))
 	r.POST("/api/login/config", _Account_GetUserLoginConfig0_HTTP_Handler(srv))
@@ -155,6 +158,33 @@ func _Account_RandomAvatar0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Co
 	}
 }
 
+func _Account_GetGetGzhConfig0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
+	return func(ctx http.Context) error {
+		var in emptypb.Empty
+		if err := ctx.Bind(&in); err != nil {
+			return err
+		}
+		if err := ctx.BindQuery(&in); err != nil {
+			return err
+		}
+		http.SetOperation(ctx, "/api.account.Account/GetGetGzhConfig")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.GetGetGzhConfig(ctx, req.(*emptypb.Empty))
+		})
+		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)
+	}
+}
+
 func _Account_RandomIntroduce0_HTTP_Handler(srv AccountHTTPServer) func(ctx http.Context) error {
 	return func(ctx http.Context) error {
 		var in common.SexReq
@@ -239,6 +269,7 @@ func _Account_GetUserLoginConfig0_HTTP_Handler(srv AccountHTTPServer) func(ctx h
 type AccountHTTPClient interface {
 	Authorization(ctx context.Context, req *AuthorizationRequest, opts ...http.CallOption) (rsp *TokenReply, err error)
 	DebugLogin(ctx context.Context, req *DebugLoginRequest, opts ...http.CallOption) (rsp *TokenReply, err error)
+	GetGetGzhConfig(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *GetGetGzhConfigReply, err error)
 	GetUserLoginConfig(ctx context.Context, req *common.GetLoginConfigRequest, opts ...http.CallOption) (rsp *common.GetLoginConfigReply, err error)
 	RandomAvatar(ctx context.Context, req *common.SexReq, opts ...http.CallOption) (rsp *RandomAvatarReply, err error)
 	RandomIntroduce(ctx context.Context, req *common.SexReq, opts ...http.CallOption) (rsp *common.RandomIntroduceReply, err error)
@@ -280,6 +311,19 @@ func (c *AccountHTTPClientImpl) DebugLogin(ctx context.Context, in *DebugLoginRe
 	return &out, err
 }
 
+func (c *AccountHTTPClientImpl) GetGetGzhConfig(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*GetGetGzhConfigReply, error) {
+	var out GetGetGzhConfigReply
+	pattern := "/api/common/gzh/conf"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.account.Account/GetGetGzhConfig"))
+	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
+}
+
 func (c *AccountHTTPClientImpl) GetUserLoginConfig(ctx context.Context, in *common.GetLoginConfigRequest, opts ...http.CallOption) (*common.GetLoginConfigReply, error) {
 	var out common.GetLoginConfigReply
 	pattern := "/api/login/config"

+ 6 - 1
js/api/account/account_http_pb.ts

@@ -1,6 +1,6 @@
 // @ts-ignore
 import request from '@/libs/request';
-import {DebugLoginRequest,TokenReply,AuthorizationRequest,RandomNicknameReply,RandomAvatarReply,RandomAvatarListReply,OpenIDAndAppIDRequest,IdentityInfo,MediaID,MaterialLink,CheckTextRequest,CheckTextReply,GetIdentifyByAccountIDRequest,GetIdentifyByAccountIDReply} from "./account_pb";
+import {DebugLoginRequest,TokenReply,AuthorizationRequest,RandomNicknameReply,RandomAvatarReply,GetGetGzhConfigReply,RandomAvatarListReply,OpenIDAndAppIDRequest,IdentityInfo,MediaID,MaterialLink,CheckTextRequest,CheckTextReply,GetIdentifyByAccountIDRequest,GetIdentifyByAccountIDReply} from "./account_pb";
 import {SexReq,TagListReply,Ids,RandomIntroduceReply,MemeRequest,MemeList,FindChatTopicRequest,ChatTopicList,RandomNum,CommonTextList,RandomNumAndSex,GetLoginConfigRequest,GetLoginConfigReply} from "../common/common_pb";
 
 const AccountService = {
@@ -20,6 +20,11 @@ const AccountService = {
 	const res = await request.post<{ data: RandomAvatarReply, code: string, message: string }>('/api/common/random/avatar', req);
     return res.data.data;
   },
+  /**  获取公众号配置 */
+  GetGetGzhConfig: async (req?: undefined) => {
+	const res = await request.post<{ data: GetGetGzhConfigReply, code: string, message: string }>('/api/common/gzh/conf', req);
+    return res.data.data;
+  },
   /**  随机介绍接口 */
   RandomIntroduce: async (req?: SexReq) => {
 	const res = await request.post<{ data: RandomIntroduceReply, code: string, message: string }>('/api/common/random/introduce', req);

+ 12 - 0
js/api/account/account_pb.ts

@@ -1,3 +1,15 @@
+export interface GetGetGzhConfigReply{
+    /**  公众号Id */
+    appId?:string;
+    /**  公众号名称 */
+    name?:string;
+    /**  公众号图片 */
+    imageUrl?:string;
+    /**  公众号隐私政策链接 */
+    privacyPolicyUrl?:string;
+    /**  公众号用户协议链接 */
+    userAgreementUrl?:string;
+}
 export interface GetIdentifyByAccountIDRequest{
     accountId?:number;
     appid?:string;

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä