86 lines
3.5 KiB
Go
86 lines
3.5 KiB
Go
package v1
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
type ConfigGetReq struct {
|
|
g.Meta `path:"/config/{key}" method:"get" tags:"Config" summary:"获取配置"`
|
|
Key string `json:"key" v:"required#配置键不能为空"`
|
|
}
|
|
|
|
type ConfigUpdateReq struct {
|
|
g.Meta `path:"/config/{key}" method:"put" tags:"Config" summary:"更新配置" permission:"sys:config:edit"`
|
|
Key string `json:"key" v:"required#配置键不能为空"`
|
|
Value string `json:"value" v:"required#配置值不能为空"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
type ConfigListReq struct {
|
|
g.Meta `path:"/config" method:"get" tags:"Config" summary:"获取配置列表"`
|
|
Key string `json:"key"`
|
|
Page int `json:"page" d:"1"`
|
|
Size int `json:"size" d:"10"`
|
|
}
|
|
|
|
type ConfigPublicGetReq struct {
|
|
g.Meta `path:"/config/public/{key}" method:"get" tags:"Config" summary:"获取公开配置" auth:"false"`
|
|
Key string `json:"key" v:"required#配置键不能为空"`
|
|
}
|
|
|
|
type SmtpConfigGetReq struct {
|
|
g.Meta `path:"/config/smtp" method:"get" tags:"Config" summary:"获取邮件配置" permission:"sys:config:edit"`
|
|
}
|
|
|
|
type SmtpConfigUpdateReq struct {
|
|
g.Meta `path:"/config/smtp" method:"put" tags:"Config" summary:"更新邮件配置" permission:"sys:config:edit"`
|
|
|
|
AuthMode string `json:"authMode" v:"required#请选择邮件认证模式"`
|
|
|
|
SmtpHost string `json:"smtpHost"`
|
|
SmtpPort int `json:"smtpPort"`
|
|
SmtpUsername string `json:"smtpUsername"`
|
|
SmtpPassword string `json:"smtpPassword"`
|
|
|
|
FromEmail string `json:"fromEmail" v:"required|email#发件人邮箱不能为空|请输入正确的发件人邮箱"`
|
|
FromName string `json:"fromName" v:"required#发件人名称不能为空"`
|
|
|
|
OAuthTenant string `json:"oauthTenant"`
|
|
OAuthClientID string `json:"oauthClientId"`
|
|
OAuthClientSecret string `json:"oauthClientSecret"`
|
|
OAuthRedirectURL string `json:"oauthRedirectUrl"`
|
|
OAuthRefreshToken string `json:"oauthRefreshToken"`
|
|
OAuthScope string `json:"oauthScope"`
|
|
}
|
|
|
|
type SmtpTestReq struct {
|
|
g.Meta `path:"/config/smtp/test" method:"post" tags:"Config" summary:"发送测试邮件" permission:"sys:config:edit"`
|
|
ToEmail string `json:"toEmail" v:"required|email#收件人邮箱不能为空|请输入正确的收件人邮箱"`
|
|
}
|
|
|
|
type OutlookOAuthAuthorizeURLReq struct {
|
|
g.Meta `path:"/config/smtp/oauth/outlook/authorize-url" method:"post" tags:"Config" summary:"获取 Outlook OAuth2 授权地址" permission:"sys:config:edit"`
|
|
|
|
OAuthTenant string `json:"oauthTenant"`
|
|
OAuthClientID string `json:"oauthClientId" v:"required#Client ID 不能为空"`
|
|
OAuthClientSecret string `json:"oauthClientSecret" v:"required#Client Secret 不能为空"`
|
|
OAuthScope string `json:"oauthScope"`
|
|
FromEmail string `json:"fromEmail" v:"required|email#发件人邮箱不能为空|请输入正确的发件人邮箱"`
|
|
FrontendOrigin string `json:"frontendOrigin" v:"required#前端来源地址不能为空"`
|
|
CallbackBaseURL string `json:"callbackBaseUrl" v:"required#API 基础地址不能为空"`
|
|
}
|
|
|
|
type OutlookOAuthAuthorizeURLResp struct {
|
|
AuthURL string `json:"authUrl"`
|
|
CallbackURL string `json:"callbackUrl"`
|
|
State string `json:"state"`
|
|
}
|
|
|
|
type OutlookOAuthCallbackReq struct {
|
|
g.Meta `path:"/mail/oauth/outlook/callback" method:"get" tags:"MailOAuth" summary:"Outlook OAuth2 回调" auth:"false"`
|
|
Code string `json:"code"`
|
|
State string `json:"state"`
|
|
Error string `json:"error"`
|
|
ErrorDescription string `json:"error_description"`
|
|
}
|