222 lines
6.3 KiB
Protocol Buffer
222 lines
6.3 KiB
Protocol Buffer
syntax = "proto3";
|
||
package company;
|
||
option go_package = "./;company";
|
||
|
||
// /Users/edy/go/src/company/proto/company.proto START
|
||
|
||
|
||
message Identity {
|
||
string identity = 1;
|
||
}
|
||
|
||
message Empty {}
|
||
service Company{
|
||
|
||
rpc List(CompanyListRequest) returns (CompanyListReply) {}
|
||
rpc Get(Identity) returns (CompanyItem) {}
|
||
rpc Modify(CompanyItem) returns (Identity) {}
|
||
|
||
rpc DeliveryAddressList(DeliveryAddressListRequest) returns (DeliveryAddressListReply) {}
|
||
rpc DeliveryAddressModify(DeliveryAddressItem) returns (Identity) {}
|
||
rpc DeliveryAddressDelete(Identity) returns (Empty) {}
|
||
|
||
rpc CollectionInformation (Identity) returns (CollectionInformationItem) {}
|
||
rpc CollectionInformationModify(CollectionInformationItem) returns (Identity) {}
|
||
|
||
}
|
||
|
||
message CompanyListRequest {
|
||
int64 page_no = 1; // 页数
|
||
int64 page_size = 2; // 每页记录数
|
||
string name = 3; // 企业名称
|
||
int32 status = 4; // 认证状态: 1 已注册、2 已认证
|
||
int32 relation_genre = 5; // 关联关系类型: 1 成员企业、2 分销企业、3 供货企业
|
||
string registered_start_at = 6; // 注册时间-开始,格式:2006-01-02 15:04:05
|
||
string registered_end_at = 7; // 注册时间-结束格式:2006-01-02 15:04:05
|
||
|
||
bool with_statistics = 8;// 是否需要查询统计信息
|
||
}
|
||
|
||
message CompanyListReply {
|
||
repeated CompanyItem list = 1;
|
||
int64 count = 2;
|
||
CompanyStatisticsData statistics = 3;
|
||
}
|
||
|
||
message CompanyItem {
|
||
int32 id = 1;
|
||
string identity = 2;
|
||
string name = 3;// 企业名称
|
||
string unicode = 4;// 信用代码
|
||
string logo = 5; // 企业Logo
|
||
string profile = 6;// 企业头像
|
||
int32 genre = 7; // 企业类型: 1 企业、2 资金方、3 物流企业 etc.
|
||
string registered_at = 8; // 注册时间
|
||
string authorized_at = 9;// 认证时间
|
||
int32 status = 10;// 认证状态: 1 已注册、2 已认证
|
||
int32 relation_genre = 11;// 关联关系类型: 1 成员企业、2 分销企业、3 供货企业
|
||
int32 relation_status = 12;// 关联关系状态: 1 正常(表示关系可用)、2 已停用(表示关系不可用)
|
||
string contact_name = 13;// 联系人
|
||
string contact_phone = 14;// 联系电话
|
||
string contact_address = 15;// 联系地址(补充地址)
|
||
string province_identity = 16;//省级identity
|
||
string city_identity = 17;// 市级identity
|
||
string district_identity = 18;// 区级identity
|
||
string account = 19; // 登录账号
|
||
string password = 20; // 登录密码
|
||
string password_confirmed = 21; // 确认密码密码,仅注册/修改需要
|
||
|
||
}
|
||
|
||
message CompanyStatisticsData {
|
||
int64 total = 1; // 总的企业数
|
||
int64 available = 2; // 可用的企业数
|
||
int64 disable = 3;// 停用企业数
|
||
}
|
||
|
||
|
||
message DeliveryAddressListRequest {
|
||
int64 page_no = 1; // 页数
|
||
int64 page_size = 2; // 每页记录数
|
||
string contact_name = 3;
|
||
string contact_phone = 4;
|
||
}
|
||
|
||
message DeliveryAddressListReply{
|
||
repeated DeliveryAddressItem list = 1;
|
||
int64 count =2;
|
||
}
|
||
|
||
message DeliveryAddressItem {
|
||
string identity = 1;
|
||
string contact_name = 2;// 联系人
|
||
string contact_phone = 3;// 联系电话
|
||
string contact_address = 4;// 联系地址(补充地址)
|
||
string province_identity = 5;//省级identity
|
||
string city_identity = 6;// 市级identity
|
||
string district_identity = 7;// 区级identity
|
||
bool is_default = 8;
|
||
string created_at = 9;
|
||
}
|
||
|
||
message CollectionInformationItem {
|
||
string identity = 1;
|
||
string company_identity = 2;
|
||
string card_no = 3;
|
||
string deposit_bank = 4;
|
||
string payment_line = 5;
|
||
string remark = 6;
|
||
string created_at = 7;
|
||
|
||
}
|
||
// END
|
||
|
||
|
||
// /Users/edy/go/src/company/proto/role.proto START
|
||
|
||
service Role{
|
||
|
||
rpc List(RoleRequest) returns (RoleReply) {}
|
||
rpc Modify(RoleItem) returns (Identity) {}
|
||
rpc Delete(Identity) returns (Empty) {}
|
||
}
|
||
message RoleRequest {
|
||
repeated string company_identity = 1; // 企业identity,如果不传具体的identity就查询所有的
|
||
}
|
||
|
||
message RoleReply {
|
||
map<string,RoleList> kv =1; // key:company_identity
|
||
}
|
||
|
||
message RoleList {
|
||
repeated RoleItem list = 1;
|
||
}
|
||
message RoleItem {
|
||
int32 id = 1;
|
||
string identity = 2;
|
||
string name = 3;
|
||
string company_identity = 4;
|
||
string created_at = 5;
|
||
}
|
||
// END
|
||
|
||
|
||
// /Users/edy/go/src/company/proto/staff.proto START
|
||
|
||
service Staff{
|
||
|
||
rpc List(StaffListRequest) returns (StaffListReply) {}
|
||
|
||
rpc Modify(StaffItem) returns (Identity) {}
|
||
|
||
rpc Delete(Identity) returns (Empty) {}
|
||
// 修改关联关系
|
||
rpc StaffCompany(StaffCompanyRequest) returns (Empty) {}
|
||
rpc StaffCompanyChangeStatus(StaffCompanyRequest) returns (Empty) {}
|
||
}
|
||
|
||
message StaffListRequest {
|
||
int64 page_no=1; // 页数
|
||
int64 page_size=2; // 每页记录数
|
||
string staff_name = 3;
|
||
string company_name = 4;
|
||
int32 status = 5;
|
||
string registered_start_at = 6; // 注册时间-开始,格式:2006-01-02 15:04:05
|
||
string registered_end_at = 7; // 注册时间-结束格式:2006-01-02 15:04:05
|
||
bool with_statistics = 8;// 是否需要查询统计信息
|
||
string staff_identity = 9;
|
||
}
|
||
message StaffListReply {
|
||
repeated StaffItem list = 1;
|
||
int64 count = 2;
|
||
StaffStatisticsData statistics = 3;
|
||
}
|
||
message StaffItem {
|
||
int32 id = 1;
|
||
string identity = 2;
|
||
string name = 3;
|
||
string account = 4;
|
||
string profile = 5;
|
||
string password = 6;
|
||
string phone = 7;
|
||
string email = 8;
|
||
int32 status = 9;
|
||
string creator_identity = 10;
|
||
string created_at = 11;
|
||
repeated StaffCompany staff_company = 12; // 关联企业信息
|
||
string password_confirmed = 13; // 确认密码密码,仅注册/修改需要
|
||
// 创建时需要内容
|
||
string sms_verify_code = 14; // 短线验证码
|
||
}
|
||
|
||
message StaffCompany {
|
||
string company_identity = 1;
|
||
string role_identity = 2;
|
||
int32 status = 3;
|
||
// 显示用
|
||
string company_name = 4;
|
||
string role_name = 5;
|
||
string identity = 6;
|
||
}
|
||
|
||
message StaffStatisticsData {
|
||
int64 total = 1; // 总的
|
||
int64 available = 2; // 可用的
|
||
int64 disable = 3;// 停用
|
||
}
|
||
|
||
message StaffCompanyRequest {
|
||
repeated StaffCompanyItem list = 1;
|
||
string staff_identity = 2; //管理端请求需要校验这个参数
|
||
|
||
}
|
||
|
||
message StaffCompanyItem {
|
||
string company_identity = 1;
|
||
string role_identity = 2;
|
||
int32 status = 3;
|
||
string identity = 4;
|
||
}
|
||
|
||
// END
|