初始化
This commit is contained in:
247
server/dto/admin_dto.go
Normal file
247
server/dto/admin_dto.go
Normal file
@@ -0,0 +1,247 @@
|
||||
package dto
|
||||
|
||||
// ========== 用户管理 ==========
|
||||
|
||||
// UserCreateRequest 创建用户请求
|
||||
type UserCreateRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=64"`
|
||||
Password string `json:"password"` // 可选, 留空则使用默认密码
|
||||
Email string `json:"email"`
|
||||
Nickname string `json:"nickname"`
|
||||
RoleIDs []uint64 `json:"role_ids"` // 角色ID列表
|
||||
DeptID uint64 `json:"dept_id"` // 部门ID
|
||||
StorageQuota int64 `json:"storage_quota"` // 存储配额(字节)
|
||||
}
|
||||
|
||||
// UserUpdateRequest 更新用户请求
|
||||
type UserUpdateRequest struct {
|
||||
Email string `json:"email"`
|
||||
Nickname string `json:"nickname"`
|
||||
Status *int8 `json:"status"` // 指针区分零值和未传
|
||||
RoleIDs []uint64 `json:"role_ids"`
|
||||
DeptID uint64 `json:"dept_id"`
|
||||
StorageQuota *int64 `json:"storage_quota"`
|
||||
}
|
||||
|
||||
// UserVO 用户视图对象(管理后台)
|
||||
type UserVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Email string `json:"email"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Status int8 `json:"status"`
|
||||
StorageQuota int64 `json:"storage_quota"`
|
||||
UsedStorage int64 `json:"used_storage"`
|
||||
DeptID uint64 `json:"dept_id"`
|
||||
DeptName string `json:"dept_name"`
|
||||
Roles []RoleVO `json:"roles"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// ========== 存储策略管理 ==========
|
||||
|
||||
// StoragePolicyCreateRequest 创建存储策略请求
|
||||
type StoragePolicyCreateRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type string `json:"type" binding:"required,oneof=local minio s3 oss"`
|
||||
PolicyType string `json:"policy_type" binding:"required,oneof=hot cold public slave"` // 热存储/冷存储/公开/扩展
|
||||
Config PolicyConfigDTO `json:"config" binding:"required"`
|
||||
}
|
||||
|
||||
// StoragePolicyUpdateRequest 更新存储策略请求
|
||||
type StoragePolicyUpdateRequest struct {
|
||||
Name string `json:"name"`
|
||||
Status *int8 `json:"status"`
|
||||
Config *PolicyConfigDTO `json:"config"`
|
||||
}
|
||||
|
||||
// PolicyConfigDTO 存储策略配置
|
||||
type PolicyConfigDTO struct {
|
||||
BasePath string `json:"base_path,omitempty"`
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
Bucket string `json:"bucket,omitempty"`
|
||||
AccessKey string `json:"access_key,omitempty"`
|
||||
SecretKey string `json:"secret_key,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
UseSSL bool `json:"use_ssl,omitempty"`
|
||||
}
|
||||
|
||||
// StoragePolicyVO 存储策略视图对象
|
||||
type StoragePolicyVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"` // local/minio/s3/oss
|
||||
PolicyType string `json:"policy_type"` // hot/cold/public/slave
|
||||
Status int8 `json:"status"`
|
||||
Config PolicyConfigDTO `json:"config"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// StorageAssignmentVO 存储策略分配视图对象
|
||||
type StorageAssignmentVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
PolicyID uint64 `json:"policy_id"`
|
||||
PolicyName string `json:"policy_name"`
|
||||
UserID uint64 `json:"user_id,omitempty"`
|
||||
UserName string `json:"user_name,omitempty"`
|
||||
GroupID uint64 `json:"group_id,omitempty"`
|
||||
RoleName string `json:"role_name,omitempty"`
|
||||
IsDefault int8 `json:"is_default"`
|
||||
Priority int `json:"priority"` // 优先级, 越大越优先
|
||||
StorageQuota int64 `json:"storage_quota"`
|
||||
AccessMode string `json:"access_mode"`
|
||||
Status int8 `json:"status"`
|
||||
}
|
||||
|
||||
// StorageAssignRequest 分配存储策略请求
|
||||
type StorageAssignRequest struct {
|
||||
PolicyID uint64 `json:"policy_id" binding:"required"`
|
||||
UserID uint64 `json:"user_id"`
|
||||
GroupID uint64 `json:"group_id"`
|
||||
IsDefault int8 `json:"is_default"`
|
||||
Priority int `json:"priority"` // 优先级
|
||||
StorageQuota int64 `json:"storage_quota"`
|
||||
AccessMode string `json:"access_mode"`
|
||||
}
|
||||
|
||||
// UserStorageInfoVO 用户存储信息
|
||||
type UserStorageInfoVO struct {
|
||||
PolicyID uint64 `json:"policy_id"`
|
||||
PolicyName string `json:"policy_name"`
|
||||
PolicyType string `json:"policy_type"`
|
||||
StorageQuota int64 `json:"storage_quota"`
|
||||
UsedStorage int64 `json:"used_storage"`
|
||||
UsedPercent float64 `json:"used_percent"`
|
||||
}
|
||||
|
||||
// ========== 开放平台 ==========
|
||||
|
||||
// AppVO 应用视图对象
|
||||
type AppVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
AppID string `json:"app_id"`
|
||||
AppSecret string `json:"app_secret,omitempty"`
|
||||
AppName string `json:"app_name"`
|
||||
Status int8 `json:"status"`
|
||||
Users []AppUserVO `json:"users,omitempty"` // 绑定的用户
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// AppUserVO 应用绑定用户
|
||||
type AppUserVO struct {
|
||||
UserID uint64 `json:"user_id"`
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
}
|
||||
|
||||
// AppCreateRequest 创建应用请求
|
||||
type AppCreateRequest struct {
|
||||
AppName string `json:"app_name" binding:"required"`
|
||||
}
|
||||
|
||||
// AppBindUsersRequest 绑定用户请求
|
||||
type AppBindUsersRequest struct {
|
||||
UserIDs []uint64 `json:"user_ids" binding:"required"`
|
||||
}
|
||||
|
||||
// ========== 操作日志 ==========
|
||||
|
||||
// OperationLogVO 操作日志视图对象
|
||||
type OperationLogVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
UserID uint64 `json:"user_id"`
|
||||
Username string `json:"username"`
|
||||
Action string `json:"action"`
|
||||
Resource string `json:"resource"`
|
||||
Detail string `json:"detail"`
|
||||
IP string `json:"ip"`
|
||||
Status int `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// LogCleanRequest 日志清理请求
|
||||
type LogCleanRequest struct {
|
||||
Days int `json:"days" binding:"required,min=1"` // 保留最近N天
|
||||
}
|
||||
|
||||
// ========== 备份管理 ==========
|
||||
|
||||
// BackupPolicyCreateRequest 创建备份策略请求
|
||||
type BackupPolicyCreateRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
BackupType string `json:"backup_type" binding:"required,oneof=full incremental"`
|
||||
TargetType string `json:"target_type" binding:"required,oneof=local minio"`
|
||||
TargetConfig string `json:"target_config"` // JSON字符串
|
||||
IncludeDB int8 `json:"include_db"`
|
||||
IncludeFiles int8 `json:"include_files"`
|
||||
CronExpr string `json:"cron_expr"`
|
||||
MaxBackups int `json:"max_backups"`
|
||||
}
|
||||
|
||||
// BackupPolicyVO 备份策略视图
|
||||
type BackupPolicyVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
BackupType string `json:"backup_type"`
|
||||
TargetType string `json:"target_type"`
|
||||
TargetConfig string `json:"target_config"`
|
||||
IncludeDB int8 `json:"include_db"`
|
||||
IncludeFiles int8 `json:"include_files"`
|
||||
CronExpr string `json:"cron_expr"`
|
||||
MaxBackups int `json:"max_backups"`
|
||||
Status int8 `json:"status"`
|
||||
LastRunAt *string `json:"last_run_at"`
|
||||
NextRunAt *string `json:"next_run_at"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// BackupLogVO 备份日志视图
|
||||
type BackupLogVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
PolicyID uint64 `json:"policy_id"`
|
||||
PolicyName string `json:"policy_name"`
|
||||
BackupType string `json:"backup_type"`
|
||||
Status string `json:"status"`
|
||||
FilePath string `json:"file_path"`
|
||||
FileSize int64 `json:"file_size"`
|
||||
DBSize int64 `json:"db_size"`
|
||||
FilesCount int `json:"files_count"`
|
||||
Duration int `json:"duration"`
|
||||
ErrorMsg string `json:"error_msg"`
|
||||
StartedAt string `json:"started_at"`
|
||||
FinishedAt *string `json:"finished_at"`
|
||||
}
|
||||
|
||||
// ========== 组织架构 ==========
|
||||
|
||||
// DeptCreateRequest 创建部门请求
|
||||
type DeptCreateRequest struct {
|
||||
Name string `json:"name" binding:"required,max=128"`
|
||||
Code string `json:"code" binding:"max=64"`
|
||||
ParentID uint64 `json:"parent_id"`
|
||||
LeaderID uint64 `json:"leader_id"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
// DeptUpdateRequest 更新部门请求
|
||||
type DeptUpdateRequest struct {
|
||||
Name string `json:"name" binding:"required,max=128"`
|
||||
Code string `json:"code"`
|
||||
LeaderID uint64 `json:"leader_id"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
Status *int8 `json:"status"`
|
||||
}
|
||||
|
||||
// DeptVO 部门视图对象
|
||||
type DeptVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
ParentID uint64 `json:"parent_id"`
|
||||
Path string `json:"path"`
|
||||
LeaderID uint64 `json:"leader_id"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
Status int8 `json:"status"`
|
||||
Children []DeptVO `json:"children,omitempty"` // 子部门
|
||||
}
|
||||
31
server/dto/auth_dto.go
Normal file
31
server/dto/auth_dto.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Package dto 定义请求和响应的数据传输对象
|
||||
package dto
|
||||
|
||||
// LoginRequest 登录请求
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username" binding:"required"` // 用户名, 必填
|
||||
Password string `json:"password" binding:"required"` // 密码, 必填
|
||||
}
|
||||
|
||||
// RegisterRequest 注册请求
|
||||
type RegisterRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=64"` // 用户名, 3-64字符
|
||||
Password string `json:"password" binding:"required,min=6,max=128"` // 密码, 6-128字符
|
||||
Email string `json:"email" binding:"omitempty,email"` // 邮箱, 可选
|
||||
Nickname string `json:"nickname" binding:"omitempty,max=64"` // 昵称, 可选
|
||||
}
|
||||
|
||||
// LoginResponse 登录响应
|
||||
type LoginResponse struct {
|
||||
Token string `json:"token"`
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Role string `json:"role"`
|
||||
MustChangePwd bool `json:"must_change_pwd"` // 首次登录需改密码
|
||||
}
|
||||
|
||||
// ChangePasswordRequest 修改密码请求
|
||||
type ChangePasswordRequest struct {
|
||||
OldPassword string `json:"old_password" binding:"required"` // 当前密码
|
||||
NewPassword string `json:"new_password" binding:"required,min=6"` // 新密码
|
||||
}
|
||||
136
server/dto/file_dto.go
Normal file
136
server/dto/file_dto.go
Normal file
@@ -0,0 +1,136 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
// FileVO 文件视图对象 - 返回给前端
|
||||
type FileVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Extension string `json:"extension"`
|
||||
FolderID uint64 `json:"folder_id"`
|
||||
Size int64 `json:"size"`
|
||||
StorageKey string `json:"storage_key"`
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
MimeType string `json:"mime_type"`
|
||||
IsFavorite int8 `json:"is_favorite"`
|
||||
DownloadCount int `json:"download_count"`
|
||||
Version int `json:"version"` // 乐观锁版本号
|
||||
DownloadURL string `json:"download_url,omitempty"` // CDN下载链接
|
||||
PreviewURL string `json:"preview_url,omitempty"` // CDN预览链接
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// FolderVO 文件夹视图对象
|
||||
type FolderVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID uint64 `json:"parent_id"`
|
||||
Path string `json:"path"`
|
||||
Version int `json:"version"` // 乐观锁版本号
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// FileListVO 文件列表响应 - 包含文件和文件夹
|
||||
type FileListVO struct {
|
||||
Folders []FolderVO `json:"folders"` // 文件夹列表
|
||||
Files []FileVO `json:"files"` // 文件列表
|
||||
}
|
||||
|
||||
// CreateFolderRequest 创建文件夹请求
|
||||
type CreateFolderRequest struct {
|
||||
Name string `json:"name" binding:"required,max=256"` // 文件夹名称
|
||||
ParentID uint64 `json:"parent_id"` // 父文件夹ID, 0=根目录
|
||||
}
|
||||
|
||||
// RenameRequest 重命名请求
|
||||
type RenameRequest struct {
|
||||
NewName string `json:"new_name" binding:"required,max=256"` // 新名称
|
||||
Version int `json:"version"` // 乐观锁版本号(可选)
|
||||
}
|
||||
|
||||
// MoveRequest 移动请求
|
||||
type MoveRequest struct {
|
||||
TargetFolderID uint64 `json:"target_folder_id" binding:"required"` // 目标文件夹ID
|
||||
}
|
||||
|
||||
// ShareCreateRequest 创建分享请求
|
||||
type ShareCreateRequest struct {
|
||||
FileID uint64 `json:"file_id" binding:"required"`
|
||||
Password string `json:"password"`
|
||||
ExpireHours int `json:"expire_hours"`
|
||||
MaxDownload int `json:"max_download"`
|
||||
AllowPreview int `json:"allow_preview"` // 1=允许 0=禁止, 默认1
|
||||
AllowDownload int `json:"allow_download"` // 1=允许 0=禁止, 默认1
|
||||
}
|
||||
|
||||
// ShareVO 分享视图对象
|
||||
type ShareVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
ShareCode string `json:"share_code"`
|
||||
ShareURL string `json:"share_url"`
|
||||
HasPassword bool `json:"has_password"`
|
||||
ExpireAt *time.Time `json:"expire_at"`
|
||||
MaxDownload int `json:"max_download"`
|
||||
DownloadCount int `json:"download_count"`
|
||||
AllowPreview int8 `json:"allow_preview"`
|
||||
AllowDownload int8 `json:"allow_download"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// ShareVerifyRequest 验证分享密码请求
|
||||
type ShareVerifyRequest struct {
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
// ShareFileVO 分享文件视图对象(公开)
|
||||
type ShareFileVO struct {
|
||||
Name string `json:"name"`
|
||||
Extension string `json:"extension"`
|
||||
Size int64 `json:"size"`
|
||||
MimeType string `json:"mime_type"`
|
||||
PreviewURL string `json:"preview_url"` // 预览链接
|
||||
AllowPreview bool `json:"allow_preview"`
|
||||
AllowDownload bool `json:"allow_download"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// ========== 分片上传 ==========
|
||||
|
||||
// ChunkUploadInitRequest 初始化分片上传请求
|
||||
type ChunkUploadInitRequest struct {
|
||||
FileName string `json:"file_name" binding:"required"`
|
||||
FileSize int64 `json:"file_size" binding:"required"`
|
||||
MD5 string `json:"md5"` // 客户端计算的MD5(可选, 用于秒传)
|
||||
FolderID uint64 `json:"folder_id"`
|
||||
PolicyID uint64 `json:"policy_id"` // 存储策略ID
|
||||
}
|
||||
|
||||
// ChunkUploadInitVO 初始化分片上传响应
|
||||
type ChunkUploadInitVO struct {
|
||||
UploadID string `json:"upload_id"` // 上传会话ID
|
||||
Instant bool `json:"instant"` // 是否秒传
|
||||
FileID uint64 `json:"file_id"` // 秒传时返回文件ID
|
||||
ChunkSize int64 `json:"chunk_size"` // 分片大小
|
||||
Total int `json:"total"` // 总分片数
|
||||
}
|
||||
|
||||
// ChunkUploadChunkVO 单分片上传响应
|
||||
type ChunkUploadChunkVO struct {
|
||||
Index int `json:"index"`
|
||||
Size int64 `json:"size"`
|
||||
Status string `json:"status"` // ok / exists
|
||||
}
|
||||
|
||||
// ChunkUploadProgressVO 上传进度响应
|
||||
type ChunkUploadProgressVO struct {
|
||||
UploadID string `json:"upload_id"`
|
||||
FileName string `json:"file_name"`
|
||||
FileSize int64 `json:"file_size"`
|
||||
ChunkSize int64 `json:"chunk_size"`
|
||||
TotalChunks int `json:"total_chunks"`
|
||||
Uploaded int `json:"uploaded"`
|
||||
Missing []int `json:"missing"` // 未上传的分片索引
|
||||
Status int8 `json:"status"` // 1=上传中 2=已完成 3=已取消
|
||||
}
|
||||
60
server/dto/permission_dto.go
Normal file
60
server/dto/permission_dto.go
Normal file
@@ -0,0 +1,60 @@
|
||||
package dto
|
||||
|
||||
// RoleCreateRequest 创建角色请求
|
||||
type RoleCreateRequest struct {
|
||||
Name string `json:"name" binding:"required,max=64"` // 角色标识
|
||||
DisplayName string `json:"display_name" binding:"required,max=64"` // 显示名称
|
||||
Description string `json:"description" binding:"max=256"` // 描述
|
||||
}
|
||||
|
||||
// RoleUpdateRequest 更新角色请求
|
||||
type RoleUpdateRequest struct {
|
||||
DisplayName string `json:"display_name" binding:"required,max=64"`
|
||||
Description string `json:"description" binding:"max=256"`
|
||||
}
|
||||
|
||||
// RoleVO 角色视图对象
|
||||
type RoleVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Description string `json:"description"`
|
||||
IsSystem int8 `json:"is_system"`
|
||||
Status int8 `json:"status"`
|
||||
Permissions []PermissionVO `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// PermissionCreateRequest 创建权限请求
|
||||
type PermissionCreateRequest struct {
|
||||
Code string `json:"code" binding:"required,max=64"` // 权限标识: file:upload
|
||||
Name string `json:"name" binding:"required,max=64"` // 显示名称
|
||||
Resource string `json:"resource" binding:"required"` // 资源类型
|
||||
Action string `json:"action" binding:"required"` // 操作类型
|
||||
Description string `json:"description" binding:"max=256"`
|
||||
}
|
||||
|
||||
// PermissionVO 权限视图对象
|
||||
type PermissionVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Resource string `json:"resource"`
|
||||
Action string `json:"action"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
// SetRolePermissionsRequest 设置角色权限请求
|
||||
type SetRolePermissionsRequest struct {
|
||||
PermissionIDs []uint64 `json:"permission_ids" binding:"required"` // 权限ID列表
|
||||
}
|
||||
|
||||
// SetUserRolesRequest 设置用户角色请求
|
||||
type SetUserRolesRequest struct {
|
||||
RoleIDs []uint64 `json:"role_ids" binding:"required"` // 角色ID列表
|
||||
}
|
||||
|
||||
// UserPermissionVO 用户权限视图对象
|
||||
type UserPermissionVO struct {
|
||||
Roles []RoleVO `json:"roles"` // 用户角色列表
|
||||
Permissions []string `json:"permissions"` // 权限标识列表
|
||||
}
|
||||
61
server/dto/sso_dto.go
Normal file
61
server/dto/sso_dto.go
Normal file
@@ -0,0 +1,61 @@
|
||||
package dto
|
||||
|
||||
// SSOAuthURLRequest 获取SSO授权URL请求
|
||||
type SSOAuthURLRequest struct {
|
||||
ProviderID uint64 `json:"provider_id" binding:"required"` // SSO提供商ID
|
||||
State string `json:"state"` // 防CSRF状态码
|
||||
}
|
||||
|
||||
// SSOCallbackRequest SSO回调请求
|
||||
type SSOCallbackRequest struct {
|
||||
ProviderID uint64 `json:"provider_id" binding:"required"` // SSO提供商ID
|
||||
Code string `json:"code" binding:"required"` // 授权码/CAS票据
|
||||
}
|
||||
|
||||
// SSOProviderVO SSO提供商视图对象(登录页展示)
|
||||
type SSOProviderVO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Icon string `json:"icon"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
// SSOProviderCreateRequest 创建SSO提供商请求
|
||||
type SSOProviderCreateRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type string `json:"type" binding:"required,oneof=oauth2 oidc cas ldap"`
|
||||
DisplayName string `json:"display_name" binding:"required"`
|
||||
Icon string `json:"icon"`
|
||||
Config SSOConfigDTO `json:"config" binding:"required"`
|
||||
AutoCreate int8 `json:"auto_create"`
|
||||
DefaultRole string `json:"default_role"`
|
||||
}
|
||||
|
||||
// SSOConfigDTO SSO配置DTO
|
||||
type SSOConfigDTO struct {
|
||||
// OAuth2/OIDC
|
||||
ClientID string `json:"client_id"`
|
||||
ClientSecret string `json:"client_secret"`
|
||||
AuthURL string `json:"auth_url"`
|
||||
TokenURL string `json:"token_url"`
|
||||
UserInfoURL string `json:"user_info_url"`
|
||||
RedirectURI string `json:"redirect_uri"`
|
||||
Scopes string `json:"scopes"`
|
||||
|
||||
// CAS
|
||||
CasServerURL string `json:"cas_server_url"`
|
||||
|
||||
// LDAP
|
||||
LDAPServer string `json:"ldap_server"`
|
||||
LDAPPort int `json:"ldap_port"`
|
||||
LDAPBaseDN string `json:"ldap_base_dn"`
|
||||
LDAPBindUser string `json:"ldap_bind_user"`
|
||||
LDAPBindPass string `json:"ldap_bind_pass"`
|
||||
LDAPFilter string `json:"ldap_filter"`
|
||||
|
||||
// 字段映射
|
||||
MappingUsername string `json:"mapping_username"`
|
||||
MappingEmail string `json:"mapping_email"`
|
||||
MappingNickname string `json:"mapping_nickname"`
|
||||
}
|
||||
Reference in New Issue
Block a user