implement OIDC configuration management with CRUD operations, add admin routes, and enhance error handling

This commit is contained in:
2025-07-23 03:32:00 +08:00
parent 562b9bd17f
commit 58c370ec65
19 changed files with 523 additions and 73 deletions

12
internal/dto/console.go Normal file
View File

@ -0,0 +1,12 @@
package dto
type AdminOidcConfigDto struct {
ID uint `json:"id"`
Name string `json:"name"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
DisplayName string `json:"display_name"`
Icon string `json:"icon"`
OidcDiscoveryUrl string `json:"oidc_discovery_url"`
Enabled bool `json:"enabled"`
}

View File

@ -8,9 +8,9 @@ type PostDto struct {
IsPrivate bool `json:"is_private"` // 是否为私密帖子
}
type CreatePostReq struct {
Title string `json:"title"`
Content string `json:"content"`
Labels []LabelDto `json:"labels"`
IsPrivate bool `json:"is_private"`
type CreateOrUpdatePostReq struct {
Title string `json:"title"`
Content string `json:"content"`
IsPrivate bool `json:"is_private"`
Labels []uint `json:"labels"` // 标签ID列表
}

View File

@ -10,7 +10,7 @@ type UserDto struct {
Role string `json:"role"`
}
type OidcConfigDto struct {
type UserOidcConfigDto struct {
Name string `json:"name"` // OIDC配置名称
DisplayName string `json:"display_name"` // OIDC配置显示名称
Icon string `json:"icon"` // OIDC配置图标URL
@ -62,7 +62,7 @@ type OidcLoginResp struct {
}
type ListOidcConfigResp struct {
OidcConfigs []OidcConfigDto `json:"oidc_configs"` // OIDC配置列表
OidcConfigs []UserOidcConfigDto `json:"oidc_configs"` // OIDC配置列表
}
type GetUserReq struct {