fusenapi/server_api/home-user-auth.api

140 lines
5.9 KiB
Plaintext
Raw Normal View History

2023-05-31 03:38:17 +00:00
syntax = "v1"
info (
title: // TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
2023-05-31 10:33:02 +00:00
import "basic.api"
2023-05-31 03:38:17 +00:00
type request {
// TODO: add members here and delete this comment
2023-06-01 08:19:24 +00:00
// Name string `form:"name"` // parameters are auto validated
}
2023-06-06 12:08:32 +00:00
service home-user-auth {
@handler UserLoginHandler
2023-06-07 03:36:29 +00:00
post /user/login(RequestUserLogin) returns (response);
2023-06-06 12:08:32 +00:00
2023-06-14 10:17:45 +00:00
@handler AcceptCookieHandler
post /user/accept-cookie(request) returns (response);
2023-06-06 12:08:32 +00:00
@handler UserFontsHandler
get /user/fonts(request) returns (response);
2023-06-08 07:41:49 +00:00
@handler UserGetTypeHandler
2023-06-06 12:08:32 +00:00
get /user/get-type(request) returns (response);
@handler UserSaveBasicInfoHandler
post /user/basic-info(RequestBasicInfoForm) returns (response);
2023-06-07 10:30:58 +00:00
@handler UserStatusConfigHandler
2023-06-08 03:36:47 +00:00
post /user/status-config(request) returns (response);
2023-06-08 07:41:49 +00:00
2023-06-06 12:08:32 +00:00
@handler UserBasicInfoHandler
get /user/basic-info(request) returns (response);
2023-06-08 10:55:08 +00:00
@handler UserAddressListHandler
get /user/address-list(request) returns (response);
2023-06-06 12:08:32 +00:00
}
2023-06-05 09:56:55 +00:00
type RequestBasicInfoForm {
2023-06-15 08:08:43 +00:00
FirstName string `form:"first_name,optional" db:"first_name"` // FirstName
LastName string `form:"last_name,optional" db:"last_name"` // LastName
Company string `form:"company,optional" db:"company"` // 公司名称
Mobile string `form:"mobile,optional" db:"mobile"` // 手机号码
Email string `form:"email" db:"email"` // 邮箱
// Status int64 `form:"status,optional" db:"status"` // 1正常 0不正常
IsOrderStatusEmail int64 `form:"is_order_status_email,optional" db:"is_order_status_email"` // 订单状态改变时是否接收邮件
IsEmailAdvertisement int64 `form:"is_email_advertisement,optional" db:"is_email_advertisement"` // 是否接收邮件广告
IsOrderStatusPhone int64 `form:"is_order_status_phone,optional" db:"is_order_status_phone"` // 订单状态改变是是否接收电话
IsPhoneAdvertisement int64 `form:"is_phone_advertisement,optional" db:"is_phone_advertisement"` // 是否接收短信广告
IsOpenRender int64 `form:"is_open_render,optional" db:"is_open_render"` // 是否打开个性化渲染1开启0关闭
IsLowRendering int64 `form:"is_low_rendering,optional" db:"is_low_rendering"` // 是否开启低渲染模型渲染
IsRemoveBg int64 `form:"is_remove_bg,optional" db:"is_remove_bg"` // 用户上传logo是否去除背景
2023-06-05 09:56:55 +00:00
2023-06-15 08:08:43 +00:00
// NewPassword string `form:"new_password,optional" db:"new_password"` // new_password 如果存在新密码
2023-06-05 09:56:55 +00:00
}
2023-06-01 10:35:09 +00:00
// UserLoginHandler 用户登录请求结构
type RequestUserLogin {
2023-06-08 10:55:08 +00:00
Name string `json:"name"`
Password string `json:"pwd"`
2023-06-01 10:35:09 +00:00
}
// UserLoginHandler 用户登录请求结构
type DataUserLogin {
2023-06-15 08:08:43 +00:00
Token string `json:"token"` // 登录jwt token
}
// DataGuest 游客获取toekn请求结构
type DataGuest {
Token string `json:"token"` // 登录jwt token
2023-06-01 10:35:09 +00:00
}
// UserBasicInfoHandler 返回data结构
type DataUserBasicInfo {
2023-06-15 08:08:43 +00:00
Type int64 `db:"type"` // 1普通餐厅 2连锁餐厅
IsOrderStatusEmail bool `db:"is_order_status_email"` // 订单状态改变时是否接收邮件
IsEmailAdvertisement bool `db:"is_email_advertisement"` // 是否接收邮件广告
IsOrderStatusPhone bool `db:"is_order_status_phone"` // 订单状态改变是是否接收电话
IsPhoneAdvertisement bool `db:"is_phone_advertisement"` // 是否接收短信广告
IsOpenRender bool `db:"is_open_render"` // 是否打开个性化渲染1开启0关闭
IsThousandFace bool `db:"is_thousand_face"` // 是否已经存在千人千面1存在0不存在
IsLowRendering bool `db:"is_low_rendering"` // 是否开启低渲染模型渲染
IsRemoveBg bool `db:"is_remove_bg"` // 用户上传logo是否去除背景
2023-06-01 10:35:09 +00:00
}
2023-06-15 08:08:43 +00:00
2023-06-01 10:35:09 +00:00
// /user/get-type reponse.data 结构
type DataGetType {
2023-06-01 08:19:24 +00:00
Id int64 `db:"id" json:"key"` // ID
Name string `db:"name" json:"name"` // 餐厅名字
2023-06-08 02:51:56 +00:00
}
// KeyName 普通的key name 对象结构. eg: /user/status-config 用在返回值
type KeyName {
2023-06-08 03:36:47 +00:00
Key int `json:"key"`
2023-06-08 02:51:56 +00:00
Name string `json:"name"`
}
// KeyNameButton 普通的key name button 对象结构 eg: /user/status-config 用在返回值
type KeyNameButton {
2023-06-08 03:36:47 +00:00
Key int `json:"key"`
2023-06-08 02:51:56 +00:00
Name string `json:"name"`
Button []string `json:"button"`
}
// DataStatusConfig /user/status-config 返回值data结构
type DataStatusConfig {
SearchList []KeyName `json:"search_list"` //搜索下拉列表
OrderStatus []KeyNameButton `json:"order_status"` //直邮单状态
InventoryStatus []KeyNameButton `json:"Inventory_status"` //云仓单状态
OrderLogisticsStatus []KeyName `json:"order_logistics_status"` //订单物流状态
InventoryLogisticsStatus []KeyName `json:"Inventory_logistics_status"` //订单物流状态
Time []KeyName `json:"time"` //返回订单时间筛选项
RefundReason []KeyName `json:"refund_reason"` //退款原因说明项
2023-06-08 03:36:47 +00:00
LogisticsStatus []KeyNameButton `json:"logistics_status"` //物流状态筛选项
2023-06-08 07:41:49 +00:00
}
// DataAddressList /user/address-list 返回值
type DataAddressList {
Id int64 `db:"id"`
UserId int64 `db:"user_id"` // 用户ID
Name string `db:"name"` // 地址名称
FirstName string `db:"first_name"` // FirstName
LastName string `db:"last_name"` // LastName
Mobile string `db:"mobile"` // 手机号码
Street string `db:"street"` // 街道
Suite string `db:"suite"` // 房号
City string `db:"city"` // 城市
State string `db:"state"` // 州名
// Country string `db:"country"` // 国家
ZipCode string `db:"zip_code"` // 邮编
// Status int64 `db:"status"` // 1正常 0异常
IsDefault int64 `db:"is_default"` // 1默认地址0非默认地址
2023-06-07 03:57:04 +00:00
}