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

This commit is contained in:
menghaiwen@fusen.cn 2024-03-07 14:59:57 +08:00
commit 230b735346
4 changed files with 198 additions and 4 deletions

View File

@ -5,8 +5,10 @@ import (
"context"
"sync"
"fmt"
"runtime/debug"
"fusen-basic/env"
"fusen-basic/utils/log"
"{{.ProjectName}}/gen/go/service"
"{{.ProjectName}}/server/config"
@ -53,6 +55,7 @@ func (lgrpc *{{.StructName}}Grpc) {{.MethodName}}({{range $index, $param := .Par
if _recoverErr := recover(); _recoverErr != nil {
_resp = nil
_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}})
@ -64,6 +67,7 @@ func (lgrpc *{{.StructName}}Grpc) {{.MethodName}}(stream {{range $index, $param
defer func() {
if _recoverErr := recover(); _recoverErr != nil {
_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)

View File

@ -32,8 +32,36 @@ message ResourceInfo{
}
message Meta {
int64 total_count =1;
int64 page_count=2;
int64 current_page=3;
int64 per_page=4;
int64 total_count =1; //
int64 page_count=2; //
int64 current_page=3; //
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 ; // 10
int64 group_id = 13; //id
}

View File

@ -30,6 +30,8 @@ service ldap {
rpc DeleteLdapUser(DeleteLdapUserReq) returns(basic.Response){}
//
rpc GetLdapUserInfo(GetLdapUserInfoReq) returns(GetLdapUserInfoRsp){}
//--
rpc GetLdapUsersByUserIds(GetLdapUsersByUserIdsReq) returns(GetLdapUsersRsp){}
//ldap部门添加成员
rpc AddLdapOrganizationMember(AddLdapOrganizationMemberReq) returns(basic.Response){}
//ldap部门移除成员
@ -89,6 +91,7 @@ message GetLdapGroupDetailReq {
}
message GetLdapGroupDetailRsp {
LdapGroup info = 1;
repeated int64 apis =2;
}
message SaveLdapGroupReq {
@ -233,6 +236,17 @@ message DeleteLdapUserReq{
message GetLdapUserInfoReq{
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{
int64 user_id = 1; //id
string user_dn = 2; //dn
@ -323,4 +337,11 @@ message LdapParseTokenRsp{
int64 UserId = 2;
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; // 10
}

141
service/order.proto Normal file
View File

@ -0,0 +1,141 @@
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; // --
}