Merge branch 'master' of gitlab.fusenpack.com:backend/proto

This commit is contained in:
menghaiwen@fusen.cn 2023-12-07 16:25:36 +08:00
commit 32a243afab
3 changed files with 24 additions and 29 deletions

View File

@ -1082,19 +1082,17 @@ func parseGoFile(filePath string) (ClientParams []*ClientParam) {
} else if iface, ok := typeSpec.Type.(*ast.InterfaceType); ok {
interfaceName := typeSpec.Name.Name
if len(iface.Methods.List) == 3 {
if len(iface.Methods.List[0].Names) == 1 && len(iface.Methods.List[1].Names) == 1 {
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)
if getTypeString(iface.Methods.List[2].Type) == "grpc.ClientStream" {
// MethodType = "stream"
// log.Println(interfaceName)
if len(iface.Methods.List) >= 3 {
if len(iface.Methods.List[2].Names) == 0 {
continue
}
// log.Println(name0, name1)
if getTypeString(iface.Methods.List[2].Type) == "grpc.ClientStream" {
// MethodType = "stream"
// log.Println(interfaceName)
continue
}
}
}

View File

@ -1,17 +1,8 @@
package test
import (
"bytes"
"encoding/json"
"fmt"
"{{.ProjectName}}/server/config"
"fusen-basic/env"
"fusen-basic/utils/log"
"net/http"
"net/url"
"reflect"
"strings"
"time"
)
var fusen *env.Fusen[config.Config]

View File

@ -14,13 +14,7 @@ import "google/protobuf/any.proto";
service auth {
//
rpc ValidToken(ValidTokenRequest) returns (ValidTokenResponse) {
// HTTP POST
option (google.api.http) = {
post: "/api/auth/valid/token"
body: "*"
};
}
rpc ValidToken(ValidTokenRequest) returns (ValidTokenResponse) {}
//
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的请求
message ValidTokenRequest {
optional string user_token = 1;
@ -130,8 +137,7 @@ message ValidTokenRequest {
// token的请求
message ValidTokenResponse {
google.protobuf.Struct user_info = 1;
google.protobuf.Struct debug_info = 2;
UserInfo user_info = 1;
}