fusenapi/server_api/auth.api

60 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-07-24 09:22:06 +00:00
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);
2023-07-26 16:03:38 +00:00
2023-07-24 09:22:06 +00:00
@handler AcceptCookieHandler
2023-07-24 11:17:02 +00:00
post /api/auth/accept-cookie(request) returns (response);
2023-07-26 16:03:38 +00:00
2023-07-24 09:22:06 +00:00
@handler UserGoogleLoginHandler
2023-07-24 11:17:02 +00:00
get /api/auth/oauth2/login/google(RequestGoogleLogin) returns (response);
2023-07-26 16:03:38 +00:00
@handler UserEmailConfirmationHandler
get /api/auth/email/confirmation(RequestEmailConfirmation) returns (response);
2023-07-24 09:22:06 +00:00
@handler UserEmailRegisterHandler
2023-07-24 11:43:56 +00:00
get /api/auth/oauth2/register(RequestEmailRegister) returns (response);
2023-07-24 09:22:06 +00:00
}
// 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"`
2023-07-26 16:03:38 +00:00
}
type RequestEmailConfirmation {
Email string `json:"email"` // 要确认的email
Token string `json:"token"` // 操作Token
2023-07-24 09:22:06 +00:00
}
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
}