Compare commits
No commits in common. "d153a6544b36ae1de85edfdaaacff448df65ab5d" and "8008fd4ddb6e5236284a8b9e43c431f8f591ab6e" have entirely different histories.
d153a6544b
...
8008fd4ddb
@ -30,6 +30,7 @@ func AutoGrpcInit(obj any) {
|
|||||||
|
|
||||||
for i := 0; i < value.NumField(); i++ {
|
for i := 0; i < value.NumField(); i++ {
|
||||||
v := value.Field(i)
|
v := value.Field(i)
|
||||||
|
|
||||||
if v.IsValid() {
|
if v.IsValid() {
|
||||||
_namingClient, ok := v.Interface().(naming_client.INamingClient)
|
_namingClient, ok := v.Interface().(naming_client.INamingClient)
|
||||||
if ok {
|
if ok {
|
||||||
@ -41,6 +42,7 @@ func AutoGrpcInit(obj any) {
|
|||||||
|
|
||||||
{{range .ClientParams}}
|
{{range .ClientParams}}
|
||||||
|
|
||||||
|
|
||||||
func Auto{{.ClientName}}Client(ctx context.Context) {{.ClientName}}Client {
|
func Auto{{.ClientName}}Client(ctx context.Context) {{.ClientName}}Client {
|
||||||
if namingClient == nil {
|
if namingClient == nil {
|
||||||
log.Println("nameClient must be init. call")
|
log.Println("nameClient must be init. call")
|
||||||
@ -52,54 +54,52 @@ func Auto{{.ClientName}}Client(ctx context.Context) {{.ClientName}}Client {
|
|||||||
GroupName: groupName,
|
GroupName: groupName,
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
insService, err := namingClient.SelectOneHealthyInstance(sel)
|
insService, err := namingClient.SelectOneHealthyInstance(sel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
continue
|
return nil
|
||||||
}
|
}
|
||||||
if insService.Enable && insService.Healthy {
|
if insService.Enable && insService.Healthy {
|
||||||
|
|
||||||
conn, err := grpc.DialContext(ctx, fmt.Sprintf("%s:%d", insService.Ip, insService.Port), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
conn, err := grpc.DialContext(ctx, fmt.Sprintf("%s:%d", insService.Ip, insService.Port), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
continue
|
return nil
|
||||||
}
|
}
|
||||||
return New{{.ClientName}}Client(conn)
|
return New{{.ClientName}}Client(conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Println(fmt.Errorf("no healthy with times 3"))
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func Auto{{.ClientName}}ClientEx(ctx context.Context, opts ...grpc.DialOption) ({{.ClientName}}Client,error) {
|
func Auto{{.ClientName}}ClientEx(ctx context.Context, opts ...grpc.DialOption) ({{.ClientName}}Client,error) {
|
||||||
if namingClient == nil {
|
if namingClient == nil {
|
||||||
return nil, fmt.Errorf("nameClient must be init. call")
|
return nil, fmt.Errorf("nameClient must be init. call")
|
||||||
}
|
}
|
||||||
|
|
||||||
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
|
||||||
|
|
||||||
sel := vo.SelectOneHealthInstanceParam{
|
sel := vo.SelectOneHealthInstanceParam{
|
||||||
ServiceName: "{{.GrpcServiceName}}",
|
ServiceName: "{{.GrpcServiceName}}",
|
||||||
GroupName: groupName,
|
GroupName: groupName,
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
insService, err := namingClient.SelectOneHealthyInstance(sel)
|
insService, err := namingClient.SelectOneHealthyInstance(sel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
return nil, err
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
if insService.Enable && insService.Healthy {
|
if insService.Enable && insService.Healthy {
|
||||||
conn, err := grpc.DialContext(ctx, fmt.Sprintf("%s:%d", insService.Ip, insService.Port), opts...)
|
conn, err := grpc.DialContext(ctx, fmt.Sprintf("%s:%d", insService.Ip, insService.Port), opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
return nil, err
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
return New{{.ClientName}}Client(conn), nil
|
return New{{.ClientName}}Client(conn), nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("no healthy with times 3")
|
return nil, fmt.Errorf("no healthy with times 10")
|
||||||
}
|
}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
@ -5,10 +5,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime/debug"
|
|
||||||
|
|
||||||
"fusen-basic/env"
|
"fusen-basic/env"
|
||||||
"fusen-basic/utils/log"
|
|
||||||
|
|
||||||
"{{.ProjectName}}/gen/go/service"
|
"{{.ProjectName}}/gen/go/service"
|
||||||
"{{.ProjectName}}/server/config"
|
"{{.ProjectName}}/server/config"
|
||||||
@ -55,7 +53,6 @@ func (lgrpc *{{.StructName}}Grpc) {{.MethodName}}({{range $index, $param := .Par
|
|||||||
if _recoverErr := recover(); _recoverErr != nil {
|
if _recoverErr := recover(); _recoverErr != nil {
|
||||||
_resp = nil
|
_resp = nil
|
||||||
_err = fmt.Errorf("%v", _recoverErr)
|
_err = fmt.Errorf("%v", _recoverErr)
|
||||||
log.Printf("recovered from panic: %v\n%s", _err, string(debug.Stack()))
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return New{{.StructName}}(ctx).{{.MethodName}}Logic({{range $index, $param := .ParamsName}}{{if $index}}, {{end}}{{$param}}{{end}})
|
return New{{.StructName}}(ctx).{{.MethodName}}Logic({{range $index, $param := .ParamsName}}{{if $index}}, {{end}}{{$param}}{{end}})
|
||||||
@ -67,7 +64,6 @@ func (lgrpc *{{.StructName}}Grpc) {{.MethodName}}(stream {{range $index, $param
|
|||||||
defer func() {
|
defer func() {
|
||||||
if _recoverErr := recover(); _recoverErr != nil {
|
if _recoverErr := recover(); _recoverErr != nil {
|
||||||
_err = fmt.Errorf("%v", _recoverErr)
|
_err = fmt.Errorf("%v", _recoverErr)
|
||||||
log.Printf("recovered from panic: %v\n%s", _err, string(debug.Stack()))
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return New{{.StructName}}(stream.Context()).{{.MethodName}}Logic(stream)
|
return New{{.StructName}}(stream.Context()).{{.MethodName}}Logic(stream)
|
||||||
|
@ -1,38 +1,25 @@
|
|||||||
#! /bin/env bash
|
#! /bin/bash
|
||||||
|
|
||||||
input_string=$(cat go.mod)
|
input_string=$(cat go.mod)
|
||||||
|
|
||||||
# 使用sed命令提取参数并替换输出格式
|
# 使用sed命令提取参数并替换输出格式
|
||||||
output=$(echo "$input_string" | sed -nE 's/[[:space:]]{0,}(replace[[:space:]]+)?([[:alnum:]-]+)[[:space:]]+([[:alnum:].-]+)[[:space:]]+=>[[:space:]]+([[:alnum:]/.-]+)[[:space:]]+([[:alnum:].-]+)/\2 \3 \4 \5/p')
|
output=$(echo "$input_string" | sed -nE 's/[[:space:]]{0,}(replace[[:space:]]+)?([[:alnum:]-]+)[[:space:]]+([[:alnum:].-]+)[[:space:]]+=>[[:space:]]+([[:alnum:]/.-]+)[[:space:]]+([[:alnum:].-]+)/\2 \3 \4 \5/p')
|
||||||
|
|
||||||
# echo $output
|
IFS=$'\n' # 设置分隔符为换行符
|
||||||
ischange="no"
|
for out in $output; do
|
||||||
|
IFS=$' '
|
||||||
|
read -r fsname fsversion fsfullname fslatest_master <<< "$out"
|
||||||
|
laster_master=`echo $(GOPROXY=direct go get $fsfullname@master 2>&1) | grep -oE '@v[^:"]+'`
|
||||||
|
echo "go mod edit -replace $fsname@$fsversion=$fsfullname$laster_master"
|
||||||
|
go mod edit -replace $fsname@$fsversion=$fsfullname$laster_master
|
||||||
|
done
|
||||||
|
|
||||||
IFS=$'\n' # 设置分隔符为换行符
|
IFS=$'\n' # 设置分隔符为换行符
|
||||||
for out in $output; do
|
for out in $output; do
|
||||||
IFS=$' '
|
IFS=$' '
|
||||||
read -r fsname fsversion fsfullname fslatest_master <<< "$out"
|
read -r fsname fsversion fsfullname fslatest_master <<< "$out"
|
||||||
if [ "$fsname" != "fusen-basic" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
laster_master=`echo $(GOPROXY=direct go get $fsfullname@master 2>&1) | grep -oE '@v[^:"]+'`
|
|
||||||
if [ "@$fslatest_master" == "$laster_master" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "go mod edit -replace $fsname@$fsversion=$fsfullname$laster_master"
|
|
||||||
go mod edit -replace $fsname@$fsversion=$fsfullname$laster_master
|
|
||||||
echo "当前 $fsname $fsfullname $fslatest_master (更新)-> $laster_master"
|
|
||||||
go get $fsname@$fsversion
|
go get $fsname@$fsversion
|
||||||
ischange="yes"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
if [ "$ischange" == "yes" ]; then
|
|
||||||
echo "go tidy and vendor"
|
|
||||||
go mod tidy
|
go mod tidy
|
||||||
go mod vendor
|
go mod vendor
|
||||||
else
|
|
||||||
echo "$fsname $fslatest_master 当前最新"
|
|
||||||
fi
|
|
||||||
|
@ -10,7 +10,7 @@ import "service/basic.proto";
|
|||||||
//定义服务
|
//定义服务
|
||||||
service auth {
|
service auth {
|
||||||
|
|
||||||
// 检验接口
|
// 登录接口
|
||||||
rpc ValidToken(ValidTokenRequest) returns (ValidTokenResponse) {}
|
rpc ValidToken(ValidTokenRequest) returns (ValidTokenResponse) {}
|
||||||
|
|
||||||
// Cookie 接受接口
|
// Cookie 接受接口
|
||||||
|
@ -27,41 +27,12 @@ message ResourceInfo{
|
|||||||
string bucket_name = 8;
|
string bucket_name = 8;
|
||||||
string source = 9;
|
string source = 9;
|
||||||
string uploaded_at = 10;
|
string uploaded_at = 10;
|
||||||
bytes metadata = 11;
|
google.protobuf.Struct metadata = 11;
|
||||||
string trace_id = 12;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message Meta {
|
message Meta {
|
||||||
int64 total_count =1; // 总数
|
int64 total_count =1;
|
||||||
int64 page_count=2; // 总页数
|
int64 page_count=2;
|
||||||
int64 current_page=3; // 当前页码
|
int64 current_page=3;
|
||||||
int64 per_page=4; // 每页数量
|
int64 per_page=4;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 用户信息
|
|
||||||
message FsUser {
|
|
||||||
int64 user_id = 7;//用户ID
|
|
||||||
string email = 1; // 邮箱
|
|
||||||
string first_name = 2; // 名
|
|
||||||
string last_name = 3; // 姓
|
|
||||||
string username = 4; // 用户名称
|
|
||||||
string company = 5; // 公司
|
|
||||||
string mobile = 6; // 电话号码
|
|
||||||
}
|
|
||||||
|
|
||||||
message LdapUser {
|
|
||||||
int64 user_id = 1; //用户id
|
|
||||||
string user_dn = 2; //用户dn
|
|
||||||
string user_name = 3; //用户名
|
|
||||||
string email = 4; //邮箱
|
|
||||||
string mobile = 5; //手机号
|
|
||||||
string avatar = 6; //头像地址
|
|
||||||
int64 employee_type = 7; //雇佣类型 1正式 2实习 3外包
|
|
||||||
int64 gender = 8; //性别 1男 2女 3未知
|
|
||||||
string birthday = 9; //生日
|
|
||||||
repeated string belong_organizations = 10 ;//属于哪些部门
|
|
||||||
repeated string manage_organizations = 11 ;//管理哪些部门
|
|
||||||
int64 status = 12 ; //状态 1正常0离职
|
|
||||||
int64 group_id = 13; //权限分组id
|
|
||||||
}
|
}
|
@ -26,12 +26,8 @@ service ldap {
|
|||||||
rpc UpdateLdapUserPwd(UpdateLdapUserPwdReq) returns(basic.Response){}
|
rpc UpdateLdapUserPwd(UpdateLdapUserPwdReq) returns(basic.Response){}
|
||||||
//禁用ldap用户帐号
|
//禁用ldap用户帐号
|
||||||
rpc DisableLdapUser(DisableLdapUserReq) returns(basic.Response){}
|
rpc DisableLdapUser(DisableLdapUserReq) returns(basic.Response){}
|
||||||
//删除ldap用户帐号
|
|
||||||
rpc DeleteLdapUser(DeleteLdapUserReq) returns(basic.Response){}
|
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
rpc GetLdapUserInfo(GetLdapUserInfoReq) returns(GetLdapUserInfoRsp){}
|
rpc GetLdapUserInfo(GetLdapUserInfoReq) returns(GetLdapUserInfoRsp){}
|
||||||
//获取用户信息--批量
|
|
||||||
rpc GetLdapUsersByUserIds(GetLdapUsersByUserIdsReq) returns(GetLdapUsersRsp){}
|
|
||||||
//ldap部门添加成员
|
//ldap部门添加成员
|
||||||
rpc AddLdapOrganizationMember(AddLdapOrganizationMemberReq) returns(basic.Response){}
|
rpc AddLdapOrganizationMember(AddLdapOrganizationMemberReq) returns(basic.Response){}
|
||||||
//ldap部门移除成员
|
//ldap部门移除成员
|
||||||
@ -59,21 +55,7 @@ service ldap {
|
|||||||
rpc SetLdapGroupAuth(SetLdapGroupAuthReq) returns (SetLdapGroupAuthRsp);
|
rpc SetLdapGroupAuth(SetLdapGroupAuthReq) returns (SetLdapGroupAuthRsp);
|
||||||
//权限组授权--移除
|
//权限组授权--移除
|
||||||
rpc RemoveLdapGroupAuth(RemoveLdapGroupAuthReq) returns (RemoveLdapGroupAuthRsp);
|
rpc RemoveLdapGroupAuth(RemoveLdapGroupAuthReq) returns (RemoveLdapGroupAuthRsp);
|
||||||
|
|
||||||
//验证权限组
|
|
||||||
rpc VerifyAuthorityGroup(VerifyAuthorityGroupReq) returns (VerifyAuthorityGroupRsp);
|
|
||||||
}
|
}
|
||||||
message VerifyAuthorityGroupReq {
|
|
||||||
string path = 1;
|
|
||||||
string method = 2;
|
|
||||||
string category = 3;
|
|
||||||
int64 group_id = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message VerifyAuthorityGroupRsp {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetLdapGroupsReq {
|
message GetLdapGroupsReq {
|
||||||
LdapGroupFilter filter = 1;
|
LdapGroupFilter filter = 1;
|
||||||
|
|
||||||
@ -91,7 +73,6 @@ message GetLdapGroupDetailReq {
|
|||||||
}
|
}
|
||||||
message GetLdapGroupDetailRsp {
|
message GetLdapGroupDetailRsp {
|
||||||
LdapGroup info = 1;
|
LdapGroup info = 1;
|
||||||
repeated int64 apis =2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message SaveLdapGroupReq {
|
message SaveLdapGroupReq {
|
||||||
@ -228,25 +209,10 @@ message UpdateLdapUserPwdReq{
|
|||||||
message DisableLdapUserReq{
|
message DisableLdapUserReq{
|
||||||
string user_dn = 1;//用户dn
|
string user_dn = 1;//用户dn
|
||||||
}
|
}
|
||||||
//删除ldap用户帐号
|
|
||||||
message DeleteLdapUserReq{
|
|
||||||
string user_dn = 1;//用户dn
|
|
||||||
}
|
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
message GetLdapUserInfoReq{
|
message GetLdapUserInfoReq{
|
||||||
string user_dn = 1;//用户dn
|
string user_dn = 1;//用户dn
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取用户信息--批量
|
|
||||||
message GetLdapUsersByUserIdsReq{
|
|
||||||
repeated int64 user_ids = 1;//用户ID
|
|
||||||
}
|
|
||||||
//获取用户信息--批量
|
|
||||||
message GetLdapUsersByUserIdsRsp{
|
|
||||||
repeated GetLdapUsersItem list = 1;
|
|
||||||
string paging_cookie = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetLdapUserInfoRsp{
|
message GetLdapUserInfoRsp{
|
||||||
int64 user_id = 1; //用户id
|
int64 user_id = 1; //用户id
|
||||||
string user_dn = 2; //用户dn
|
string user_dn = 2; //用户dn
|
||||||
@ -336,12 +302,4 @@ message LdapParseTokenRsp{
|
|||||||
string UserDn = 1;
|
string UserDn = 1;
|
||||||
int64 UserId = 2;
|
int64 UserId = 2;
|
||||||
string UserEmail = 3;
|
string UserEmail = 3;
|
||||||
int64 group_id = 4;
|
|
||||||
int64 gender = 5;//性别
|
|
||||||
string birthday = 6;//生日
|
|
||||||
repeated string belong_to_organizations = 7;//属于部门DN集合
|
|
||||||
repeated string belong_to_organization_names = 8;//属于部门名字集合
|
|
||||||
repeated string manage_organizations = 9;//管理的部门dn集合
|
|
||||||
repeated string manage_organization_names = 10;//管理的部门名字集合
|
|
||||||
int64 status = 11; //状态 1正常0离职
|
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ service notify {
|
|||||||
rpc Ping(basic.Request) returns (basic.Response) {}
|
rpc Ping(basic.Request) returns (basic.Response) {}
|
||||||
|
|
||||||
// 邮件发送基础版本
|
// 邮件发送基础版本
|
||||||
rpc EmailSend( EmailSendReq) returns (EmailSendResp) {}
|
rpc EmailSend(EmailSendReq) returns (EmailSendRes) {}
|
||||||
|
|
||||||
// 通过邮件通知 注册确认
|
// 通过邮件通知 注册确认
|
||||||
rpc EmailRegisterConfirm( EmailRegisterReq) returns ( EmailRegisterResp) {}
|
rpc EmailRegisterConfirm( EmailRegisterReq) returns ( EmailRegisterResp) {}
|
||||||
@ -64,13 +64,12 @@ message EmailNotifyBasic {
|
|||||||
optional string notify_id = 1; // 用于处理唯一的任务,重发都会被利用到 256字节, 如果不写自动生成一个uuid
|
optional string notify_id = 1; // 用于处理唯一的任务,重发都会被利用到 256字节, 如果不写自动生成一个uuid
|
||||||
string sender = 2; // 发送者
|
string sender = 2; // 发送者
|
||||||
string target_email = 3; // 发送的目标email
|
string target_email = 3; // 发送的目标email
|
||||||
string subject_title = 4; // 子标题
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 默认是 type email
|
// 默认是 type email
|
||||||
message EmailSendReq {
|
message EmailSendReq {
|
||||||
EmailNotifyBasic basic_email = 1; // 邮件基础要素
|
EmailNotifyBasic basic_email = 1;
|
||||||
string title = 2; // 邮件标题
|
string title = 2; // 邮件标题
|
||||||
string content = 3; // 邮件内容
|
string content = 3; // 邮件内容
|
||||||
Operator operator = 4; // 操作类型
|
Operator operator = 4; // 操作类型
|
||||||
@ -81,9 +80,10 @@ message EmailSendReq {
|
|||||||
enum NotifyType {
|
enum NotifyType {
|
||||||
email = 0; // email
|
email = 0; // email
|
||||||
feishu = 1; // 飞书
|
feishu = 1; // 飞书
|
||||||
// wechat = 2; // 微信
|
wechat = 2; // 微信
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 操作类型
|
// 操作类型
|
||||||
enum EmailStatus {
|
enum EmailStatus {
|
||||||
ok = 0; // 成功
|
ok = 0; // 成功
|
||||||
@ -93,14 +93,16 @@ enum EmailStatus {
|
|||||||
finish = 4; // 结束
|
finish = 4; // 结束
|
||||||
}
|
}
|
||||||
|
|
||||||
message EmailSendResp {
|
|
||||||
EmailStatus status = 1; // 邮件的状态
|
|
||||||
string msg = 2; // 通知信息
|
message EmailSendRes {
|
||||||
|
EmailStatus status = 1;
|
||||||
|
string msg = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message EmailRegisterReq {
|
message EmailRegisterReq {
|
||||||
EmailNotifyBasic basic_email = 1; // 邮件基础要素
|
EmailNotifyBasic basic_email = 1;
|
||||||
string confirmation_link = 2; // 邮件确认链接
|
string confirmation_link = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message EmailRegisterResp {
|
message EmailRegisterResp {
|
||||||
@ -110,8 +112,8 @@ message EmailRegisterResp {
|
|||||||
|
|
||||||
|
|
||||||
message EmailResetHtmlReq {
|
message EmailResetHtmlReq {
|
||||||
EmailNotifyBasic basic_email = 1; // 邮件基础要素
|
EmailNotifyBasic basic_email = 1;
|
||||||
string confirmation_link = 2; // 确认链接
|
string confirmation_link = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message EmailResetHtmlResp {
|
message EmailResetHtmlResp {
|
||||||
@ -119,7 +121,6 @@ message EmailResetHtmlResp {
|
|||||||
string notify_id = 2; // 通知id
|
string notify_id = 2; // 通知id
|
||||||
}
|
}
|
||||||
|
|
||||||
// 这个不会接在rpc服务里
|
|
||||||
message EmailResetConfirmReq {
|
message EmailResetConfirmReq {
|
||||||
string reset_password_link = 1;
|
string reset_password_link = 1;
|
||||||
string reset_token = 2;
|
string reset_token = 2;
|
||||||
@ -132,8 +133,8 @@ message EmailResetConfirmResp {
|
|||||||
|
|
||||||
|
|
||||||
message OrderPaymentDetailsReq {
|
message OrderPaymentDetailsReq {
|
||||||
EmailNotifyBasic basic_email = 1; // 邮件基础要素
|
EmailNotifyBasic basic_email = 1;
|
||||||
string payment_details_link = 2; // 支付详情链接
|
string payment_details_link = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message OrderPaymentDetailsResp {
|
message OrderPaymentDetailsResp {
|
||||||
@ -142,11 +143,10 @@ message OrderPaymentDetailsResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message OrderStatusTransitionReq {
|
message OrderStatusTransitionReq {
|
||||||
EmailNotifyBasic basic_email = 1; // 邮件基础要素
|
EmailNotifyBasic basic_email = 1;
|
||||||
string last_status = 2; // 上个状态
|
string last_status = 2; // 上个状态
|
||||||
string current_status = 3; // 当前状态
|
string current_status = 3; // 当前状态
|
||||||
string check_status_link = 4; // 检查状态
|
string check_status_link = 4; // 检查状态
|
||||||
bool is_show_click_text = 5; // 展示 开始生产 到 生产完成时 的特殊显示语句
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message OrderStatusTransitionResp {
|
message OrderStatusTransitionResp {
|
||||||
@ -156,7 +156,7 @@ message OrderStatusTransitionResp {
|
|||||||
|
|
||||||
|
|
||||||
message OrderPayArrearsReq {
|
message OrderPayArrearsReq {
|
||||||
EmailNotifyBasic basic_email = 1; // 邮件基础要素
|
EmailNotifyBasic basic_email = 1;
|
||||||
string pay_arrears_link = 2; // 检查状态
|
string pay_arrears_link = 2; // 检查状态
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
syntax = "proto3"; //版本声明,使用v3版本
|
|
||||||
|
|
||||||
package order;
|
|
||||||
option go_package = "gitlab.fusenpack.com/backend/order;service";
|
|
||||||
|
|
||||||
// 导入google/api/annotations.proto 注释依赖
|
|
||||||
import "google/api/annotations.proto";
|
|
||||||
import "service/basic.proto";
|
|
||||||
import "google/protobuf/struct.proto";
|
|
||||||
import "google/protobuf/any.proto";
|
|
||||||
|
|
||||||
//定义服务
|
|
||||||
service order {
|
|
||||||
// 更新详情
|
|
||||||
rpc OrderSave(OrderSaveReq) returns (OrderSaveRes) {}
|
|
||||||
|
|
||||||
// 获取详情
|
|
||||||
rpc OrderInfo(OrderInfoReq) returns (OrderInfoRes) {}
|
|
||||||
|
|
||||||
// 获取列表
|
|
||||||
rpc OrderList(OrderListReq) returns (OrderListRes) {}
|
|
||||||
|
|
||||||
// 详情处理
|
|
||||||
rpc DetailHandler(DetailHandlerReq) returns (DetailHandlerRes) {}
|
|
||||||
}
|
|
||||||
/* 详情处理 */
|
|
||||||
message DetailHandlerReq{
|
|
||||||
bytes order_db = 1;// 订单数据库数据
|
|
||||||
int64 handle_type = 2; // 处理类型:0=原数据,1=返回处理数据
|
|
||||||
int64 channle_type = 3; // 处理类型:0=后台,1=前台
|
|
||||||
}
|
|
||||||
message DetailHandlerRes{
|
|
||||||
bytes order_detail = 1; // 处理后数据
|
|
||||||
}
|
|
||||||
/* 详情处理 */
|
|
||||||
|
|
||||||
/* 更新详情 */
|
|
||||||
message OrderSaveReq{
|
|
||||||
OrderFilter filter = 1; // 筛选条件
|
|
||||||
OrderDetailDb save = 2; // 更新数据
|
|
||||||
}
|
|
||||||
message OrderSaveRes{
|
|
||||||
OrderInfo info = 1; // 详情数据
|
|
||||||
}
|
|
||||||
/* 更新详情 */
|
|
||||||
|
|
||||||
/* 获取详情 */
|
|
||||||
message OrderInfoReq{
|
|
||||||
OrderFilter filter = 1;// 筛选条件
|
|
||||||
int64 handle_type = 2; // 处理类型:0=原数据,1=返回处理数据
|
|
||||||
int64 channle_type = 3; // 处理类型:0=后台,1=前台
|
|
||||||
repeated int64 related = 4; // 关联数据:1=用户信息,2=支付记录
|
|
||||||
}
|
|
||||||
message OrderInfoRes{
|
|
||||||
OrderInfo info = 1; // 详情数据
|
|
||||||
}
|
|
||||||
/* 获取详情 */
|
|
||||||
|
|
||||||
/* 获取列表 */
|
|
||||||
message OrderListReq{
|
|
||||||
OrderFilter filter = 1; // 筛选条件
|
|
||||||
int64 handle_type = 2; // 处理类型:0=原数据,1=返回处理数据
|
|
||||||
int64 channle_type = 3; // 处理类型:0=后台,1=前台
|
|
||||||
repeated int64 related = 4; // 关联数据:1=用户信息,2=支付记录,3=销售信息,4=设计信息,5=供应链信息
|
|
||||||
|
|
||||||
|
|
||||||
bool select_whole = 100; // 查询类型:false=分页 true=全部数据
|
|
||||||
int64 current_page = 101; // 当前页码
|
|
||||||
int64 per_page = 102; // 每页数量
|
|
||||||
string order_by = 103; // 排序条件: 如 id desc,ctime desc
|
|
||||||
string select_fields = 104; // 查询字段
|
|
||||||
}
|
|
||||||
message OrderListRes{
|
|
||||||
repeated OrderInfo list = 1;// 列表数据
|
|
||||||
basic.Meta meta = 2; // 列表参数
|
|
||||||
}
|
|
||||||
/* 获取列表 */
|
|
||||||
|
|
||||||
/* 过滤条件 */
|
|
||||||
message OrderFilter {
|
|
||||||
optional int64 id = 1;// 主键ID
|
|
||||||
optional int64 user_id = 2; // 用户ID
|
|
||||||
optional int64 delivery_method = 3; // 物流类型
|
|
||||||
optional string order_sn = 4; // 订单编号
|
|
||||||
optional string order_source = 5; // 订单来源
|
|
||||||
optional int64 status = 6; // 订单状态
|
|
||||||
optional int64 is_del = 7; // 是否删除:0=否,1=是
|
|
||||||
optional int64 pay_status = 8; // 支付状态
|
|
||||||
optional int64 sale_gerent_id = 9; // 销售负责人
|
|
||||||
optional int64 design_gerent_id = 10; // 设计负责人
|
|
||||||
optional string ctime = 11; // 创建时间
|
|
||||||
optional string utime = 12; // 更新时间
|
|
||||||
|
|
||||||
optional bytes other_filter = 101; // 其他筛选条件
|
|
||||||
repeated int64 ids = 102; // 主键IDS
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 详情数据 */
|
|
||||||
message OrderInfo {
|
|
||||||
OrderDetailDb order_detail_db = 1; // 原数据
|
|
||||||
bytes order_detail = 2; // 处理后数据
|
|
||||||
basic.FsUser user_info = 3; // 用户数据
|
|
||||||
basic.LdapUser sale_info = 4; // 销售负责人
|
|
||||||
basic.LdapUser design_info = 5; // 设计负责人
|
|
||||||
OrderScm scm_info = 6;
|
|
||||||
}
|
|
||||||
message OrderScm {
|
|
||||||
repeated basic.LdapUser scm_info = 1; // 供应链信息
|
|
||||||
repeated int64 scm_ids = 2; // 供应链信息
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 数据库 */
|
|
||||||
message OrderDetailDb {
|
|
||||||
int64 id = 1; // 主键ID
|
|
||||||
optional int64 user_id = 2; // 用户ID
|
|
||||||
optional int64 delivery_method = 3; // 物流类型
|
|
||||||
optional string order_sn = 4; // 订单编号
|
|
||||||
optional string order_source = 5; // 订单来源
|
|
||||||
optional int64 status = 6; // 订单状态
|
|
||||||
optional bytes metadata = 7; // 额外参数
|
|
||||||
optional string ctime = 8; // 创建时间
|
|
||||||
optional string utime = 9; // 更新时间
|
|
||||||
optional int64 is_del = 10; // 是否删除:0 = 否,1 = 是
|
|
||||||
optional int64 pay_status = 11; // 支付状态
|
|
||||||
optional bytes status_link = 12; // 订单状态链路
|
|
||||||
optional bytes order_product = 13; // 订单商品
|
|
||||||
optional bytes order_address = 14; // 订单地址
|
|
||||||
optional bytes order_amount = 15; // 订单金额
|
|
||||||
optional bytes pay_status_link = 16; // 支付状态链路
|
|
||||||
optional bytes shopping_cart_snapshot = 17; // 购物车快照
|
|
||||||
optional bytes shopping_product_snapshot = 18; // 购物车商品快照
|
|
||||||
optional int64 sale_gerent_id = 19; // 销售负责人
|
|
||||||
optional int64 design_gerent_id = 20; // 设计负责人
|
|
||||||
optional bytes scm = 21; // 供应链管理
|
|
||||||
optional int64 order_type = 22; // 订单类型:1=平台,2=线下
|
|
||||||
optional string pay_deposit_ctime = 23; // 支付时间--定金
|
|
||||||
optional string pay_final_ctime = 24; // 支付时间--尾款
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -45,47 +45,7 @@ service resource {
|
|||||||
// 设置示例logo
|
// 设置示例logo
|
||||||
rpc SetExampleLogo(SetExampleLogoReq) returns (SetExampleLogoRes) {}
|
rpc SetExampleLogo(SetExampleLogoReq) returns (SetExampleLogoRes) {}
|
||||||
|
|
||||||
// 导出文件--CSV
|
|
||||||
rpc ExportCsv(ExportCsvReq) returns (ExportCsvRes) {}
|
|
||||||
|
|
||||||
// 导出文件--Excel
|
|
||||||
rpc ExportExcel(ExportExcelReq) returns (ExportExcelRes) {}
|
|
||||||
|
|
||||||
// 导出文件--zip
|
|
||||||
rpc ExportZip(ExportZipReq) returns (ExportZipRes) {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
message ExportData {
|
|
||||||
repeated string child = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ExportCsvReq {
|
|
||||||
repeated ExportData file_data = 1; // 文件数据
|
|
||||||
string file_name = 2;// 文件名称
|
|
||||||
int64 total = 3; // 数据量
|
|
||||||
}
|
|
||||||
message ExportCsvRes {
|
|
||||||
string export_file_path = 1; // 下载链接
|
|
||||||
}
|
|
||||||
|
|
||||||
message ExportExcelReq {
|
|
||||||
repeated ExportData file_data = 1; // 文件数据
|
|
||||||
string file_name = 2;// 文件名称
|
|
||||||
}
|
|
||||||
message ExportExcelRes {
|
|
||||||
string export_file_path = 1; // 下载链接
|
|
||||||
}
|
|
||||||
|
|
||||||
message ExportZipReq {
|
|
||||||
string file_type = 1;// 文件类型
|
|
||||||
string file_name = 2;// 文件名称
|
|
||||||
bytes file_bytes = 3;// 文件流
|
|
||||||
}
|
|
||||||
message ExportZipRes {
|
|
||||||
string export_file_path = 1; // 下载链接
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* 设置示例logo */
|
/* 设置示例logo */
|
||||||
message SetExampleLogoReq {
|
message SetExampleLogoReq {
|
||||||
int64 is_example = 1;
|
int64 is_example = 1;
|
||||||
@ -345,4 +305,3 @@ message ResourceIds {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 获取资源详情 */
|
/* 获取资源详情 */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user