Merge branch 'master' of gitlab.fusenpack.com:backend/proto
This commit is contained in:
commit
32a243afab
|
@ -1082,11 +1082,9 @@ func parseGoFile(filePath string) (ClientParams []*ClientParam) {
|
||||||
} else if iface, ok := typeSpec.Type.(*ast.InterfaceType); ok {
|
} else if iface, ok := typeSpec.Type.(*ast.InterfaceType); ok {
|
||||||
interfaceName := typeSpec.Name.Name
|
interfaceName := typeSpec.Name.Name
|
||||||
|
|
||||||
if len(iface.Methods.List) == 3 {
|
if len(iface.Methods.List) >= 3 {
|
||||||
if len(iface.Methods.List[0].Names) == 1 && len(iface.Methods.List[1].Names) == 1 {
|
if len(iface.Methods.List[2].Names) == 0 {
|
||||||
name0 := iface.Methods.List[0].Names[0].Name
|
|
||||||
name1 := iface.Methods.List[1].Names[0].Name
|
|
||||||
if name0 == "Send" && name1 == "CloseAndRecv" {
|
|
||||||
// log.Println(name0, name1)
|
// log.Println(name0, name1)
|
||||||
if getTypeString(iface.Methods.List[2].Type) == "grpc.ClientStream" {
|
if getTypeString(iface.Methods.List[2].Type) == "grpc.ClientStream" {
|
||||||
// MethodType = "stream"
|
// MethodType = "stream"
|
||||||
|
@ -1094,7 +1092,7 @@ func parseGoFile(filePath string) (ClientParams []*ClientParam) {
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"{{.ProjectName}}/server/config"
|
"{{.ProjectName}}/server/config"
|
||||||
"fusen-basic/env"
|
"fusen-basic/env"
|
||||||
"fusen-basic/utils/log"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"reflect"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var fusen *env.Fusen[config.Config]
|
var fusen *env.Fusen[config.Config]
|
||||||
|
|
|
@ -14,13 +14,7 @@ import "google/protobuf/any.proto";
|
||||||
service auth {
|
service auth {
|
||||||
|
|
||||||
// 登录接口
|
// 登录接口
|
||||||
rpc ValidToken(ValidTokenRequest) returns (ValidTokenResponse) {
|
rpc ValidToken(ValidTokenRequest) returns (ValidTokenResponse) {}
|
||||||
// 添加 HTTP POST 网关注解
|
|
||||||
option (google.api.http) = {
|
|
||||||
post: "/api/auth/valid/token"
|
|
||||||
body: "*"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// 登录接口
|
// 登录接口
|
||||||
rpc Login(UserLoginRequest) returns (UserLoginResponse) {
|
rpc Login(UserLoginRequest) returns (UserLoginResponse) {
|
||||||
|
@ -121,6 +115,19 @@ service auth {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message Debug {
|
||||||
|
int64 exp = 1;
|
||||||
|
int64 is_cache = 2;
|
||||||
|
int64 is_all_template_tag = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message UserInfo {
|
||||||
|
int64 user_id = 1;
|
||||||
|
int64 guest_id = 2;
|
||||||
|
int64 exp = 3;
|
||||||
|
Debug debug = 4;
|
||||||
|
}
|
||||||
|
|
||||||
// 验证token的请求
|
// 验证token的请求
|
||||||
message ValidTokenRequest {
|
message ValidTokenRequest {
|
||||||
optional string user_token = 1;
|
optional string user_token = 1;
|
||||||
|
@ -130,8 +137,7 @@ message ValidTokenRequest {
|
||||||
|
|
||||||
// 验证token的请求
|
// 验证token的请求
|
||||||
message ValidTokenResponse {
|
message ValidTokenResponse {
|
||||||
google.protobuf.Struct user_info = 1;
|
UserInfo user_info = 1;
|
||||||
google.protobuf.Struct debug_info = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user