From 06b9a5a15d0d6eb9bf10d55e356922dda5adb613 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 27 Feb 2024 23:01:27 +0800 Subject: [PATCH] dev --- axios/service/address/method.ts | 55 +++++++ axios/service/address/types.ts | 56 ++++++++ axios/service/ads/Fetch.ts | 2 +- axios/service/cloud/method.ts | 105 ++++++++++++++ axios/service/cloud/types.ts | 113 +++++++++++++++ axios/service/company/company.ts | 85 +++++++++++ axios/service/company/role.ts | 35 +++++ axios/service/company/staff.ts | 55 +++++++ axios/service/company/types.ts | 192 +++++++++++++++++++++++++ axios/service/feedback/method.ts | 65 +++++++++ axios/service/feedback/types.ts | 104 ++++++++++++++ axios/service/initialize/check.ts | 4 +- axios/service/initialize/data.ts | 6 +- axios/service/license/method.ts | 15 ++ axios/service/license/types.ts | 14 ++ axios/service/mall/store.ts | 75 ++++++++++ axios/service/mall/types.ts | 161 +++++++++++++++++++++ axios/service/notify/mail.ts | 15 ++ axios/service/notify/sms.ts | 25 ++++ axios/service/notify/types.ts | 42 ++++++ axios/service/order/cart.ts | 45 ++++++ axios/service/order/coupon.ts | 15 ++ axios/service/order/purch.ts | 45 ++++++ axios/service/order/summary.ts | 75 ++++++++++ axios/service/order/types.ts | 209 +++++++++++++++++++++++++++ axios/service/passport/forget.ts | 25 ++++ axios/service/passport/info.ts | 55 +++++++ axios/service/passport/login.ts | 75 ++++++++++ axios/service/passport/register.ts | 45 ++++++ axios/service/passport/types.ts | 205 ++++++++++++++++++++++++++ cli/main.go | 13 +- proto/address/address.proto | 71 +++++++++ proto/cloud/cloud.proto | 123 ++++++++++++++++ proto/company/main.proto | 221 +++++++++++++++++++++++++++++ proto/feedback/feedback.proto | 104 ++++++++++++++ proto/license/license.proto | 22 +++ proto/mall/mall.proto | 170 ++++++++++++++++++++++ proto/notify/mail.proto | 17 +++ proto/notify/push.proto | 20 +++ proto/notify/sms.proto | 40 ++++++ proto/order/cart.proto | 81 +++++++++++ proto/order/coupon.proto | 53 +++++++ proto/order/purch.proto | 58 ++++++++ proto/order/summary.proto | 148 +++++++++++++++++++ proto/passport/blocks.proto | 3 + proto/passport/forget.proto | 61 ++++++++ proto/passport/info.proto | 104 ++++++++++++++ proto/passport/login.proto | 120 ++++++++++++++++ proto/passport/register.proto | 43 ++++++ 49 files changed, 3481 insertions(+), 9 deletions(-) create mode 100644 axios/service/address/method.ts create mode 100644 axios/service/address/types.ts create mode 100644 axios/service/cloud/method.ts create mode 100644 axios/service/cloud/types.ts create mode 100644 axios/service/company/company.ts create mode 100644 axios/service/company/role.ts create mode 100644 axios/service/company/staff.ts create mode 100644 axios/service/company/types.ts create mode 100644 axios/service/feedback/method.ts create mode 100644 axios/service/feedback/types.ts create mode 100644 axios/service/license/method.ts create mode 100644 axios/service/license/types.ts create mode 100644 axios/service/mall/store.ts create mode 100644 axios/service/mall/types.ts create mode 100644 axios/service/notify/mail.ts create mode 100644 axios/service/notify/sms.ts create mode 100644 axios/service/notify/types.ts create mode 100644 axios/service/order/cart.ts create mode 100644 axios/service/order/coupon.ts create mode 100644 axios/service/order/purch.ts create mode 100644 axios/service/order/summary.ts create mode 100644 axios/service/order/types.ts create mode 100644 axios/service/passport/forget.ts create mode 100644 axios/service/passport/info.ts create mode 100644 axios/service/passport/login.ts create mode 100644 axios/service/passport/register.ts create mode 100644 axios/service/passport/types.ts create mode 100644 proto/address/address.proto create mode 100644 proto/cloud/cloud.proto create mode 100644 proto/company/main.proto create mode 100644 proto/feedback/feedback.proto create mode 100644 proto/license/license.proto create mode 100644 proto/mall/mall.proto create mode 100644 proto/notify/mail.proto create mode 100644 proto/notify/push.proto create mode 100644 proto/notify/sms.proto create mode 100644 proto/order/cart.proto create mode 100644 proto/order/coupon.proto create mode 100644 proto/order/purch.proto create mode 100644 proto/order/summary.proto create mode 100644 proto/passport/blocks.proto create mode 100644 proto/passport/forget.proto create mode 100644 proto/passport/info.proto create mode 100644 proto/passport/login.proto create mode 100644 proto/passport/register.proto diff --git a/axios/service/address/method.ts b/axios/service/address/method.ts new file mode 100644 index 0000000..37d3aba --- /dev/null +++ b/axios/service/address/method.ts @@ -0,0 +1,55 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { AddressAddRequest,StatusReply,AddressItem,IdentRequest,FetchRequest,AddressListReply,AddressDelRequest } from "./types"; + + + + // 新增地址 +export function Add(data: AddressAddRequest): AxiosPromise { + return request({ + url: "/address.Method.Add", + method: "post", + data: data, + }); +} + + + // 修改地址 +export function Set(data: AddressItem): AxiosPromise { + return request({ + url: "/address.Method.Set", + method: "post", + data: data, + }); +} + + + // 获取一条地址 +export function Get(data: IdentRequest): AxiosPromise { + return request({ + url: "/address.Method.Get", + method: "post", + data: data, + }); +} + + + // 获取地址列表 +export function List(data: FetchRequest): AxiosPromise { + return request({ + url: "/address.Method.List", + method: "post", + data: data, + }); +} + + + // 删除一个地址 +export function Del(data: AddressDelRequest): AxiosPromise { + return request({ + url: "/address.Method.Del", + method: "post", + data: data, + }); +} diff --git a/axios/service/address/types.ts b/axios/service/address/types.ts new file mode 100644 index 0000000..d5a5a96 --- /dev/null +++ b/axios/service/address/types.ts @@ -0,0 +1,56 @@ + + +export interface AddressItem { + id?: number; // ID + phone?: string; // 手机号 + country?: string; // 国家 + province?: string; // 省 + city?: string; // 市 + area?: string; // 区 + detail?: string; // 详情地址 + contact?: string; // 联系人 + status?: number; // 状态 -1为删除,1为正常,2为设置成默认 +} + + +export interface AddressAddRequest { + phone?: string; // 手机号 + country?: string; // 国家 + province?: string; // 省 + city?: string; // 市 + area?: string; // 区 + detail?: string; // 详情地址 + contact?: string; // 联系人 + status?: number; // 状态 -1为删除,1为正常,2为设置成默认 +} + + +export interface FetchRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + params?: ParamsEntry[]; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + + +export interface IdentRequest { + id?: number; // 唯一ID + identity?: string; // 唯一码 +} + + +export interface StatusReply { + status?: number; // 状态码 + identity?: string; // 标识码 + message?: string; // 状态说明 + timeseq?: number; // 响应时间序列 +} + + +export interface AddressListReply { + data?: AddressItem[]; // 地址列表 +} + + +export interface AddressDelRequest { + id?: number; // ID +} \ No newline at end of file diff --git a/axios/service/ads/Fetch.ts b/axios/service/ads/Fetch.ts index 53e8552..03259e7 100644 --- a/axios/service/ads/Fetch.ts +++ b/axios/service/ads/Fetch.ts @@ -11,5 +11,5 @@ export function ByPos(data: ByPosRequest): AxiosPromise { url: "/ads.Fetch.ByPos", method: "post", data: data, -}); + }); } diff --git a/axios/service/cloud/method.ts b/axios/service/cloud/method.ts new file mode 100644 index 0000000..1cd4ff4 --- /dev/null +++ b/axios/service/cloud/method.ts @@ -0,0 +1,105 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { ListRequest,ListResponse,DirTreeRequest,DirTreeResponse,DownloadRequest,MakeRequest,MakeResponse,RenameRequest,Empty,RemoveRequest,MoveRequest,CopyRequest,ShareRequest,ShareResponse,ParseShareRequest,ParseShareResponse } from "./types"; + + + + // 本级目录列表 +export function List(data: ListRequest): AxiosPromise { + return request({ + url: "/cloud.Method.List", + method: "post", + data: data, + }); +} + + + // 目录树 +export function DirTree(data: DirTreeRequest): AxiosPromise { + return request({ + url: "/cloud.Method.DirTree", + method: "post", + data: data, + }); +} + + + // 本级及子级递归列表 +export function Download(data: DownloadRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Download", + method: "post", + data: data, + }); +} + + + // 创建文件/文件夹 +export function Make(data: MakeRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Make", + method: "post", + data: data, + }); +} + + + // 修改文件/文件夹名称 +export function Rename(data: RenameRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Rename", + method: "post", + data: data, + }); +} + + + // 移除文件/文件夹及其子级递归列表 +export function Remove(data: RemoveRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Remove", + method: "post", + data: data, + }); +} + + + // 移动文件/文件夹及其子级递归列表 +export function Move(data: MoveRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Move", + method: "post", + data: data, + }); +} + + + // 复制文件/文件夹及其子级递归列表 +export function Copy(data: CopyRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Copy", + method: "post", + data: data, + }); +} + + + // 分享文件/文件夹及其子级递归列表 +export function Share(data: ShareRequest): AxiosPromise { + return request({ + url: "/cloud.Method.Share", + method: "post", + data: data, + }); +} + + + // 解析分享内容 +export function ParseShare(data: ParseShareRequest): AxiosPromise { + return request({ + url: "/cloud.Method.ParseShare", + method: "post", + data: data, + }); +} diff --git a/axios/service/cloud/types.ts b/axios/service/cloud/types.ts new file mode 100644 index 0000000..52520b9 --- /dev/null +++ b/axios/service/cloud/types.ts @@ -0,0 +1,113 @@ + + +export interface Empty { + +} + + authorization_identity 用户识别identity 由上下文传递 + user_identity 用于鉴权 + +export interface ListRequest { + identity?: string; // 文件夹唯一标识,获取顶级的不传 + name?: string; // 根据文件名称模糊查找,当该字段不为空时identity的限定失效 +} + + +export interface ListResponse { + list?: UserFile[]; +} + + +export interface DirTreeRequest { + identity?: string; // 文件夹唯一标识,获取顶级的不传 +} + + +export interface DirTreeResponse { + list?: UserFile[]; // 只返回文件夹 +} + + +export interface DownloadRequest { + list?: string; // identity列表,必传 +} + + +export interface UserFile { + identity?: string; // 唯一标识 + name?: string; // 文件/文件夹名称 + ext?: string; // 后缀,文件夹时为空 + parent?: string; // 父级文件夹序列,按文件名称查询时候生效 + file?: TYPE_MESSAGE; // 文件信息 + created_at?: string; + updated_at?: string; + children?: UserFile[]; // 子文件夹 +} + + +export interface File { + identity?: string; // 唯一标识 + path?: string; // 文件路径 + size?: number; // 文件大小,单位:B +} + + +export interface MakeRequest { + name?: string; // 文件/文件夹名称,必传 + ext?: string; // 后缀,文件夹传空即可 + parent_identity?: string; // 父文件夹标识,选填 + size?: number; // 文件大小,非文件夹时必传,单位:B + hash?: string; // 文件hash值,非文件夹时必传 + path?: string; // 文件地址,非文件夹时必传 +} + + +export interface MakeResponse { + identity?: string; +} + + 同级下,名称必须唯一 + +export interface RenameRequest { + identity?: string; // 必传 + name?: string; // 文件/文件夹名称,必传 + ext?: string; // 后缀,文件夹传空即可 +} + + +export interface RemoveRequest { + list?: string; // identity列表 +} + + +export interface MoveRequest { + list?: string; // identity列表 + target_identity?: string; // 目标文件夹标识,如果是顶级则不填 +} + + +export interface CopyRequest { + list?: string; // identity列表 + target_identity?: string; // 目标文件夹标识,如果是顶级则不填 +} + + +export interface ShareRequest { + list?: string; // identity列表 + days?: number; // 有效天数,默认永久 +} + + +export interface ShareResponse { + key?: string; // 解析分享内容关键key +} + + +export interface ParseShareRequest { + key?: string; // 解析分享内容关键key +} + + +export interface ParseShareResponse { + list?: UserFile[]; +} \ No newline at end of file diff --git a/axios/service/company/company.ts b/axios/service/company/company.ts new file mode 100644 index 0000000..40c6eb5 --- /dev/null +++ b/axios/service/company/company.ts @@ -0,0 +1,85 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { CompanyListRequest,CompanyListReply,Identity,CompanyItem,DeliveryAddressListRequest,DeliveryAddressListReply,DeliveryAddressItem,Empty,CollectionInformationItem } from "./types"; + + + + +export function List(data: CompanyListRequest): AxiosPromise { + return request({ + url: "/company.Company.List", + method: "post", + data: data, + }); +} + + + +export function Get(data: Identity): AxiosPromise { + return request({ + url: "/company.Company.Get", + method: "post", + data: data, + }); +} + + + +export function Modify(data: CompanyItem): AxiosPromise { + return request({ + url: "/company.Company.Modify", + method: "post", + data: data, + }); +} + + + +export function DeliveryAddressList(data: DeliveryAddressListRequest): AxiosPromise { + return request({ + url: "/company.Company.DeliveryAddressList", + method: "post", + data: data, + }); +} + + + +export function DeliveryAddressModify(data: DeliveryAddressItem): AxiosPromise { + return request({ + url: "/company.Company.DeliveryAddressModify", + method: "post", + data: data, + }); +} + + + +export function DeliveryAddressDelete(data: Identity): AxiosPromise { + return request({ + url: "/company.Company.DeliveryAddressDelete", + method: "post", + data: data, + }); +} + + + +export function CollectionInformation(data: Identity): AxiosPromise { + return request({ + url: "/company.Company.CollectionInformation", + method: "post", + data: data, + }); +} + + + +export function CollectionInformationModify(data: CollectionInformationItem): AxiosPromise { + return request({ + url: "/company.Company.CollectionInformationModify", + method: "post", + data: data, + }); +} diff --git a/axios/service/company/role.ts b/axios/service/company/role.ts new file mode 100644 index 0000000..ed1a5ef --- /dev/null +++ b/axios/service/company/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: "/company.Role.List", + method: "post", + data: data, + }); +} + + + +export function Modify(data: RoleItem): AxiosPromise { + return request({ + url: "/company.Role.Modify", + method: "post", + data: data, + }); +} + + + +export function Delete(data: Identity): AxiosPromise { + return request({ + url: "/company.Role.Delete", + method: "post", + data: data, + }); +} diff --git a/axios/service/company/staff.ts b/axios/service/company/staff.ts new file mode 100644 index 0000000..54fd851 --- /dev/null +++ b/axios/service/company/staff.ts @@ -0,0 +1,55 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { StaffListRequest,StaffListReply,StaffItem,Identity,Empty,StaffCompanyRequest } from "./types"; + + + + +export function List(data: StaffListRequest): AxiosPromise { + return request({ + url: "/company.Staff.List", + method: "post", + data: data, + }); +} + + + +export function Modify(data: StaffItem): AxiosPromise { + return request({ + url: "/company.Staff.Modify", + method: "post", + data: data, + }); +} + + + +export function Delete(data: Identity): AxiosPromise { + return request({ + url: "/company.Staff.Delete", + method: "post", + data: data, + }); +} + + + // 修改关联关系 +export function StaffCompany(data: StaffCompanyRequest): AxiosPromise { + return request({ + url: "/company.Staff.StaffCompany", + method: "post", + data: data, + }); +} + + + +export function StaffCompanyChangeStatus(data: StaffCompanyRequest): AxiosPromise { + return request({ + url: "/company.Staff.StaffCompanyChangeStatus", + method: "post", + data: data, + }); +} diff --git a/axios/service/company/types.ts b/axios/service/company/types.ts new file mode 100644 index 0000000..5e6619e --- /dev/null +++ b/axios/service/company/types.ts @@ -0,0 +1,192 @@ + + +export interface Identity { + identity?: string; +} + + +export interface Empty { + +} + + +export interface CompanyListRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + name?: string; // 企业名称 + status?: number; // 认证状态: 1 已注册、2 已认证 + relation_genre?: number; // 关联关系类型: 1 成员企业、2 分销企业、3 供货企业 + registered_start_at?: string; // 注册时间-开始,格式:2006-01-02 15:04:05 + registered_end_at?: string; // 注册时间-结束格式:2006-01-02 15:04:05 + with_statistics?: TYPE_BOOL; // 是否需要查询统计信息 +} + + +export interface CompanyListReply { + list?: CompanyItem[]; + count?: number; + statistics?: TYPE_MESSAGE; +} + + +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 供货企业 + 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 + account?: string; // 登录账号 + password?: string; // 登录密码 + password_confirmed?: 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?: TYPE_BOOL; + created_at?: string; +} + + +export interface CollectionInformationItem { + identity?: string; + company_identity?: string; + card_no?: string; + deposit_bank?: string; + payment_line?: string; + remark?: string; + created_at?: string; +} + + +export interface RoleRequest { + company_identity?: string; // 企业identity,如果不传具体的identity就查询所有的 +} + + +export interface RoleReply { + kv?: KvEntry[]; // 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 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?: TYPE_BOOL; // 是否需要查询统计信息 + staff_identity?: string; +} + + +export interface StaffListReply { + list?: StaffItem[]; + count?: number; + statistics?: TYPE_MESSAGE; +} + + +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?: StaffCompany[]; // 关联企业信息 + password_confirmed?: string; // 确认密码密码,仅注册/修改需要 + sms_verify_code?: string; // 创建时需要内容 短线验证码 +} + + +export interface StaffCompany { + company_identity?: string; + role_identity?: string; + status?: number; + company_name?: string; // 显示用 + role_name?: string; + identity?: string; +} + + +export interface StaffStatisticsData { + total?: number; // 总的 + available?: number; // 可用的 + disable?: number; // 停用 +} + + +export interface StaffCompanyRequest { + list?: StaffCompanyItem[]; + staff_identity?: string; // 管理端请求需要校验这个参数 +} + + +export interface StaffCompanyItem { + company_identity?: string; + role_identity?: string; + status?: number; + identity?: string; +} \ No newline at end of file diff --git a/axios/service/feedback/method.ts b/axios/service/feedback/method.ts new file mode 100644 index 0000000..d278f1f --- /dev/null +++ b/axios/service/feedback/method.ts @@ -0,0 +1,65 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { ListRequest,ListReply,GetRequest,GetReply,AddRequest,AddReply,ModifyRequest,ModifyReply,DeleteRequest,DeleteReply,RemarkRequest,RemarkReply } from "./types"; + + + + +export function List(data: ListRequest): AxiosPromise { + return request({ + url: "/feedback.Method.List", + method: "post", + data: data, + }); +} + + + +export function Get(data: GetRequest): AxiosPromise { + return request({ + url: "/feedback.Method.Get", + method: "post", + data: data, + }); +} + + + +export function Add(data: AddRequest): AxiosPromise { + return request({ + url: "/feedback.Method.Add", + method: "post", + data: data, + }); +} + + + +export function Modify(data: ModifyRequest): AxiosPromise { + return request({ + url: "/feedback.Method.Modify", + method: "post", + data: data, + }); +} + + + +export function Delete(data: DeleteRequest): AxiosPromise { + return request({ + url: "/feedback.Method.Delete", + method: "post", + data: data, + }); +} + + + +export function Remark(data: RemarkRequest): AxiosPromise { + return request({ + url: "/feedback.Method.Remark", + method: "post", + data: data, + }); +} diff --git a/axios/service/feedback/types.ts b/axios/service/feedback/types.ts new file mode 100644 index 0000000..557958d --- /dev/null +++ b/axios/service/feedback/types.ts @@ -0,0 +1,104 @@ + + +export interface ListRequest { + page?: number; // 页码,默认第一页 + size?: number; // 单页显示数量,默认10,最多50 + user_identity?: string; // 用户唯一`标识,可选 + username?: string; // 用户名称,可选 + status?: number; // 条目状态,可选,默认0,全部查找 + type?: number; // 业务类型: 1,意见/2,反馈/3,申述等,默认0 调用方传 +} + + +export interface ListReply { + count?: number; + list?: FeedbackItem[]; +} + + +export interface FeedbackItem { + identity?: string; + user_identity?: string; + username?: string; + status?: number; // 状态,1未处理,2已处理,也可以调用方自行设置,如果未设置则默认是1 + created_at?: string; + updated_at?: string; + title?: string; + content?: string; + images?: FeedbackImage[]; + remark?: string; // 反馈信息 + type?: number; +} + + +export interface FeedbackImage { + identity?: string; + item_identity?: string; + url?: string; +} + + +export interface GetRequest { + identity?: string; +} + + +export interface GetReply { + record?: TYPE_MESSAGE; + exists?: TYPE_BOOL; +} + + +export interface AddRequest { + user_identity?: string; + username?: string; + status?: number; // 状态,1未处理,2已处理,也可以调用方自行设置,如果未设置则默认是1 + title?: string; + content?: string; + images?: FeedbackImage[]; + type?: number; +} + + +export interface AddReply { + identity?: string; +} + + +export interface ModifyRequest { + identity?: string; + user_identity?: string; + username?: string; + status?: number; // 状态,1未处理,2已处理,也可以调用方自行设置,如果未设置则默认是1 + title?: string; + content?: string; + images?: FeedbackImage[]; + type?: number; +} + + +export interface ModifyReply { + +} + + +export interface DeleteRequest { + identity?: string; +} + + +export interface DeleteReply { + +} + + +export interface RemarkRequest { + identity?: string; + remark?: string; + status?: number; +} + + +export interface RemarkReply { + +} \ No newline at end of file diff --git a/axios/service/initialize/check.ts b/axios/service/initialize/check.ts index acbfc14..1f0f795 100644 --- a/axios/service/initialize/check.ts +++ b/axios/service/initialize/check.ts @@ -11,7 +11,7 @@ export function Hello(data: Crc): AxiosPromise { url: "/initialize.Check.Hello", method: "post", data: data, -}); + }); } @@ -21,5 +21,5 @@ export function Updates(data: CheckForUpdatesRequest): AxiosPromise url: "/initialize.Data.Configure", method: "post", data: data, -}); + }); } @@ -21,7 +21,7 @@ export function Areas(data: Empty): AxiosPromise { url: "/initialize.Data.Areas", method: "post", data: data, -}); + }); } @@ -31,5 +31,5 @@ export function Tags(data: Empty): AxiosPromise { url: "/initialize.Data.Tags", method: "post", data: data, -}); + }); } diff --git a/axios/service/license/method.ts b/axios/service/license/method.ts new file mode 100644 index 0000000..3800f24 --- /dev/null +++ b/axios/service/license/method.ts @@ -0,0 +1,15 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { VerifyRequest,VerifyReply } from "./types"; + + + + // 许可证验证 +export function Verify(data: VerifyRequest): AxiosPromise { + return request({ + url: "/license.Method.Verify", + method: "post", + data: data, + }); +} diff --git a/axios/service/license/types.ts b/axios/service/license/types.ts new file mode 100644 index 0000000..0ae18ab --- /dev/null +++ b/axios/service/license/types.ts @@ -0,0 +1,14 @@ + + +export interface VerifyRequest { + license_code?: string; // 许可证码 + machine_code?: string; // 机器码 +} + + +export interface VerifyReply { + status?: number; // 状态码 + identity?: string; // 标识码 + message?: string; // 状态说明 + timeseq?: number; // 响应时间序列 +} \ No newline at end of file diff --git a/axios/service/mall/store.ts b/axios/service/mall/store.ts new file mode 100644 index 0000000..195cb9e --- /dev/null +++ b/axios/service/mall/store.ts @@ -0,0 +1,75 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { Empty,StoreListReply,UniqueIndex,CategoryReply,RecommendRequest,RecommendReply,ListRequest,ListReply,SearchRequest,GetRequest,GetReply,CommentListRequest,CommentListReply } from "./types"; + + + + // 店铺列表 +export function List(data: Empty): AxiosPromise { + return request({ + url: "/mall.Store.List", + method: "post", + data: data, + }); +} + + + // 获取所有分类数据 +export function Category(data: UniqueIndex): AxiosPromise { + return request({ + url: "/mall.Store.Category", + method: "post", + data: data, + }); +} + + + // 推荐商品 +export function Recommend(data: RecommendRequest): AxiosPromise { + return request({ + url: "/mall.Store.Recommend", + method: "post", + data: data, + }); +} + + + // 商品列表 +export function ProductList(data: ListRequest): AxiosPromise { + return request({ + url: "/mall.Store.ProductList", + method: "post", + data: data, + }); +} + + + // 商品搜索 +export function Search(data: SearchRequest): AxiosPromise { + return request({ + url: "/mall.Store.Search", + method: "post", + data: data, + }); +} + + + // 商品详情 +export function ProductGet(data: GetRequest): AxiosPromise { + return request({ + url: "/mall.Store.ProductGet", + method: "post", + data: data, + }); +} + + + // 评论列表 +export function CommentList(data: CommentListRequest): AxiosPromise { + return request({ + url: "/mall.Store.CommentList", + method: "post", + data: data, + }); +} diff --git a/axios/service/mall/types.ts b/axios/service/mall/types.ts new file mode 100644 index 0000000..782b56e --- /dev/null +++ b/axios/service/mall/types.ts @@ -0,0 +1,161 @@ + + +export interface Empty { + +} + + +export interface StoreListReply { + data?: StoreBasic[]; +} + + +export interface StoreBasic { + id?: number; + key?: string; // 店铺唯一KEY + title?: string; // 标题 + intro?: string; // 描述说明 + template?: string; // 模板 + configs?: string; // 配置说明 + created_at?: string; // 创建时间 +} + + 店铺唯一KEY + +export interface UniqueIndex { + store_key?: string; // 店铺唯一KEY +} + + 产品分类数据列表 + +export interface CategoryReply { + data?: CategoryItem[]; +} + + +export interface CategoryItem { + id?: number; // ID + title?: string; // 名称 + en_title?: string; // 英文名称 + keys?: string; // 关键词 + parent_id?: number; // 上级ID + paths?: string; // 路径 + intro?: string; // 简介 + icon?: string; // 图标 + sort?: number; // 排序 +} + + +export interface RecommendRequest { + store_key?: string; // 店铺唯一KEY + code?: number; // 推荐状态码 + number?: number; // 数量 +} + + +export interface RecommendReply { + data?: ProductItem[]; // 推荐商品列表 +} + + +export interface ListRequest { + store_key?: string; // 店铺唯一KEY + category_id?: number; // 分类ID + page?: number; // 当前页数,默认第一页,取值1~50 页 + size?: number; // 每页显示条数,默认10条,取值1~50 条/每次 +} + + +export interface SearchRequest { + store_key?: string; // 店铺唯一KEY + category_id?: number; // 分类ID + keyword?: string; // 关键字 + page?: number; // 当前页数,默认第一页,取值1~50 页 + size?: number; // 每页显示条数,默认10条,取值1~50 条/每次 +} + + +export interface ListReply { + count?: number; // 课程数量 + data?: ProductItem[]; // 商品数据列表 +} + + +export interface ProductItem { + id?: number; // 商品ID + identity?: string; // 商品唯一码 + supply_id?: number; // 供应商ID + types?: number; // 商品类型:Product=1 实体商品,Service=2 服务,Membership=3 会员服务,Other=4 其它 + category_id?: number; // 分类ID + category_paths?: string; // 分类路径 + title?: string; // 商品标题 + sub_title?: string; // 商品标题 + keyword?: string; // 商品关键字 + cover_image?: string; // 商品封面图片 + stock?: number; // 库存 + sales_price?: number; // 销售价 + content?: string; // 商品详情 + args?: string; // 商品相关参数JSON + star?: number; // 商品星级 + comment_total?: number; // 评论总数 + sale_total?: number; // 销售总数 + view_total?: number; // 查看总数 + image_total?: number; // 图片总数 + recommend?: number; // 推荐码:0不推荐,1推荐的状态 + sort?: number; // 排序 + status?: number; // 状态(0未上架,1上架) +} + + +export interface GetRequest { + identity?: string; // 商品唯一码 + store_key?: string; // 店铺唯一KEY +} + + +export interface GetReply { + detail?: TYPE_MESSAGE; // 商品详情数据 + attr?: AttrItem[]; // 商品属性数据 + photos?: PhotosItem[]; // 商品相册数据 +} + + +export interface AttrItem { + id?: number; // 属性ID + name?: string; // 属性名称 + parent_id?: number; // 上级ID + value?: string; // 属性值 +} + + +export interface PhotosItem { + id?: number; // 相册ID + name?: string; // 相册名称 + url?: string; // URL + sort?: number; // 排序 +} + + +export interface CommentItem { + id?: number; // ID + created?: string; // 创建时间 + passport_id?: number; // 评论人ID + passport_identity?: string; // 用户名称 + nickname?: string; // 用户名称 + score?: number; // 评分 + comment?: string; // 评论正文 + reply?: string; // 回复正文 +} + + +export interface CommentListRequest { + product_identity?: string; // 商品Identity + page?: number; // 当前页数,默认第一页,取值1~50 页 + size?: number; // 每页显示条数,默认10条,取值1~50 条/每次 +} + + +export interface CommentListReply { + count?: number; // 课程数量 + data?: CommentItem[]; // 评论列表 +} \ No newline at end of file diff --git a/axios/service/notify/mail.ts b/axios/service/notify/mail.ts new file mode 100644 index 0000000..a68b12a --- /dev/null +++ b/axios/service/notify/mail.ts @@ -0,0 +1,15 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { MailSendRequest,MailSendResponse } from "./types"; + + + + +export function Send(data: MailSendRequest): AxiosPromise { + return request({ + url: "/notify.Mail.Send", + method: "post", + data: data, + }); +} diff --git a/axios/service/notify/sms.ts b/axios/service/notify/sms.ts new file mode 100644 index 0000000..dbb18ad --- /dev/null +++ b/axios/service/notify/sms.ts @@ -0,0 +1,25 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { SmsSendRequest,SmsSendResponse,SmsVerifyRequest,PassResponse } from "./types"; + + + + +export function Send(data: SmsSendRequest): AxiosPromise { + return request({ + url: "/notify.Sms.Send", + method: "post", + data: data, + }); +} + + + +export function Verify(data: SmsVerifyRequest): AxiosPromise { + return request({ + url: "/notify.Sms.Verify", + method: "post", + data: data, + }); +} diff --git a/axios/service/notify/types.ts b/axios/service/notify/types.ts new file mode 100644 index 0000000..3ed3870 --- /dev/null +++ b/axios/service/notify/types.ts @@ -0,0 +1,42 @@ + + sms module + +export interface MailSendRequest { + sign_name?: string; // 必传项 +} + + +export interface MailSendResponse { + request_id?: string; +} + + sms module + +export interface SmsSendRequest { + sign_name?: string; // 必传项 + template_code?: string; // 必传项 + phone?: string; // 必传项 + paramters?: ParamtersEntry[]; + generate_code?: TYPE_BOOL; // 验证码相关 是否生成验证码 + expire_interval?: number; // 验证码缓存时间,单位:分钟,仅generate_code为true时会缓存,默认5分钟 + code_width?: number; // 验证码长度,默认 4 + code_key?: string; // template_code 模板中验证码的标识,默认code + has_black_list_filter?: TYPE_BOOL; // 是否黑单过滤,默认不过滤 + wihout_limit?: TYPE_BOOL; // 忽略每天短信条数上线限制,默认不忽略 +} + + +export interface SmsSendResponse { + biz_id?: string; // string request_id = 1; +} + + +export interface SmsVerifyRequest { + phone?: string; // string request_id = 1; + code?: string; +} + + +export interface PassResponse { + pass?: TYPE_BOOL; +} \ No newline at end of file diff --git a/axios/service/order/cart.ts b/axios/service/order/cart.ts new file mode 100644 index 0000000..a6e5d39 --- /dev/null +++ b/axios/service/order/cart.ts @@ -0,0 +1,45 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { CartGetRequest,CartGetReply,CartAddRequest,StatusReply,CartSetRequest,CartDelRequest } from "./types"; + + + + // 获取购物车的商品数据 +export function Get(data: CartGetRequest): AxiosPromise { + return request({ + url: "/order.Cart.Get", + method: "post", + data: data, + }); +} + + + // 将商品增加至购物车 +export function Add(data: CartAddRequest): AxiosPromise { + return request({ + url: "/order.Cart.Add", + method: "post", + data: data, + }); +} + + + // 修改购物车中的商品数量 +export function Set(data: CartSetRequest): AxiosPromise { + return request({ + url: "/order.Cart.Set", + method: "post", + data: data, + }); +} + + + // 删除购物车中的商品 +export function Del(data: CartDelRequest): AxiosPromise { + return request({ + url: "/order.Cart.Del", + method: "post", + data: data, + }); +} diff --git a/axios/service/order/coupon.ts b/axios/service/order/coupon.ts new file mode 100644 index 0000000..56db9f3 --- /dev/null +++ b/axios/service/order/coupon.ts @@ -0,0 +1,15 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { Status,CouponListReply } from "./types"; + + + + // 按状态获取优惠卷 +export function ByStatus(data: Status): AxiosPromise { + return request({ + url: "/order.Coupon.ByStatus", + method: "post", + data: data, + }); +} diff --git a/axios/service/order/purch.ts b/axios/service/order/purch.ts new file mode 100644 index 0000000..5991efa --- /dev/null +++ b/axios/service/order/purch.ts @@ -0,0 +1,45 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { PlanItem,StatusReply,FetchRequest,FetchReply,CancelPlanRequest } from "./types"; + + + + // 创建采购计划 +export function CreatePlan(data: PlanItem): AxiosPromise { + return request({ + url: "/order.Purch.CreatePlan", + method: "post", + data: data, + }); +} + + + // 修改采购计划 +export function ModifyPlan(data: PlanItem): AxiosPromise { + return request({ + url: "/order.Purch.ModifyPlan", + method: "post", + data: data, + }); +} + + + // 采购计划列表 +export function FetchPlan(data: FetchRequest): AxiosPromise { + return request({ + url: "/order.Purch.FetchPlan", + method: "post", + data: data, + }); +} + + + // 作废采购计划 +export function CancelPlan(data: CancelPlanRequest): AxiosPromise { + return request({ + url: "/order.Purch.CancelPlan", + method: "post", + data: data, + }); +} diff --git a/axios/service/order/summary.ts b/axios/service/order/summary.ts new file mode 100644 index 0000000..7815fb3 --- /dev/null +++ b/axios/service/order/summary.ts @@ -0,0 +1,75 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { QuickCreateByTokenRequest,StatusReply,SubmitRequest,Empty,IdentRequest,SummaryGetReply,SummaryListRequest,SummaryListReply,ConfirmRequest,ConfirmReply,CancelRequest } from "./types"; + + + + // 基于Token快速创建一个订单 +export function QuickCreateByToken(data: QuickCreateByTokenRequest): AxiosPromise { + return request({ + url: "/order.Summary.QuickCreateByToken", + method: "post", + data: data, + }); +} + + + // 将购物车的数据提交生成订单 +export function Submit(data: SubmitRequest): AxiosPromise { + return request({ + url: "/order.Summary.Submit", + method: "post", + data: data, + }); +} + + + // 检测是否有未确认及付款的订单 +export function Check(data: Empty): AxiosPromise { + return request({ + url: "/order.Summary.Check", + method: "post", + data: data, + }); +} + + + // 获取一个订单的详情数据 +export function Get(data: IdentRequest): AxiosPromise { + return request({ + url: "/order.Summary.Get", + method: "post", + data: data, + }); +} + + + // 根据不同的类型获取我的订单列表 类型: All:全部 Unpaid:未付款 Paid:已付款 NotDelivered:未发货 Delivered:已发货 NotComment:待评论 +export function List(data: SummaryListRequest): AxiosPromise { + return request({ + url: "/order.Summary.List", + method: "post", + data: data, + }); +} + + + // 确认订单,物流,优惠卷等其它信息 +export function Confirm(data: ConfirmRequest): AxiosPromise { + return request({ + url: "/order.Summary.Confirm", + method: "post", + data: data, + }); +} + + + // 取消订单 +export function Cancel(data: CancelRequest): AxiosPromise { + return request({ + url: "/order.Summary.Cancel", + method: "post", + data: data, + }); +} diff --git a/axios/service/order/types.ts b/axios/service/order/types.ts new file mode 100644 index 0000000..590f5ec --- /dev/null +++ b/axios/service/order/types.ts @@ -0,0 +1,209 @@ + + +export interface Empty { + +} + + +export interface FetchRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + params?: ParamsEntry[]; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + + +export interface IdentRequest { + id?: number; // 唯一ID + identity?: string; // 唯一码 +} + + +export interface StatusReply { + status?: number; // 状态码 + identity?: string; // 标识码 + message?: string; // 状态说明 + timeseq?: number; // 响应时间序列 +} + + +export interface CartGetRequest { + cartIdentity?: string; // 购物车唯一码,主要是用于未登录购物 + passportIdentity?: string; // 登录后的用户唯一码 +} + + +export interface CartGetReply { + data?: CartItem[]; // 购物车中的商品数据列表 +} + + +export interface CartItem { + id?: number; // ID + productId?: number; // 商品ID + title?: string; // 商品名称 + coverImage?: string; // 商品封面图片 + salesPrice?: number; // 商品销售价格 + productArgs?: string; // 商品属性 + number?: number; // 数量 + unitPrice?: number; // 实际单价 + totalPrice?: number; // 总价 +} + + +export interface CartAddRequest { + cartIdentity?: string; // 购物车唯一码,主要是用于未登录购物 + passportIdentity?: string; // 登录后的用户唯一码 + productId?: number; // 商品ID + productArgs?: string; // 商品属性 + number?: number; // 数量 +} + + +export interface CartSetRequest { + id?: number; // 购物车ID + number?: number; // 数量 + unitPrice?: number; // 单价 +} + + +export interface CartDelRequest { + id?: number; // 购物车ID +} + + +export interface Status { + status?: number; // 优惠卷状态 +} + + +export interface CouponListReply { + data?: CouponItem[]; // 购物车中的商品数据列表 +} + + +export interface CouponItem { + id?: number; // ID + identity?: string; // 唯一码 + title?: string; // 标题 + intro?: string; // 描述 + amount?: string; // 金额 + started?: string; // 开始时间 + expired?: string; // 结束时间 + status?: string; // 状态 +} + + +export interface PlanItem { + id?: number; // ID + identity?: number; // 计划唯一标识 + title?: string; // 计划名称 + descr?: string; // 计划描述 + passport_identity?: string; // 用户唯一码 +} + + +export interface FetchReply { + data?: PlanItem[]; // 采购计划列表 +} + + +export interface CancelPlanRequest { + id?: number; +} + + +export interface QuickCreateByCodeRequest { + partner_id?: number; // 合伙人ID + product_identity?: string; // 商品唯一码 + number?: number; // 数量 + phone?: string; // 手机号 + address?: string; // 详情地址 + contact?: string; // 联系人 + code?: string; // 短信验证码 +} + + +export interface QuickCreateByTokenRequest { + partner_id?: number; // 合伙人ID + product_identity?: string; // 商品唯一码 + number?: number; // 数量 + args?: string; // 相关参数 +} + + +export interface SubmitRequest { + id?: string; // 购物车的ID数据,以逗号分开 + partner_id?: number; // 合伙人ID + address_id?: number; // 地址ID +} + + +export interface SummaryGetReply { + summary?: TYPE_MESSAGE; // 订单概要详情 + details?: OrderDetails[]; // 订单商品详情 +} + + +export interface OrderSummary { + id?: number; // ID + order_no?: string; // 订单唯一码 + partner_id?: number; // 合伙人ID + tradeNo?: string; // 支付交易号 + payType?: number; // 支付类型 + address?: string; // 收货地址 + total_price?: number; // 总价 + trans_price?: number; // 交易金额 + refund_price?: number; // 退款金额 + logistics_number?: string; // 物流信息 + logistics_fee?: number; // 物流信息 + coupon_amount?: number; // 物流信息 + remark?: string; // 备注 + status?: number; // 订单状态 + payTime?: string; // 支付时间 + created?: string; // 创建时间 + updated?: string; // 最后创建时间 + details?: OrderDetails[]; // 订单商品 +} + + +export interface OrderDetails { + id?: number; // ID + product_id?: number; // 商品ID + type?: number; // 商品类型 + title?: string; // 商品名称 + cover_image?: string; // 商品封面图片 + sales_price?: string; // 商品销售价格 + product_args?: string; // 商品参数 + number?: number; // 数量 + unitPrice?: number; // 单价 +} + + +export interface SummaryListRequest { + type?: string; // 订单类型 +} + + +export interface SummaryListReply { + summary?: OrderSummary[]; // 订单列表 +} + + +export interface ConfirmRequest { + order_no?: number; // 订单唯一码 + address_id?: number; // 订单唯一码 + coupon_identity?: string; // 优惠卷 + remark?: string; // 备注 + logisticsFee?: TYPE_DOUBLE; // 运费 +} + + +export interface ConfirmReply { + total_price?: number; // 总价 +} + + +export interface CancelRequest { + order_no?: number; // 订单唯一码 + type?: string; // 订单类型 +} \ No newline at end of file diff --git a/axios/service/passport/forget.ts b/axios/service/passport/forget.ts new file mode 100644 index 0000000..51daadc --- /dev/null +++ b/axios/service/passport/forget.ts @@ -0,0 +1,25 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { VerifyRequest,StatusReply,ForgetResetRequest,ForgetReply } from "./types"; + + + + // 验证手机号和验证码 +export function Verify(data: VerifyRequest): AxiosPromise { + return request({ + url: "/passport.Forget.Verify", + method: "post", + data: data, + }); +} + + + // 重罢密码 +export function Reset(data: ForgetResetRequest): AxiosPromise { + return request({ + url: "/passport.Forget.Reset", + method: "post", + data: data, + }); +} diff --git a/axios/service/passport/info.ts b/axios/service/passport/info.ts new file mode 100644 index 0000000..1aaebcd --- /dev/null +++ b/axios/service/passport/info.ts @@ -0,0 +1,55 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { BindRequest,StatusReply,Empty,GetDataReply,SetDataRequest,SetPasswordRequest,StatisticsRequest,StatisticsReply } from "./types"; + + + + // 绑定资料 +export function Bind(data: BindRequest): AxiosPromise { + return request({ + url: "/passport.Info.Bind", + method: "post", + data: data, + }); +} + + + // 获取会员的所有信息数据 +export function GetData(data: Empty): AxiosPromise { + return request({ + url: "/passport.Info.GetData", + method: "post", + data: data, + }); +} + + + // 更新会员的信息数据 字段值为空或是0,将不更新此数据 +export function SetData(data: SetDataRequest): AxiosPromise { + return request({ + url: "/passport.Info.SetData", + method: "post", + data: data, + }); +} + + + // 更新会员的密码 +export function SetPassword(data: SetPasswordRequest): AxiosPromise { + return request({ + url: "/passport.Info.SetPassword", + method: "post", + data: data, + }); +} + + + // 获取会员的相关统计数据 +export function Statistics(data: StatisticsRequest): AxiosPromise { + return request({ + url: "/passport.Info.Statistics", + method: "post", + data: data, + }); +} diff --git a/axios/service/passport/login.ts b/axios/service/passport/login.ts new file mode 100644 index 0000000..dfadeb4 --- /dev/null +++ b/axios/service/passport/login.ts @@ -0,0 +1,75 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { LoginByPwdRequest,LoginReply,LoginByCodeRequest,WeChatByCodeRequest,WeChatByCodeReply,WeChatByPhoneRequest,WeChatByPhoneReply,WeChatGetUserinfoReply,LoginByAppleIDRequest } from "./types"; + + + + // 通过密码登录 +export function Pwd(data: LoginByPwdRequest): AxiosPromise { + return request({ + url: "/passport.Login.Pwd", + method: "post", + data: data, + }); +} + + + // 通过验证码登录 +export function Code(data: LoginByCodeRequest): AxiosPromise { + return request({ + url: "/passport.Login.Code", + method: "post", + data: data, + }); +} + + + // 通过Wechat登录 +export function WeChatByCode(data: WeChatByCodeRequest): AxiosPromise { + return request({ + url: "/passport.Login.WeChatByCode", + method: "post", + data: data, + }); +} + + + +export function WeChatByPhone(data: WeChatByPhoneRequest): AxiosPromise { + return request({ + url: "/passport.Login.WeChatByPhone", + method: "post", + data: data, + }); +} + + + +export function WeChatGetUserinfo(data: WeChatByPhoneRequest): AxiosPromise { + return request({ + url: "/passport.Login.WeChatGetUserinfo", + method: "post", + data: data, + }); +} + + + // 通过AppleID登录 +export function AppleID(data: LoginByAppleIDRequest): AxiosPromise { + return request({ + url: "/passport.Login.AppleID", + method: "post", + data: data, + }); +} + + + // 通过验证码登录并注册 +export function CodeAndRegister(data: LoginByCodeRequest): AxiosPromise { + return request({ + url: "/passport.Login.CodeAndRegister", + method: "post", + data: data, + }); +} diff --git a/axios/service/passport/register.ts b/axios/service/passport/register.ts new file mode 100644 index 0000000..25546ab --- /dev/null +++ b/axios/service/passport/register.ts @@ -0,0 +1,45 @@ + +import request from "../../request"; +import { AxiosPromise } from "axios"; +import { RegisterRequest,RegisterReply } from "./types"; + + + + // 帐号密码注册 +export function Pwd(data: RegisterRequest): AxiosPromise { + return request({ + url: "/passport.Register.Pwd", + method: "post", + data: data, + }); +} + + + // 手机验证码注册 +export function Code(data: RegisterRequest): AxiosPromise { + return request({ + url: "/passport.Register.Code", + method: "post", + data: data, + }); +} + + + // Wechat注册 +export function WeChat(data: RegisterRequest): AxiosPromise { + return request({ + url: "/passport.Register.WeChat", + method: "post", + data: data, + }); +} + + + // AppleID注册 +export function AppleID(data: RegisterRequest): AxiosPromise { + return request({ + url: "/passport.Register.AppleID", + method: "post", + data: data, + }); +} diff --git a/axios/service/passport/types.ts b/axios/service/passport/types.ts new file mode 100644 index 0000000..3bc0ab0 --- /dev/null +++ b/axios/service/passport/types.ts @@ -0,0 +1,205 @@ + + +export interface FetchRequest { + page_no?: number; // 页数 + page_size?: number; // 每页记录数 + params?: ParamsEntry[]; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + + +export interface IdentRequest { + id?: number; // 唯一ID + identity?: string; // 唯一码 +} + + +export interface VersionRequest { + version?: number; // 时序版本号 +} + + +export interface SearchRequest { + keyword?: string; // 关键词 +} + + +export interface StatusReply { + status?: number; // 状态码 + identity?: string; // 标识码 + message?: string; // 状态说明 + timeseq?: number; // 响应时间序列 +} + + +export interface Empty { + +} + + +export interface VerifyRequest { + phone?: string; // 手机号 + code?: string; // 验证码 +} + + +export interface ForgetResetRequest { + identity?: string; // 唯一码 + password?: string; // 密码 +} + + +export interface ForgetReply { + identity?: string; // 用户唯一码 + data_bind?: string; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 + token?: string; // 用户凭证 + extend?: ExtendEntry[]; // 扩展字段 +} + + +export interface BindRequest { + action?: string; // 操作动作 + phone?: string; // 手机号码 必填 + code?: string; // 验证码 + password?: string; // 密码 必填 + nickname?: string; // 昵称 +} + + +export interface GetDataReply { + account?: string; // 帐号 + phone?: string; // 手机号 + nickname?: string; // 昵称 + avatar?: string; // 头像 + birthday?: string; // 生日 + sex?: number; // 性别,1为男性,2为女性 + province?: number; // 省 + city?: number; // 市 + area?: number; // 区 + sign?: string; // 签名 + approve?: number; // 状态:-2,认证未通过,0为未认证,1为审核中,2为认证成功 +} + + +export interface SetDataRequest { + nickname?: string; // 昵称 + avatar?: string; // 头像 + birthday?: string; // 生日 + sex?: number; // 性别,1为男性,2为女性 + province?: number; // 省 + city?: number; // 市 + area?: number; // 区 + sign?: string; // 签名 +} + + +export interface SetPasswordRequest { + old_password?: string; // 旧密码 + new_password?: string; // 新密码 +} + + +export interface StatisticsRequest { + field?: string; // 要获取的统计数据字段。 +} + + +export interface StatisticsReply { + Data?: DataEntry[]; // 数据以Map格式输出 +} + + +export interface LoginByPwdRequest { + account?: string; // 账号 必填 + password?: string; // 密码 必填 + device?: string; // 设备 必填 +} + + +export interface LoginByCodeRequest { + country?: string; // 国家 + phone?: string; // 手机号码 + code?: string; // 验证码 + device?: string; // 设备 +} + + +export interface WeChatByCodeRequest { + code?: string; // WeChat code + agency_id?: number; // 代理ID + staff_id?: number; // 工作人员ID +} + + +export interface WeChatByPhoneReply { + account?: string; // WeChat code +} + + +export interface WeChatByCodeReply { + session_key?: string; // WeChat session key + open_id?: string; // WeChat open id + identity?: string; // identity + account?: string; // account +} + + +export interface WeChatByPhoneRequest { + session_key?: string; // WeChat session key + open_id?: string; // open_id + data?: string; // data + iv?: string; // iv + identity?: string; // identiy +} + + +export interface WeChatGetUserinfoReply { + id?: number; + account?: string; + identity?: string; + nickname?: string; + avatar?: string; + rights?: string; + token?: string; +} + + +export interface LoginByAppleIDRequest { + apple_id?: string; // apple id + desc?: string; // 描述 + device?: string; // 设备 +} + + +export interface LoginReply { + id?: number; + identity?: string; // 用户唯一码 + data_bind?: string; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 + token?: string; // 用户凭证 + extend?: ExtendEntry[]; // 扩展字段 +} + + +export interface RegisterRequest { + origin?: string; // 来源,归属 + account?: string; // 帐号 + phone?: string; // 手机号 + password?: string; // 密码 + code?: string; // 验证码 + wechat_union_id?: string; // 微信UnionID + wechat_open_id?: string; // 微信OpenID + apple_id?: string; // Apple ID + nickname?: string; // 昵称 + type?: string; // 类型 + device?: string; // 设备 + agency_id?: number; // 代理ID + staff_id?: number; // 工作人员ID +} + + +export interface RegisterReply { + id?: number; + identity?: string; // 用户唯一码 + data_bind?: string; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 + token?: string; // 用户Header所需Token + extend?: ExtendEntry[]; // 扩展字段 +} \ No newline at end of file diff --git a/cli/main.go b/cli/main.go index cc45e4b..d72668c 100644 --- a/cli/main.go +++ b/cli/main.go @@ -18,12 +18,13 @@ var ( ) func main() { - fmt.Println("Conv poroto file to js file.") + fmt.Println("CONV: poroto file to js file.") srvPaths := getSubDirs(protoPath) - fmt.Println("Root:", protoPath, srvPaths, "JS Out:", jsPath) + fmt.Println("CONV:", protoPath, srvPaths, "JS Out:", jsPath) for _, v := range srvPaths { + fmt.Println("CONV:", protoPath, "=>", v) parseProtos(protoPath, v) } @@ -98,7 +99,7 @@ export function {{MethodName}}(data: {{In}}): AxiosPromise<{{Reply}}> { url: "/{{PkgName}}.{{SrvName}}.{{MethodName}}", method: "post", data: data, -}); + }); } ` @@ -147,6 +148,9 @@ export function {{MethodName}}(data: {{In}}): AxiosPromise<{{Reply}}> { bodys = append(bodys, header) bodys = append(bodys, funcs...) + if !utils.PathExists(tsPath) { + os.Mkdir(tsPath, 0755) + } tsFileName := strings.ToLower(srvName) + ".ts" destPath := filepath.Join(tsPath, tsFileName) utils.StringToFile(destPath, strings.Join(bodys, "\r\n")) @@ -186,6 +190,9 @@ export interface {{Name}} { } typesPath := filepath.Join(tsPath, "types.ts") + if !utils.PathExists(tsPath) { + os.Mkdir(tsPath, 0755) + } utils.StringToFile(typesPath, strings.Join(bodys, "\r\n")) } diff --git a/proto/address/address.proto b/proto/address/address.proto new file mode 100644 index 0000000..f5dcd28 --- /dev/null +++ b/proto/address/address.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +package address; +option go_package = "./address"; + + +// 地址库 +service Method { + // 新增地址 + rpc Add(AddressAddRequest) returns (StatusReply) {}; + + // 修改地址 + rpc Set(AddressItem) returns (StatusReply) {}; + + // 获取一条地址 + rpc Get(IdentRequest) returns (AddressItem) {}; + + // 获取地址列表 + rpc List(FetchRequest) returns (AddressListReply) {}; + + // 删除一个地址 + rpc Del(AddressDelRequest) returns (StatusReply) {}; +} + +message AddressItem { + int64 id = 1; // ID + string phone = 2; // 手机号 + string country = 3; // 国家 + string province = 4; // 省 + string city = 5; // 市 + string area = 6; // 区 + string detail = 7; // 详情地址 + string contact = 8; // 联系人 + int32 status = 9; // 状态 -1为删除,1为正常,2为设置成默认 +} + +message AddressAddRequest { + string phone = 1; // 手机号 + string country = 2; // 国家 + string province = 3; // 省 + string city = 4; // 市 + string area = 5; // 区 + string detail = 6; // 详情地址 + string contact = 7; // 联系人 + int32 status = 8; // 状态 -1为删除,1为正常,2为设置成默认 +} + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + +message AddressListReply { + repeated AddressItem data = 1; // 地址列表 +} + +message AddressDelRequest { + repeated int64 id = 1; // ID +} \ No newline at end of file diff --git a/proto/cloud/cloud.proto b/proto/cloud/cloud.proto new file mode 100644 index 0000000..8d25e30 --- /dev/null +++ b/proto/cloud/cloud.proto @@ -0,0 +1,123 @@ +syntax = "proto3"; +package cloud; +option go_package = "./cloud"; + +// 全都需要登录 +service Method{ + // 本级目录列表 + rpc List(ListRequest) returns (ListResponse){} + // 目录树 + rpc DirTree(DirTreeRequest) returns (DirTreeResponse){} + // 本级及子级递归列表 + rpc Download(DownloadRequest) returns (ListResponse){} + // 创建文件/文件夹 + rpc Make(MakeRequest) returns (MakeResponse){} + // 修改文件/文件夹名称 + rpc Rename(RenameRequest) returns (Empty){} + // 移除文件/文件夹及其子级递归列表 + rpc Remove(RemoveRequest) returns (Empty){} + // 移动文件/文件夹及其子级递归列表 + rpc Move(MoveRequest) returns (Empty){} + // 复制文件/文件夹及其子级递归列表 + rpc Copy(CopyRequest) returns (Empty){} + // 分享文件/文件夹及其子级递归列表 + rpc Share(ShareRequest) returns (ShareResponse){} + // 解析分享内容 + rpc ParseShare(ParseShareRequest) returns (ParseShareResponse){} + +} + +message Empty{} +// authorization_identity 用户识别identity 由上下文传递 +// user_identity 用于鉴权 +message ListRequest { + string identity = 1; // 文件夹唯一标识,获取顶级的不传 + string name =2; //根据文件名称模糊查找,当该字段不为空时identity的限定失效 +} + +message ListResponse { + repeated UserFile list = 1; +} + + +message DirTreeRequest { + string identity = 1; // 文件夹唯一标识,获取顶级的不传 +} + +message DirTreeResponse { + repeated UserFile list = 1; // 只返回文件夹 +} + +message DownloadRequest { + repeated string list = 1; // identity列表,必传 +} + +message UserFile { + string identity =1; //唯一标识 + string name =2;//文件/文件夹名称 + string ext = 3;//后缀,文件夹时为空 + repeated string parent = 4; // 父级文件夹序列,按文件名称查询时候生效 + File file = 5;//文件信息 + string created_at = 7; + string updated_at = 8; + repeated UserFile children = 9;//子文件夹 +} + +message File{ + string identity =1; //唯一标识 + string path = 2;//文件路径 + int64 size = 3; // 文件大小,单位:B +} + +message MakeRequest { + string name =1;//文件/文件夹名称,必传 + string ext = 2;//后缀,文件夹传空即可 + string parent_identity = 3;// 父文件夹标识,选填 + int64 size = 4; // 文件大小,非文件夹时必传,单位:B + string hash = 5; // 文件hash值,非文件夹时必传 + string path = 6;// 文件地址,非文件夹时必传 + +} + +message MakeResponse { + string identity = 1; +} + +// 同级下,名称必须唯一 +message RenameRequest { + string identity = 1;//必传 + string name =2;//文件/文件夹名称,必传 + string ext = 3;//后缀,文件夹传空即可 +} + +message RemoveRequest { + repeated string list = 1; // identity列表 +} + + +message MoveRequest { + repeated string list = 1; // identity列表 + string target_identity = 2; // 目标文件夹标识,如果是顶级则不填 +} + +message CopyRequest { + repeated string list = 1; // identity列表 + string target_identity = 3; // 目标文件夹标识,如果是顶级则不填 +} + +message ShareRequest { + repeated string list = 1; // identity列表 + int64 days = 2;// 有效天数,默认永久 +} + +message ShareResponse { + string key = 1; // 解析分享内容关键key +} + +message ParseShareRequest { + string key = 1; // 解析分享内容关键key +} + +message ParseShareResponse { + repeated UserFile list = 1; +} \ No newline at end of file diff --git a/proto/company/main.proto b/proto/company/main.proto new file mode 100644 index 0000000..9cfe7ff --- /dev/null +++ b/proto/company/main.proto @@ -0,0 +1,221 @@ +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/feedback/feedback.proto b/proto/feedback/feedback.proto new file mode 100644 index 0000000..5c4dc30 --- /dev/null +++ b/proto/feedback/feedback.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; +package feedback; +option go_package = "./feedback"; + +// Feedback-建议反馈模块 +service Method{ + rpc List(ListRequest) returns (ListReply) {} + rpc Get(GetRequest) returns (GetReply) {} + rpc Add(AddRequest) returns (AddReply) {} + rpc Modify(ModifyRequest) returns (ModifyReply) {} + rpc Delete(DeleteRequest) returns (DeleteReply) {} + rpc Remark(RemarkRequest) returns (RemarkReply) {} + +} + + +message ListRequest { + int64 page = 1; // 页码,默认第一页 + int64 size = 2; // 单页显示数量,默认10,最多50 + string user_identity = 3; //用户唯一`标识,可选 + string username = 4; // 用户名称,可选 + int32 status = 5;// 条目状态,可选,默认0,全部查找 + int32 type = 6; //业务类型: 1,意见/2,反馈/3,申述等,默认0 调用方传 +} + +message ListReply { + int64 count = 1; + repeated FeedbackItem list = 2; +} + +message FeedbackItem{ + string identity = 1; + string user_identity = 2; + string username = 3; + int32 status = 4; //状态,1未处理,2已处理,也可以调用方自行设置,如果未设置则默认是1 + string created_at = 5; + string updated_at = 6; + string title = 7; + string content = 8; + repeated FeedbackImage images = 9; + string remark = 10; //反馈信息 + int32 type = 11; +} + +message FeedbackImage{ + string identity = 1; + string item_identity = 2; + string url = 3; +} +message GetRequest{ + string identity = 1; +} +message GetReply{ + FeedbackItem record = 1; + bool exists = 2; +} + +message AddRequest { + string user_identity = 1; + string username = 2; + int32 status = 3; //状态,1未处理,2已处理,也可以调用方自行设置,如果未设置则默认是1 + string title = 7; + string content = 8; + repeated FeedbackImage images = 9; + int32 type = 10; +} + +message AddReply { + string identity = 1; +} + +message ModifyRequest { + string identity = 1; + string user_identity = 2; + string username = 3; + int32 status = 4; //状态,1未处理,2已处理,也可以调用方自行设置,如果未设置则默认是1 + string title = 7; + string content = 8; + repeated FeedbackImage images = 9; + int32 type = 10; +} + +message ModifyReply { + +} + + +message DeleteRequest { + string identity = 1; +} + +message DeleteReply { + +} + +message RemarkRequest { + string identity = 1; + string remark = 2; + int32 status = 3; +} + +message RemarkReply { + +} \ No newline at end of file diff --git a/proto/license/license.proto b/proto/license/license.proto new file mode 100644 index 0000000..d2f9171 --- /dev/null +++ b/proto/license/license.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package license; +option go_package = "./;license"; + + +// license-许可证 +service Method{ + // 许可证验证 + rpc Verify(VerifyRequest) returns (VerifyReply) {} +} + +message VerifyRequest{ + string license_code = 1; // 许可证码 + string machine_code = 2; // 机器码 +} + +message VerifyReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} diff --git a/proto/mall/mall.proto b/proto/mall/mall.proto new file mode 100644 index 0000000..c337e93 --- /dev/null +++ b/proto/mall/mall.proto @@ -0,0 +1,170 @@ +syntax = "proto3"; +package mall; +option go_package = "./mall"; + +// EC-Mall模块 +service Store { + // 店铺列表 + rpc List(Empty) returns(StoreListReply) {}; + + // 获取所有分类数据 + rpc Category(UniqueIndex) returns(CategoryReply) {}; + + // 推荐商品 + rpc Recommend(RecommendRequest) returns(RecommendReply) {}; + + // 商品列表 + rpc ProductList(ListRequest) returns(ListReply) {}; + + // 商品搜索 + rpc Search(SearchRequest) returns(ListReply) {}; + + // 商品详情 + rpc ProductGet(GetRequest) returns (GetReply) {}; + + // 评论列表 + rpc CommentList(CommentListRequest) returns (CommentListReply) {}; +} +message Empty{ +} + +message StoreListReply{ + repeated StoreBasic data = 1; +} + +message StoreBasic{ + int64 id =1; + string key=2; //店铺唯一KEY + string title=3; // 标题 + string intro=4; // 描述说明 + string template=5; // 模板 + string configs=6; // 配置说明 + string created_at = 7; //创建时间 +} + +// 店铺唯一KEY +message UniqueIndex { + string store_key = 1; //店铺唯一KEY +} + +// 产品分类数据列表 +message CategoryReply{ + repeated CategoryItem data = 1; +} + + +message CategoryItem{ + int64 id = 1; //ID + string title = 2; //名称 + string en_title = 3; //英文名称 + string keys =4; //关键词 + int64 parent_id = 5; //上级ID + string paths = 6; //路径 + string intro = 7; //简介 + string icon = 8; //图标 + int64 sort = 9; //排序 +} + +message RecommendRequest { + string store_key = 1; //店铺唯一KEY + int32 code = 2; //推荐状态码 + int32 number = 3; //数量 +} + +message RecommendReply { + //推荐商品列表 + repeated ProductItem data = 1; +} + +message ListRequest { + string store_key = 1; //店铺唯一KEY + int64 category_id = 2; //分类ID + int32 page = 3; // 当前页数,默认第一页,取值1~50 页 + int32 size = 4; // 每页显示条数,默认10条,取值1~50 条/每次 +} + +message SearchRequest { + string store_key = 1; //店铺唯一KEY + int64 category_id = 2; //分类ID + string keyword = 3; //关键字 + int32 page = 4; // 当前页数,默认第一页,取值1~50 页 + int32 size = 5; // 每页显示条数,默认10条,取值1~50 条/每次 +} + +message ListReply { + int64 count = 1; // 课程数量 + repeated ProductItem data = 2;//商品数据列表 +} + +message ProductItem{ + int64 id = 1; //商品ID + string identity = 2; //商品唯一码 + int64 supply_id =4; //供应商ID + int32 types = 5; //商品类型:Product=1 实体商品,Service=2 服务,Membership=3 会员服务,Other=4 其它 + int64 category_id = 6; //分类ID + string category_paths = 7; //分类路径 + string title = 8; //商品标题 + string sub_title = 9; //商品标题 + string keyword = 10; //商品关键字 + string cover_image = 11; //商品封面图片 + int32 stock = 12; //库存 + int64 sales_price = 13; //销售价 + string content = 14; //商品详情 + string args = 15; //商品相关参数JSON + int64 star = 16; //商品星级 + int32 comment_total = 17; //评论总数 + int32 sale_total = 18; //销售总数 + int32 view_total = 19; //查看总数 + int32 image_total = 20; //图片总数 + int32 recommend = 21; //推荐码:0不推荐,1推荐的状态 + int32 sort = 22; //排序 + int32 status = 23; //状态(0未上架,1上架) +} + +message GetRequest { + string identity = 1; //商品唯一码 + string store_key = 2; //店铺唯一KEY +} + +message GetReply { + ProductItem detail = 1; //商品详情数据 + repeated AttrItem attr = 2; //商品属性数据 + repeated PhotosItem photos = 3; //商品相册数据 +} + +message AttrItem{ + int64 id = 1; //属性ID + string name = 2; //属性名称 + int32 parent_id =3; //上级ID + string value = 4; //属性值 +} + +message PhotosItem{ + int64 id = 1; //相册ID + string name = 2; //相册名称 + string url =3; //URL + int32 sort = 4; //排序 + } + + +message CommentItem{ + int64 id = 1; //ID + string created = 2; //创建时间 + int64 passport_id = 4; //评论人ID + string passport_identity = 5; //用户名称 + string nickname = 6; //用户名称 + int32 score = 7; //评分 + string comment = 8; //评论正文 + string reply = 9; //回复正文 +} + +message CommentListRequest { + string product_identity = 1; //商品Identity + int32 page = 2; // 当前页数,默认第一页,取值1~50 页 + int32 size = 3; // 每页显示条数,默认10条,取值1~50 条/每次 +} + +message CommentListReply { + int64 count = 1; // 课程数量 + repeated CommentItem data = 2;//评论列表 +} \ No newline at end of file diff --git a/proto/notify/mail.proto b/proto/notify/mail.proto new file mode 100644 index 0000000..85aa1a1 --- /dev/null +++ b/proto/notify/mail.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package notify; +option go_package="./notify"; + +// Mail method +service Mail { + rpc Send(MailSendRequest) returns (MailSendResponse); +} + +// sms module +message MailSendRequest { + string sign_name = 1; // 必传项 +} + +message MailSendResponse { + string request_id = 1; +} \ No newline at end of file diff --git a/proto/notify/push.proto b/proto/notify/push.proto new file mode 100644 index 0000000..d1f2bf0 --- /dev/null +++ b/proto/notify/push.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package notify; +option go_package="./notify"; + +// E:\working\Practice\bsm-service-base\notify\proto\mail.proto START + +// Mail method +service Mail { + rpc Send(MailSendRequest) returns (MailSendResponse); +} + +// sms module +message MailSendRequest { + string sign_name = 1; // 必传项 +} + +message MailSendResponse { + string request_id = 1; +} +// END diff --git a/proto/notify/sms.proto b/proto/notify/sms.proto new file mode 100644 index 0000000..24f57d7 --- /dev/null +++ b/proto/notify/sms.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package notify; +option go_package="./notify"; + +// sms method +service Sms { + rpc Send(SmsSendRequest) returns (SmsSendResponse); + rpc Verify(SmsVerifyRequest) returns (PassResponse); +} + +// sms module +message SmsSendRequest { + string sign_name = 1; // 必传项 + string template_code = 2; // 必传项 + string phone = 3; // 必传项 + map paramters=5; + // 验证码相关 + bool generate_code =6; //是否生成验证码 + int64 expire_interval = 7;//验证码缓存时间,单位:分钟,仅generate_code为true时会缓存,默认5分钟 + int64 code_width = 8; //验证码长度,默认 4 + string code_key = 9; //template_code 模板中验证码的标识,默认code + bool has_black_list_filter = 10; // 是否黑单过滤,默认不过滤 + bool wihout_limit = 11;//忽略每天短信条数上线限制,默认不忽略 +} + +message SmsSendResponse { + // string request_id = 1; + string biz_id = 2; +} + +message SmsVerifyRequest { + // string request_id = 1; + string phone = 2; + string code = 3; +} + + +message PassResponse{ + bool pass =1; +} \ No newline at end of file diff --git a/proto/order/cart.proto b/proto/order/cart.proto new file mode 100644 index 0000000..b98308a --- /dev/null +++ b/proto/order/cart.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; +package order; +option go_package = "./order"; + + +message Empty{ +} + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + + + +// Order(订单)微服务-购物车 +service Cart { + // 获取购物车的商品数据 + rpc Get(CartGetRequest) returns (CartGetReply) {}; + + // 将商品增加至购物车 + rpc Add(CartAddRequest) returns (StatusReply) {}; + + // 修改购物车中的商品数量 + rpc Set(CartSetRequest) returns (StatusReply) {}; + + // 删除购物车中的商品 + rpc Del(CartDelRequest) returns (StatusReply) {}; +} + +message CartGetRequest { + string cartIdentity =1; // 购物车唯一码,主要是用于未登录购物 + string passportIdentity =2; // 登录后的用户唯一码 +} + +message CartGetReply { + repeated CartItem data = 1; // 购物车中的商品数据列表 +} + +message CartItem{ + int64 id = 1; // ID + int64 productId = 2; // 商品ID + string title = 3; //商品名称 + string coverImage = 4; //商品封面图片 + int64 salesPrice = 5; //商品销售价格 + string productArgs =6; // 商品属性 + int32 number = 7; // 数量 + int64 unitPrice = 8; // 实际单价 + int64 totalPrice = 9; // 总价 +} + +message CartAddRequest { + string cartIdentity =1; // 购物车唯一码,主要是用于未登录购物 + string passportIdentity =2; // 登录后的用户唯一码 + int64 productId = 4; // 商品ID + string productArgs =5; // 商品属性 + int32 number = 6; // 数量 +} + +message CartSetRequest { + int64 id = 1; // 购物车ID + int32 number = 2; // 数量 + int64 unitPrice = 3; // 单价 +} + +message CartDelRequest { + repeated int64 id = 3; // 购物车ID +} \ No newline at end of file diff --git a/proto/order/coupon.proto b/proto/order/coupon.proto new file mode 100644 index 0000000..0cd6b72 --- /dev/null +++ b/proto/order/coupon.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package order; +option go_package = "./order"; + + +message Empty{ +} + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + + + +// Order(订单)微服务-优惠卷 +service Coupon { + + // 按状态获取优惠卷 + rpc ByStatus(Status) returns (CouponListReply) {}; +} + +message Status { + int32 status = 1; //优惠卷状态 +} + +message CouponListReply { + repeated CouponItem data = 1; // 购物车中的商品数据列表 +} + +message CouponItem{ + int64 id = 1; // ID + string identity = 2; // 唯一码 + string title = 3; //标题 + string intro = 4; //描述 + string amount = 5; //金额 + string started =6; // 开始时间 + string expired =7; // 结束时间 + string status =8; // 状态 +} \ No newline at end of file diff --git a/proto/order/purch.proto b/proto/order/purch.proto new file mode 100644 index 0000000..496f8ea --- /dev/null +++ b/proto/order/purch.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package order; +option go_package = "./order"; + + +message Empty{ +} + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + + + +// Order(订单)微服务-采购计划微服务 +service Purch { + // 创建采购计划 + rpc CreatePlan(PlanItem) returns (StatusReply) {}; + + // 修改采购计划 + rpc ModifyPlan(PlanItem) returns (StatusReply) {}; + + // 采购计划列表 + rpc FetchPlan(FetchRequest) returns (FetchReply) {}; + + // 作废采购计划 + rpc CancelPlan(CancelPlanRequest) returns (StatusReply) {}; +} + +message PlanItem{ + int64 id = 1; // ID + int64 identity = 2; // 计划唯一标识 + string title = 3; //计划名称 + string descr = 4; //计划描述 + string passport_identity =5; // 用户唯一码 +} + +message FetchReply { + repeated PlanItem data = 1; // 采购计划列表 +} + +message CancelPlanRequest { + repeated int64 id = 3; +} diff --git a/proto/order/summary.proto b/proto/order/summary.proto new file mode 100644 index 0000000..13a2ed2 --- /dev/null +++ b/proto/order/summary.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; +package order; +option go_package = "./order"; + + +message Empty{ +} + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + + + +// Order(订单)微服务-订单模块 +// 需要检验Token,登录后获得 +service Summary { + // 基于Token快速创建一个订单 + rpc QuickCreateByToken(QuickCreateByTokenRequest) returns (StatusReply) {}; + + // 将购物车的数据提交生成订单 + rpc Submit(SubmitRequest) returns (StatusReply) {}; + + // 检测是否有未确认及付款的订单 + rpc Check(Empty) returns (StatusReply) {}; + + // 获取一个订单的详情数据 + rpc Get(IdentRequest) returns (SummaryGetReply) {}; + + // 根据不同的类型获取我的订单列表 + // 类型: + // All:全部 + // Unpaid:未付款 + // Paid:已付款 + // NotDelivered:未发货 + // Delivered:已发货 + // NotComment:待评论 + rpc List(SummaryListRequest) returns (SummaryListReply) {}; + + // 确认订单,物流,优惠卷等其它信息 + rpc Confirm(ConfirmRequest) returns (ConfirmReply) {}; + + + // 取消订单 + rpc Cancel(CancelRequest) returns (StatusReply) {}; +} + +message QuickCreateByCodeRequest{ + int32 partner_id =1; // 合伙人ID + string product_identity = 2; // 商品唯一码 + int32 number = 3; // 数量 + string phone = 4; // 手机号 + string address = 5; // 详情地址 + string contact = 6; // 联系人 + string code=7;//短信验证码 +} + +message QuickCreateByTokenRequest{ + int32 partner_id =1; // 合伙人ID + string product_identity = 2; // 商品唯一码 + int32 number = 3; // 数量 + string args = 5; // 相关参数 +} + +message SubmitRequest { + repeated string id = 1; // 购物车的ID数据,以逗号分开 + int32 partner_id =2; // 合伙人ID + int64 address_id=3; // 地址ID +} + + +message SummaryGetReply { + OrderSummary summary = 1; // 订单概要详情 + repeated OrderDetails details = 2; // 订单商品详情 +} + +message OrderSummary { + int64 id = 1; // ID + string order_no = 2; // 订单唯一码 + int32 partner_id =3; // 合伙人ID + string tradeNo = 4; // 支付交易号 + int32 payType = 5; // 支付类型 + string address = 6; // 收货地址 + int64 total_price = 7; // 总价 + int64 trans_price = 8; // 交易金额 + int64 refund_price = 9; // 退款金额 + string logistics_number = 10; // 物流信息 + int64 logistics_fee = 11; // 物流信息 + int64 coupon_amount = 12; // 物流信息 + string remark = 13; // 备注 + int32 status = 14; // 订单状态 + string payTime = 15; // 支付时间 + string created = 16; // 创建时间 + string updated = 17; // 最后创建时间 + repeated OrderDetails details =18; //订单商品 +} + +message OrderDetails{ + int64 id = 1; // ID + int64 product_id = 2; // 商品ID + int32 type = 3; // 商品类型 + string title = 4; //商品名称 + string cover_image = 5; //商品封面图片 + string sales_price = 6; //商品销售价格 + string product_args = 7; // 商品参数 + int32 number = 8; // 数量 + int64 unitPrice = 9; // 单价 +} + +message SummaryListRequest { + string type = 1; // 订单类型 +} + +message SummaryListReply { + repeated OrderSummary summary = 1; // 订单列表 +} + +message ConfirmRequest { + int64 order_no = 1; // 订单唯一码 + int64 address_id = 2; // 订单唯一码 + string coupon_identity = 3; // 优惠卷 + string remark = 4; //备注 + double logisticsFee = 5; //运费 +} + +message ConfirmReply { + int64 total_price = 1; // 总价 +} + + +message CancelRequest { + int64 order_no = 1; // 订单唯一码 + string type = 2; // 订单类型 +} \ No newline at end of file diff --git a/proto/passport/blocks.proto b/proto/passport/blocks.proto new file mode 100644 index 0000000..ee6b3e0 --- /dev/null +++ b/proto/passport/blocks.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; +package passport; +option go_package = "./;passport"; diff --git a/proto/passport/forget.proto b/proto/passport/forget.proto new file mode 100644 index 0000000..4d19dc8 --- /dev/null +++ b/proto/passport/forget.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package passport; +option go_package = "./passport"; + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message VersionRequest { + int64 version=1; // 时序版本号 +} + + +message SearchRequest { + string keyword=1; //关键词 +} + + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + +message Empty{ +} + +// Passport-通行证模块 +service Forget{ + // 验证手机号和验证码 + rpc Verify(VerifyRequest) returns(StatusReply) {} + + // 重罢密码 + rpc Reset(ForgetResetRequest) returns (ForgetReply) {} +} + +message VerifyRequest { + string phone = 1; //手机号 + string code = 2; // 验证码 +} + + +message ForgetResetRequest { + string identity = 1; //唯一码 + string password = 2; // 密码 +} + +message ForgetReply { + string identity = 1; //用户唯一码 + string data_bind = 2; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 + string token = 3; //用户凭证 + map extend = 4; //扩展字段 +} \ No newline at end of file diff --git a/proto/passport/info.proto b/proto/passport/info.proto new file mode 100644 index 0000000..01e8d92 --- /dev/null +++ b/proto/passport/info.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; +package passport; +option go_package = "./passport"; + + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message VersionRequest { + int64 version=1; // 时序版本号 +} + + +message SearchRequest { + string keyword=1; //关键词 +} + + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + +message Empty{ +} + +// Passport(会员通行证)模块-数据 +// *此模块需要Token验证 +service Info{ + // 绑定资料 + rpc Bind(BindRequest) returns (StatusReply) {} + + // 获取会员的所有信息数据 + rpc GetData(Empty) returns (GetDataReply) {} + + // 更新会员的信息数据 + // 字段值为空或是0,将不更新此数据 + rpc SetData(SetDataRequest) returns (StatusReply) {} + + // 更新会员的密码 + rpc SetPassword(SetPasswordRequest) returns (StatusReply) {} + + // 获取会员的相关统计数据 + rpc Statistics(StatisticsRequest) returns (StatisticsReply) {} +} + + +message BindRequest { + string action =1; //操作动作 + string phone = 2; // 手机号码 必填 + string code = 3; // 验证码 + string password = 4; // 密码 必填 + string nickname = 5; // 昵称 +} + + +message GetDataReply { + string account = 1; //帐号 + string phone = 2; //手机号 + string nickname = 3; //昵称 + string avatar = 4; //头像 + string birthday = 5; //生日 + int32 sex = 6; //性别,1为男性,2为女性 + int32 province = 7; //省 + int32 city = 8; //市 + int32 area = 9; //区 + string sign = 10; //签名 + int32 approve = 11; //状态:-2,认证未通过,0为未认证,1为审核中,2为认证成功 +} + +message SetDataRequest { + string nickname = 1; //昵称 + string avatar = 2; //头像 + string birthday = 3; //生日 + int32 sex = 4; //性别,1为男性,2为女性 + int32 province = 5; //省 + int32 city = 6; //市 + int32 area = 7; //区 + string sign = 8; //签名 +} + +message SetPasswordRequest { + string old_password = 3; // 旧密码 + string new_password = 4;// 新密码 +} + + +message StatisticsRequest { + repeated string field = 1; //要获取的统计数据字段。 +} + +message StatisticsReply { + map Data=1; //数据以Map格式输出 +} \ No newline at end of file diff --git a/proto/passport/login.proto b/proto/passport/login.proto new file mode 100644 index 0000000..8add584 --- /dev/null +++ b/proto/passport/login.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; +package passport; +option go_package = "./passport"; + + +message FetchRequest { + int64 page_no=1; // 页数 + int64 page_size=2; // 每页记录数 + map params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11 +} + +message IdentRequest{ + int64 id = 1; // 唯一ID + string identity = 2; // 唯一码 +} + +message VersionRequest { + int64 version=1; // 时序版本号 +} + + +message SearchRequest { + string keyword=1; //关键词 +} + + +message StatusReply{ + int64 status = 1; // 状态码 + string identity=2; // 标识码 + string message=3; //状态说明 + int64 timeseq=4; // 响应时间序列 +} + +message Empty{ +} + +// Passport-通行证模块-登录 +service Login{ + // 通过密码登录 + rpc Pwd(LoginByPwdRequest) returns (LoginReply) {} + + // 通过验证码登录 + rpc Code(LoginByCodeRequest) returns (LoginReply) {} + + // 通过Wechat登录 + rpc WeChatByCode(WeChatByCodeRequest) returns (WeChatByCodeReply) {} + rpc WeChatByPhone(WeChatByPhoneRequest) returns (WeChatByPhoneReply) {} + rpc WeChatGetUserinfo(WeChatByPhoneRequest) returns (WeChatGetUserinfoReply) {} + + // 通过AppleID登录 + rpc AppleID(LoginByAppleIDRequest) returns (LoginReply) {} + + // 通过验证码登录并注册 + rpc CodeAndRegister(LoginByCodeRequest) returns (LoginReply) {} +} + + +message LoginByPwdRequest { + string account = 1; // 账号 必填 + string password = 2; // 密码 必填 + string device = 3; // 设备 必填 +} + + +message LoginByCodeRequest { + string country = 1; // 国家 + string phone = 2; // 手机号码 + string code = 3; // 验证码 + string device = 4;// 设备 +} + +message WeChatByCodeRequest { + string code = 1; // WeChat code + int64 agency_id=2; // 代理ID + int64 staff_id=3; // 工作人员ID +} + +message WeChatByPhoneReply { + string account = 1; // WeChat code +} + +message WeChatByCodeReply { + string session_key = 1; // WeChat session key + string open_id = 2; // WeChat open id + string identity = 3; // identity + string account = 4; // account +} + +message WeChatByPhoneRequest { + string session_key = 1; // WeChat session key + string open_id = 2; // open_id + string data = 3; // data + string iv = 4; // iv + string identity = 5; // identiy +} + +message WeChatGetUserinfoReply { + int64 id=1; + string account=2; + string identity=3; + string nickname=4; + string avatar=5; + string rights=6; + string token=7; +} + +message LoginByAppleIDRequest { + string apple_id = 1; // apple id + string desc = 2; // 描述 + string device = 3;// 设备 +} + +message LoginReply { + int64 id=1; + string identity = 2; //用户唯一码 + string data_bind = 3; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 + string token = 4; //用户凭证 + map extend = 5; //扩展字段 +} + diff --git a/proto/passport/register.proto b/proto/passport/register.proto new file mode 100644 index 0000000..06fabe6 --- /dev/null +++ b/proto/passport/register.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package passport; +option go_package = "./passport"; + +// Passport-通行证模块-注册 +service Register{ + // 帐号密码注册 + rpc Pwd(RegisterRequest) returns (RegisterReply) {} + + // 手机验证码注册 + rpc Code(RegisterRequest) returns (RegisterReply) {} + + // Wechat注册 + rpc WeChat(RegisterRequest) returns (RegisterReply) {} + + // AppleID注册 + rpc AppleID(RegisterRequest) returns (RegisterReply) {} +} + + +message RegisterRequest { + string origin = 1; //来源,归属 + string account = 2; //帐号 + string phone = 3; //手机号 + string password = 4; //密码 + string code = 5; //验证码 + string wechat_union_id = 6; //微信UnionID + string wechat_open_id = 7; //微信OpenID + string apple_id = 8; //Apple ID + string nickname = 9; //昵称 + string type = 10; //类型 + string device = 11; //设备 + int64 agency_id=12; // 代理ID + int64 staff_id=13; // 工作人员ID +} + +message RegisterReply { + int64 id=1; + string identity = 2; //用户唯一码 + string data_bind = 3; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码 + string token = 4; //用户Header所需Token + map extend = 5; //扩展字段 +}