fusenapi/server_api/auth.api
2023-07-27 16:48:43 +08:00

61 lines
1.4 KiB
Plaintext

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/auth/accept-cookie(request) returns (response);
@handler UserGoogleLoginHandler
get /api/auth/oauth2/login/google(RequestGoogleLogin) returns (response);
@handler UserEmailConfirmationHandler
get /api/auth/email/confirmation(RequestEmailConfirmation) returns (response);
@handler UserEmailRegisterHandler
get /api/auth/oauth2/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"`
}
type RequestEmailConfirmation {
Token string `query:"token"` // 操作Token
}
type RequestEmailRegister {
Email string `json:"email"`
WCId uint64 `json:"wcid"`
GuestId uint64 `json:"guest_id"`
RegisterToken string `json:"register_token"`
}
// UserLoginHandler 用户登录请求结构
type DataUserLogin {
Token string `json:"token"` // 登录jwt token
}
// DataGuest 游客获取toekn请求结构
type DataGuest {
Token string `json:"token"` // 登录jwt token
}