save
This commit is contained in:
53
server_api/auth.api
Normal file
53
server_api/auth.api
Normal file
@@ -0,0 +1,53 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: // TODO: add title
|
||||
desc: // TODO: add description
|
||||
author: ""
|
||||
email: ""
|
||||
)
|
||||
|
||||
import "basic.api"
|
||||
|
||||
service auth {
|
||||
@handler UserLoginHandler
|
||||
post /api/auth/login(RequestUserLogin) returns (response);
|
||||
|
||||
@handler AcceptCookieHandler
|
||||
post /api/user/accept-cookie(request) returns (response);
|
||||
|
||||
@handler UserGoogleLoginHandler
|
||||
get /api/user/oauth2/login/google(RequestGoogleLogin) returns (response);
|
||||
|
||||
@handler UserEmailRegisterHandler
|
||||
get /api/user/oauth2/login/register(RequestEmailRegister) returns (response);
|
||||
}
|
||||
|
||||
// UserAddAddressHandler 用户登录请求结构
|
||||
type RequestUserLogin {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type RequestGoogleLogin {
|
||||
Code string `form:"code"`
|
||||
Scope string `form:"scope"`
|
||||
AuthUser string `form:"authuser"`
|
||||
Prompt string `form:"prompt"`
|
||||
Email string `form:"email,optional"`
|
||||
}
|
||||
|
||||
type RequestEmailRegister {
|
||||
Email string `json:"email"`
|
||||
RegisterToken string `json:"register_token"`
|
||||
}
|
||||
|
||||
// UserLoginHandler 用户登录请求结构
|
||||
type DataUserLogin {
|
||||
Token string `json:"token"` // 登录jwt token
|
||||
}
|
||||
|
||||
// DataGuest 游客获取toekn请求结构
|
||||
type DataGuest {
|
||||
Token string `json:"token"` // 登录jwt token
|
||||
}
|
||||
@@ -14,12 +14,6 @@ service home-user-auth {
|
||||
// @handler UserRegisterHandler
|
||||
// post /api/user/register(RequestUserRegister) returns (response);
|
||||
|
||||
@handler UserLoginHandler
|
||||
post /api/user/login(RequestUserLogin) returns (response);
|
||||
|
||||
@handler AcceptCookieHandler
|
||||
post /api/user/accept-cookie(request) returns (response);
|
||||
|
||||
@handler UserFontsHandler
|
||||
get /api/user/fonts(request) returns (response);
|
||||
|
||||
@@ -50,12 +44,6 @@ service home-user-auth {
|
||||
@handler UserOderDeleteHandler
|
||||
post /api/user/order-delete(RequestOrderId) returns (response);
|
||||
|
||||
@handler UserGoogleLoginHandler
|
||||
get /api/user/oauth2/login/google(RequestGoogleLogin) returns (response);
|
||||
|
||||
@handler UserEmailRegisterHandler
|
||||
get /api/user/oauth2/login/register(RequestEmailRegister) returns (response);
|
||||
|
||||
//订单列表
|
||||
@handler UserOrderListHandler
|
||||
get /api/user/order-list (UserOrderListReq) returns (response);
|
||||
@@ -136,19 +124,6 @@ type Product {
|
||||
IsStop int64 `json:"is_stop"`
|
||||
}
|
||||
|
||||
type RequestGoogleLogin {
|
||||
Code string `form:"code"`
|
||||
Scope string `form:"scope"`
|
||||
AuthUser string `form:"authuser"`
|
||||
Prompt string `form:"prompt"`
|
||||
Email string `form:"email,optional"`
|
||||
}
|
||||
|
||||
type RequestEmailRegister {
|
||||
Email string `json:"email"`
|
||||
RegisterToken string `json:"register_token"`
|
||||
}
|
||||
|
||||
type RequestContactService {
|
||||
Type string `json:"type"` // 类型
|
||||
RelationID int64 `json:"relation_id"` // 关系id
|
||||
@@ -176,12 +151,6 @@ type RequestBasicInfoForm {
|
||||
// NewPassword string `form:"new_password,optional" db:"new_password"` // new_password 如果存在新密码
|
||||
}
|
||||
|
||||
// UserAddAddressHandler 用户登录请求结构
|
||||
type RequestUserLogin {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
// RequestAddAddress 增加地址结构
|
||||
type RequestAddAddress {
|
||||
Id int64 `json:"id"` // address_id 地址id
|
||||
@@ -204,15 +173,7 @@ type RequestOrderId {
|
||||
RefundReason string `json:"refund_reason"` //取消原因
|
||||
}
|
||||
|
||||
// UserLoginHandler 用户登录请求结构
|
||||
type DataUserLogin {
|
||||
Token string `json:"token"` // 登录jwt token
|
||||
}
|
||||
|
||||
// DataGuest 游客获取toekn请求结构
|
||||
type DataGuest {
|
||||
Token string `json:"token"` // 登录jwt token
|
||||
}
|
||||
|
||||
// UserBasicInfoHandler 返回data结构
|
||||
type DataUserBasicInfo {
|
||||
|
||||
Reference in New Issue
Block a user