All checks were successful
Build docker and publish / prepare (20.15.1) (push) Successful in 11s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Successful in 4m32s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Successful in 8m6s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Successful in 4m26s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Successful in 3m55s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.rpc-core image_name:ppanel-rpc-core name:rpc-core]) (push) Successful in 8m23s
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Successful in 4m1s
Build docker and publish / deploy (push) Successful in 45s
Build docker and publish / notify (push) Successful in 3s
80 lines
2.2 KiB
Plaintext
80 lines
2.2 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "认证接口"
|
|
)
|
|
|
|
type (
|
|
UserLoginReq {
|
|
Identifier string `json:"identifier"`
|
|
Email string `json:"email" validate:"required"`
|
|
Password string `json:"password" validate:"required"`
|
|
IP string `header:"X-Original-Forwarded-For,optional"`
|
|
UserAgent string `header:"User-Agent,optional"`
|
|
LoginType string `header:"Login-Type,optional"`
|
|
CfToken string `json:"cf_token,optional"`
|
|
}
|
|
|
|
LoginResp {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
DeviceLoginReq {
|
|
Identifier string `json:"identifier" validate:"required"`
|
|
UserAgent string `json:"user_agent" validate:"required"`
|
|
ShortCode string `json:"short_code,optional"`
|
|
CfToken string `json:"cf_token,optional"`
|
|
IP string `header:"X-Original-Forwarded-For,optional"`
|
|
}
|
|
|
|
UserRegisterReq {
|
|
Identifier string `json:"identifier"`
|
|
Email string `json:"email" validate:"required"`
|
|
Password string `json:"password" validate:"required"`
|
|
Invite string `json:"invite,optional"`
|
|
Code string `json:"code,optional"`
|
|
IP string `header:"X-Original-Forwarded-For,optional"`
|
|
UserAgent string `header:"User-Agent,optional"`
|
|
LoginType string `header:"Login-Type,optional"`
|
|
CfToken string `json:"cf_token,optional"`
|
|
}
|
|
|
|
ResetPasswordReq {
|
|
Identifier string `json:"identifier"`
|
|
Email string `json:"email" validate:"required"`
|
|
Password string `json:"password" validate:"required"`
|
|
Code string `json:"code,optional"`
|
|
IP string `header:"X-Original-Forwarded-For,optional"`
|
|
UserAgent string `header:"User-Agent,optional"`
|
|
LoginType string `header:"Login-Type,optional"`
|
|
CfToken string `json:"cf_token,optional"`
|
|
}
|
|
)
|
|
|
|
@server (
|
|
prefix: /api/v1/auth
|
|
group: auth
|
|
)
|
|
service ppanel-api {
|
|
@handler UserLoginHandler
|
|
post /login (UserLoginReq) returns (LoginResp)
|
|
|
|
@handler UserRegisterHandler
|
|
post /register (UserRegisterReq) returns (LoginResp)
|
|
|
|
@handler ResetPasswordHandler
|
|
post /reset (ResetPasswordReq) returns (LoginResp)
|
|
|
|
}
|
|
|
|
@server (
|
|
prefix: /api/v1/auth
|
|
group: auth
|
|
middleware: DecryptMiddleware
|
|
)
|
|
service ppanel-api {
|
|
@doc "设备登录"
|
|
@handler DeviceLoginHandler
|
|
post /login/device (DeviceLoginReq) returns (LoginResp)
|
|
}
|