diff --git a/axios/service/org/org.ts b/axios/service/org/org.ts new file mode 100644 index 0000000..c85c4a7 --- /dev/null +++ b/axios/service/org/org.ts @@ -0,0 +1,195 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { CompanyListRequest,CompanyListReply,Identity,CompanyItem,DeliveryAddressListRequest,DeliveryAddressListReply,DeliveryAddressItem,Empty,CollectionInformationItem,LoginRequest,LoginReply,RegisterRequest,RegisterReply,ChangeChoicedCompanyRequest,ChangeChoicedCompanyReply,CheckPhoneOrAccountExistsRequest,CheckPhoneOrAccountExistsReply,ForgetPasswordRequest,ForgetPasswordReply,ResetPasswordRequest,ResetPasswordReply,InvitationCreateReqest,InvitationCreateReply,InvitationInformationRequest,InvitationInformationReply,InvitationJoinRequest,InvitationJoinReply,InvitationJoinConfirmedRequest } from "./types"; + + + + +export function List(data: CompanyListRequest): AxiosPromise { + return request({ + url: "/org.Org.List", + method: "post", + data: data, + }); +} + + + +export function Get(data: Identity): AxiosPromise { + return request({ + url: "/org.Org.Get", + method: "post", + data: data, + }); +} + + + // Add 企业代为创建企业 +export function Add(data: CompanyItem): AxiosPromise { + return request({ + url: "/org.Org.Add", + method: "post", + data: data, + }); +} + + + +export function Modify(data: CompanyItem): AxiosPromise { + return request({ + url: "/org.Org.Modify", + method: "post", + data: data, + }); +} + + + +export function DeliveryAddressList(data: DeliveryAddressListRequest): AxiosPromise { + return request({ + url: "/org.Org.DeliveryAddressList", + method: "post", + data: data, + }); +} + + + +export function DeliveryAddressModify(data: DeliveryAddressItem): AxiosPromise { + return request({ + url: "/org.Org.DeliveryAddressModify", + method: "post", + data: data, + }); +} + + + +export function DeliveryAddressDelete(data: Identity): AxiosPromise { + return request({ + url: "/org.Org.DeliveryAddressDelete", + method: "post", + data: data, + }); +} + + + +export function CollectionInformation(data: Empty): AxiosPromise { + return request({ + url: "/org.Org.CollectionInformation", + method: "post", + data: data, + }); +} + + + +export function CollectionInformationModify(data: CollectionInformationItem): AxiosPromise { + return request({ + url: "/org.Org.CollectionInformationModify", + method: "post", + data: data, + }); +} + + + +export function Login(data: LoginRequest): AxiosPromise { + return request({ + url: "/org.Org.Login", + method: "post", + data: data, + }); +} + + + +export function Register(data: RegisterRequest): AxiosPromise { + return request({ + url: "/org.Org.Register", + method: "post", + data: data, + }); +} + + + // ChangeChoicedCompany 切换登录企业 +export function ChangeChoicedCompany(data: ChangeChoicedCompanyRequest): AxiosPromise { + return request({ + url: "/org.Org.ChangeChoicedCompany", + method: "post", + data: data, + }); +} + + + // CheckPhoneOrAccountExists 检查phone/account 是否已注册过 +export function CheckPhoneOrAccountExists(data: CheckPhoneOrAccountExistsRequest): AxiosPromise { + return request({ + url: "/org.Org.CheckPhoneOrAccountExists", + method: "post", + data: data, + }); +} + + + // ForgetPassword 忘记密码 +export function ForgetPassword(data: ForgetPasswordRequest): AxiosPromise { + return request({ + url: "/org.Org.ForgetPassword", + method: "post", + data: data, + }); +} + + + // ResetPassword 重置密码 +export function ResetPassword(data: ResetPasswordRequest): AxiosPromise { + return request({ + url: "/org.Org.ResetPassword", + method: "post", + data: data, + }); +} + + + // InvitationCreate 创建邀请 +export function InvitationCreate(data: InvitationCreateReqest): AxiosPromise { + return request({ + url: "/org.Org.InvitationCreate", + method: "post", + data: data, + }); +} + + + // InvitationInformation 邀请信息 +export function InvitationInformation(data: InvitationInformationRequest): AxiosPromise { + return request({ + url: "/org.Org.InvitationInformation", + method: "post", + data: data, + }); +} + + + // InvitationJoin 接收邀请 +export function InvitationJoin(data: InvitationJoinRequest): AxiosPromise { + return request({ + url: "/org.Org.InvitationJoin", + method: "post", + data: data, + }); +} + + + // InvitationJoinConfirmed 公司邀请确认 +export function InvitationJoinConfirmed(data: InvitationJoinConfirmedRequest): AxiosPromise { + return request({ + url: "/org.Org.InvitationJoinConfirmed", + method: "post", + data: data, + }); +} diff --git a/axios/service/org/role.ts b/axios/service/org/role.ts new file mode 100644 index 0000000..901c528 --- /dev/null +++ b/axios/service/org/role.ts @@ -0,0 +1,35 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { RoleRequest,RoleReply,RoleItem,Identity,Empty } from "./types"; + + + + +export function List(data: RoleRequest): AxiosPromise { + return request({ + url: "/org.Role.List", + method: "post", + data: data, + }); +} + + + +export function Modify(data: RoleItem): AxiosPromise { + return request({ + url: "/org.Role.Modify", + method: "post", + data: data, + }); +} + + + +export function Delete(data: Identity): AxiosPromise { + return request({ + url: "/org.Role.Delete", + method: "post", + data: data, + }); +} diff --git a/axios/service/org/staff.ts b/axios/service/org/staff.ts new file mode 100644 index 0000000..ac1e1a8 --- /dev/null +++ b/axios/service/org/staff.ts @@ -0,0 +1,95 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { StaffListRequest,StaffListReply,StaffItem,Identity,Empty,StaffCompanyChangeStatusRequest,StaffCompanyChangeRoleRequest,SetProfileRequest,SetAccountRequest } from "./types"; + + + + +export function List(data: StaffListRequest): AxiosPromise { + return request({ + url: "/org.Staff.List", + method: "post", + data: data, + }); +} + + + +export function Add(data: StaffItem): AxiosPromise { + return request({ + url: "/org.Staff.Add", + method: "post", + data: data, + }); +} + + + +export function Modify(data: StaffItem): AxiosPromise { + return request({ + url: "/org.Staff.Modify", + method: "post", + data: data, + }); +} + + + +export function Delete(data: Identity): AxiosPromise { + return request({ + url: "/org.Staff.Delete", + method: "post", + data: data, + }); +} + + + +export function StaffCompanyChangeStatus(data: StaffCompanyChangeStatusRequest): AxiosPromise { + return request({ + url: "/org.Staff.StaffCompanyChangeStatus", + method: "post", + data: data, + }); +} + + + +export function StaffCompanyChangeRole(data: StaffCompanyChangeRoleRequest): AxiosPromise { + return request({ + url: "/org.Staff.StaffCompanyChangeRole", + method: "post", + data: data, + }); +} + + + // GetProfile 获取个人信息 +export function GetProfile(data: Empty): AxiosPromise { + return request({ + url: "/org.Staff.GetProfile", + method: "post", + data: data, + }); +} + + + // SetProfile 设置个人信息 +export function SetProfile(data: SetProfileRequest): AxiosPromise { + return request({ + url: "/org.Staff.SetProfile", + method: "post", + data: data, + }); +} + + + // SetAccount 设置账号密码 +export function SetAccount(data: SetAccountRequest): AxiosPromise { + return request({ + url: "/org.Staff.SetAccount", + method: "post", + data: data, + }); +} diff --git a/axios/service/org/types.ts b/axios/service/org/types.ts new file mode 100644 index 0000000..b4d6ba1 --- /dev/null +++ b/axios/service/org/types.ts @@ -0,0 +1,367 @@ + + +export interface Identity { + identity?: string; +} + + +export interface Empty { + +} + + +export interface InvitationCreateReqest { + genre?: number; // 类型: 1 员工邀请, 2 企业邀请 + role?: number; // 员工邀请时有效: 1 工作人员 2 管理员 + company_genre?: number; // 企业邀请时有效: 1 供货企业 2 分销企业 +} + + +export interface InvitationJoinConfirmedRequest { + identity?: string; + name?: string; + unicode?: string; +} + + +export interface InvitationJoinReply { + companys?: InvitationJoinReplyItem[]; // 当公司邀请时,返回关联的可用的公司列表信息 + token?: string; +} + + +export interface InvitationJoinReplyItem { + identity?: string; + name?: string; + logo?: string; // 企业Logo + profile?: string; // 企业头像 + genre?: number; // 角色类型: 1 工作人员, 2 管理人员 + unicode?: string; +} + + +export interface InvitationJoinRequest { + request_id?: string; + name?: string; + phone?: string; + verify_code?: string; +} + + +export interface InvitationInformationRequest { + request_id?: string; +} + + +export interface InvitationInformationReply { + genre?: number; // 类型: 1 员工邀请, 2 企业邀请 + creator_name?: string; + company_name?: string; + company_genre?: number; // 企业邀请时有效: 1 供货企业 2 分销企业 +} + + +export interface InvitationCreateReply { + request_id?: string; +} + + +export interface ResetPasswordRequest { + account?: string; + password?: string; + password_conformed?: string; +} + + +export interface ResetPasswordReply { + +} + + +export interface ForgetPasswordRequest { + phone?: string; + verify_code?: string; +} + + +export interface ForgetPasswordReply { + token?: string; + account?: string; // 表示账号是否为空 +} + + +export interface CheckPhoneOrAccountExistsRequest { + phone?: string; + account?: string; +} + + +export interface CheckPhoneOrAccountExistsReply { + exists?: boolean; +} + + +export interface ChangeChoicedCompanyRequest { + company_identity?: string; +} + + +export interface ChangeChoicedCompanyReply { + token?: string; +} + + +export interface LoginRequest { + account?: string; + password?: string; + phone?: string; + verify_code?: string; + login_genre?: number; // 登陆类型: 1 账密; 2 手机验证码 +} + + +export interface LoginReply { + token?: string; + identity?: string; + list?: LoginReplyCompanyItem[]; + has_choiced_company_identity?: string; + name?: string; + account?: string; + status?: number; + created_at?: string; +} + + +export interface LoginReplyCompanyItem { + identity?: string; + name?: string; + logo?: string; // 企业Logo + profile?: string; // 企业头像 + genre?: number; // 角色类型: 1 工作人员, 2 管理人员 +} + + +export interface RegisterRequest { + name?: string; + phone?: string; + verify_code?: string; + account?: string; + password?: string; + password_confirmed?: string; +} + + +export interface RegisterReply { + token?: string; + identity?: string; + name?: string; + account?: string; +} + + +export interface CompanyListRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + name?: string; // 企业名称 + status?: number; // 认证状态: 1 已注册、2 已认证 + relation_genre?: number; // 关联关系类型: 1 供货企业、2 分销企业、 + relation_status?: number; // 关联关系状态 + registered_start_at?: string; // 注册时间-开始,格式:2006-01-02 15:04:05 + registered_end_at?: string; // 注册时间-结束格式:2006-01-02 15:04:05 + with_statistics?: boolean; // 是否需要查询统计信息 +} + + +export interface CompanyListReply { + list?: CompanyItem[]; + count?: number; + statistics?: CompanyStatisticsData; +} + + +export interface CompanyItem { + id?: number; + identity?: string; + name?: string; // 企业名称 + unicode?: string; // 信用代码 + logo?: string; // 企业Logo + profile?: string; // 企业头像 + genre?: number; // 企业类型: 1 企业、2 资金方、3 物流企业 etc. + registered_at?: string; // 注册时间 + authorized_at?: string; // 认证时间 + status?: number; // 认证状态: 1 已注册、2 已认证 + relation_genre?: number; // 关联关系类型: 1分销企业、2 供货企业 3 直营企业 4 直营个人 + relation_status?: number; // 关联关系状态: 1 正常(表示关系可用)、2 已停用(表示关系不可用) + contact_name?: string; // 联系人 + contact_phone?: string; // 联系电话 + contact_address?: string; // 联系地址(补充地址) + province_identity?: string; // 省级identity + city_identity?: string; // 市级identity + district_identity?: string; // 区级identity + login_message?: LoginMessage; +} + + // 登录关联信息 +export interface LoginMessage { + account?: string; // 登录账号 + password?: string; // 登录密码 + password_confirmed?: string; // 确认密码密码,仅注册/修改需要 + phone?: string; + verify_code?: string; + name?: string; +} + + +export interface CompanyStatisticsData { + total?: number; // 总的企业数 + available?: number; // 可用的企业数 + disable?: number; // 停用企业数 +} + + +export interface DeliveryAddressListRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + contact_name?: string; + contact_phone?: string; +} + + +export interface DeliveryAddressListReply { + list?: DeliveryAddressItem[]; + count?: number; +} + + +export interface DeliveryAddressItem { + identity?: string; + contact_name?: string; // 联系人 + contact_phone?: string; // 联系电话 + contact_address?: string; // 联系地址(补充地址) + province_identity?: string; // 省级identity + city_identity?: string; // 市级identity + district_identity?: string; // 区级identity + is_default?: boolean; + created_at?: string; +} + + +export interface CollectionInformationItem { + company_identity?: string; + card_no?: string; + deposit_bank?: string; + payment_line?: string; + remark?: string; +} + + +export interface RoleRequest { + company_identity?: string[]; // 企业identity,如果不传具体的identity就查询所有的 +} + + +export interface RoleReply { + kv?: { [key in string]: any}; // key:company_identity +} + + +export interface RoleList { + list?: RoleItem[]; +} + + +export interface RoleItem { + id?: number; + identity?: string; + name?: string; + company_identity?: string; + created_at?: string; +} + + +export interface SetAccountRequest { + account?: string; + password?: string; + password_conformed?: string; +} + + +export interface SetProfileRequest { + name?: string; + phone?: string; + verify_code?: string; + email?: string; + profile?: string; +} + + +export interface StaffCompanyChangeStatusRequest { + staff_identity?: string; + status?: number; +} + + +export interface StaffCompanyChangeRoleRequest { + staff_identity?: string; + genre?: number; +} + + +export interface StaffListRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + staff_name?: string; + company_name?: string; + status?: number; + registered_start_at?: string; // 注册时间-开始,格式:2006-01-02 15:04:05 + registered_end_at?: string; // 注册时间-结束格式:2006-01-02 15:04:05 + with_statistics?: boolean; // 是否需要查询统计信息 + staff_identity?: string; +} + + +export interface StaffListReply { + list?: StaffItem[]; + count?: number; + statistics?: StaffStatisticsData; +} + + +export interface StaffItem { + id?: number; + identity?: string; + name?: string; + account?: string; + profile?: string; + password?: string; + phone?: string; + email?: string; + status?: number; + creator_identity?: string; + created_at?: string; + staff_company?: StaffCompanyItem[]; // 关联企业信息 + password_confirmed?: string; // 确认密码密码,仅注册/修改需要 + verify_code?: string; // 创建时需要内容 短线验证码 + company_genre?: number; // 角色 +} + + +export interface StaffStatisticsData { + total?: number; // 总的 + available?: number; // 可用的 + disable?: number; // 停用 +} + + +export interface StaffCompanyRequest { + list?: StaffCompanyItem[]; + staff_identity?: string; // 管理端请求需要校验这个参数 +} + + +export interface StaffCompanyItem { + company_identity?: string; + genre?: number; + status?: number; + company_name?: string; // 显示用 +} \ No newline at end of file diff --git a/proto/company/main.proto b/proto/company/main.proto deleted file mode 100644 index 9cfe7ff..0000000 --- a/proto/company/main.proto +++ /dev/null @@ -1,221 +0,0 @@ -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 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 diff --git a/proto/org/main.proto b/proto/org/main.proto new file mode 100644 index 0000000..76dfb54 --- /dev/null +++ b/proto/org/main.proto @@ -0,0 +1,398 @@ +syntax = "proto3"; +package org; +option go_package = "./;org"; + +// /Users/edy/go/src/org/proto/org.proto START + + +message Identity { + string identity = 1; +} + +message Empty {} +service Org{ + + rpc List(CompanyListRequest) returns (CompanyListReply) {} + rpc Get(Identity) returns (CompanyItem) {} + // Add 企业代为创建企业 + rpc Add(CompanyItem) returns (Identity) {} + rpc Modify(CompanyItem) returns (Identity) {} + + rpc DeliveryAddressList(DeliveryAddressListRequest) returns (DeliveryAddressListReply) {} + rpc DeliveryAddressModify(DeliveryAddressItem) returns (Identity) {} + rpc DeliveryAddressDelete(Identity) returns (Empty) {} + + rpc CollectionInformation (Empty) returns (CollectionInformationItem) {} + rpc CollectionInformationModify(CollectionInformationItem) returns (Identity) {} + + rpc Login(LoginRequest) returns (LoginReply) {} + rpc Register(RegisterRequest) returns (RegisterReply) {} + + // ChangeChoicedCompany 切换登录企业 + rpc ChangeChoicedCompany(ChangeChoicedCompanyRequest) returns (ChangeChoicedCompanyReply) {} + + // CheckPhoneOrAccountExists 检查phone/account 是否已注册过 + rpc CheckPhoneOrAccountExists(CheckPhoneOrAccountExistsRequest) returns (CheckPhoneOrAccountExistsReply){} + + // ForgetPassword 忘记密码 + rpc ForgetPassword (ForgetPasswordRequest) returns (ForgetPasswordReply) {} + // ResetPassword 重置密码 + rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordReply) {} + + // InvitationCreate 创建邀请 + rpc InvitationCreate (InvitationCreateReqest) returns (InvitationCreateReply) {} + // InvitationInformation 邀请信息 + rpc InvitationInformation (InvitationInformationRequest) returns (InvitationInformationReply) {} + // InvitationJoin 接收邀请 + rpc InvitationJoin (InvitationJoinRequest) returns (InvitationJoinReply) {} + // InvitationJoinConfirmed 公司邀请确认 + rpc InvitationJoinConfirmed (InvitationJoinConfirmedRequest) returns (Empty) {} + +} +message InvitationCreateReqest { + int32 genre = 1; // 类型: 1 员工邀请, 2 企业邀请 + int32 role = 2;// 员工邀请时有效: 1 工作人员 2 管理员 + int32 company_genre = 3; //企业邀请时有效: 1 供货企业 2 分销企业 +} +message InvitationJoinConfirmedRequest { + string identity = 1; + string name = 2; + string unicode = 3; +} + +message InvitationJoinReply { + // 当公司邀请时,返回关联的可用的公司列表信息 + repeated InvitationJoinReplyItem companys = 1; + string token = 2; +} + +message InvitationJoinReplyItem { + string identity = 1; + string name = 2; + string logo = 3; // 企业Logo + string profile = 4;// 企业头像 + int32 genre = 5; // 角色类型: 1 工作人员, 2 管理人员 + string unicode = 6; +} +message InvitationJoinRequest { + string request_id = 1; + string name = 2; + string phone = 3; + string verify_code = 4; +} +message InvitationInformationRequest { + string request_id = 1; +} +message InvitationInformationReply { + int32 genre = 1; // 类型: 1 员工邀请, 2 企业邀请 + string creator_name = 2; + string company_name = 3; + int32 company_genre = 4; //企业邀请时有效: 1 供货企业 2 分销企业 +} + +message InvitationCreateReply { + string request_id = 1; +} +message ResetPasswordRequest { + string account = 1; + string password = 2; + string password_conformed = 3; +} + +message ResetPasswordReply { + // string token = 1; +} +message ForgetPasswordRequest { + string phone = 1; + string verify_code = 2; +} + +message ForgetPasswordReply { + string token = 1; + string account = 2; // 表示账号是否为空 +} + +message CheckPhoneOrAccountExistsRequest { + string phone = 1; + string account = 2; +} +message CheckPhoneOrAccountExistsReply { + bool exists = 1; +} + +message ChangeChoicedCompanyRequest { + string company_identity = 1; +} + +message ChangeChoicedCompanyReply { + string token = 1; +} +message LoginRequest { + string account = 1; + string password = 2; + string phone = 3; + string verify_code = 4; + int32 login_genre = 5; // 登陆类型: 1 账密; 2 手机验证码 +} + +message LoginReply { + string token = 1; + string identity = 2; + repeated LoginReplyCompanyItem list = 3; + string has_choiced_company_identity = 4; + string name = 5; + string account = 6; + int32 status = 7; + string created_at = 8; +} + +message LoginReplyCompanyItem { + string identity = 1; + string name = 2; + string logo = 3; // 企业Logo + string profile = 4;// 企业头像 + int32 genre = 5; // 角色类型: 1 工作人员, 2 管理人员 +} + +message RegisterRequest{ + string name = 1; + string phone = 2; + string verify_code = 3; + string account = 4; + string password = 5; + string password_confirmed = 6; +} + +message RegisterReply { + string token = 1; + string identity = 2; + string name = 3; + string account = 4; +} + +message CompanyListRequest { + int64 page_no = 1; // 页数 + int64 page_size = 2; // 每页记录数 + string name = 3; // 企业名称 + int32 status = 4; // 认证状态: 1 已注册、2 已认证 + int32 relation_genre = 5; // 关联关系类型: 1 供货企业、2 分销企业、 + int32 relation_status = 6; // 关联关系状态 + string registered_start_at = 7; // 注册时间-开始,格式:2006-01-02 15:04:05 + string registered_end_at = 8; // 注册时间-结束格式:2006-01-02 15:04:05 + + bool with_statistics = 9;// 是否需要查询统计信息 +} + +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 直营企业 4 直营个人 + 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 + + LoginMessage login_message = 19; +} + +// 登录关联信息 +message LoginMessage { + string account = 1; // 登录账号 + string password = 2; // 登录密码 + string password_confirmed = 3; // 确认密码密码,仅注册/修改需要 + string phone = 4; + string verify_code = 5; + string name = 6; +} + +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 company_identity = 2; + string card_no = 3; + string deposit_bank = 4; + string payment_line = 5; + string remark = 6; +} +// END + + +// /Users/edy/go/src/org/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 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/org/proto/staff.proto START + +service Staff{ + + rpc List(StaffListRequest) returns (StaffListReply) {} + + rpc Add(StaffItem) returns (Identity) {} + rpc Modify(StaffItem) returns (Identity) {} + + rpc Delete(Identity) returns (Empty) {} + + rpc StaffCompanyChangeStatus(StaffCompanyChangeStatusRequest) returns (Empty) {} + rpc StaffCompanyChangeRole(StaffCompanyChangeRoleRequest) returns (Empty) {} + // GetProfile 获取个人信息 + rpc GetProfile(Empty) returns (StaffItem) {} + // SetProfile 设置个人信息 + rpc SetProfile(SetProfileRequest) returns (Empty) {} + // SetAccount 设置账号密码 + rpc SetAccount(SetAccountRequest) returns (Empty) {} + + // 修改关联关系 + // rpc StaffCompany(StaffCompanyRequest) returns (Empty) {} +} + +message SetAccountRequest { + string account = 1; + string password = 2; + string password_conformed = 3; +} +message SetProfileRequest { + string name = 1; + string phone = 2; + string verify_code = 3; + string email = 4; + string profile = 5; +} + + +message StaffCompanyChangeStatusRequest { + string staff_identity = 1; + int32 status = 2; +} + +message StaffCompanyChangeRoleRequest { + string staff_identity = 1; + int32 genre = 2; +} + +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 StaffCompanyItem staff_company = 12; // 关联企业信息 + string password_confirmed = 13; // 确认密码密码,仅注册/修改需要 + // 创建时需要内容 + string verify_code = 14; // 短线验证码 + int32 company_genre = 15; // 角色 +} + +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; + int32 genre = 2; + int32 status = 3; + // 显示用 + string company_name = 4; +} + +// END