refactor: separate backend domains and storage adapters
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package dto
|
||||
|
||||
type OperationRecordRequest struct {
|
||||
IP string
|
||||
Method string
|
||||
Path string
|
||||
Status int
|
||||
LatencyMS int64
|
||||
Agent string
|
||||
ErrorMessage string
|
||||
Body string
|
||||
Response string
|
||||
UserID uint
|
||||
RequestID string
|
||||
TraceID string
|
||||
DeviceID string
|
||||
}
|
||||
|
||||
type DataAccessRecordRequest struct {
|
||||
EventType string
|
||||
Operation string
|
||||
UserID uint
|
||||
AuthorityID uint
|
||||
RequestID string
|
||||
Method string
|
||||
Path string
|
||||
Detail string
|
||||
}
|
||||
|
||||
type DataAccessListRequest struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
EventType string `json:"eventType"`
|
||||
TargetTable string `json:"targetTable"`
|
||||
UserID uint `json:"userId"`
|
||||
}
|
||||
type ErrorRecordRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
Form string `json:"form"`
|
||||
Info string `json:"info"`
|
||||
Level string `json:"level"`
|
||||
RequestID string `json:"request_id"`
|
||||
TraceID string `json:"trace_id"`
|
||||
Solution string `json:"solution"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package dto
|
||||
|
||||
type ExportConditionRequest struct {
|
||||
From string `json:"from"`
|
||||
Column string `json:"column"`
|
||||
Operator string `json:"operator"`
|
||||
}
|
||||
type ExportJoinRequest struct {
|
||||
Join string `json:"joins"`
|
||||
Table string `json:"table"`
|
||||
On string `json:"on"`
|
||||
}
|
||||
type ExportTemplateRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
DBName string `json:"dbName"`
|
||||
Name string `json:"name"`
|
||||
TableName string `json:"tableName"`
|
||||
TemplateID string `json:"templateID"`
|
||||
TemplateInfo string `json:"templateInfo"`
|
||||
SQL string `json:"sql"`
|
||||
ImportSQL string `json:"importSql"`
|
||||
Limit *int `json:"limit"`
|
||||
Order string `json:"order"`
|
||||
Conditions []ExportConditionRequest `json:"conditions"`
|
||||
Joins []ExportJoinRequest `json:"joinTemplate"`
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package dto
|
||||
|
||||
type MediaListRequest struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Keyword string `json:"keyword"`
|
||||
ClassID int `json:"classId"`
|
||||
Tag string `json:"tag"`
|
||||
UserID uint `json:"userId"`
|
||||
}
|
||||
type IDRequest struct {
|
||||
ID uint `json:"ID" form:"id"`
|
||||
}
|
||||
type IDsRequest struct {
|
||||
IDs []uint `json:"ids"`
|
||||
}
|
||||
type RenameMediaRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
type ImportMediaRequest struct {
|
||||
Name string `json:"name"`
|
||||
ClassID int `json:"classId"`
|
||||
URL string `json:"url"`
|
||||
Tag string `json:"tag"`
|
||||
Key string `json:"key"`
|
||||
Size int64 `json:"size"`
|
||||
Mime string `json:"mime"`
|
||||
MD5 string `json:"md5"`
|
||||
}
|
||||
type StorageListRequest struct {
|
||||
Prefix string `json:"prefix"`
|
||||
Cursor string `json:"cursor"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
type CategoryRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
Name string `json:"name"`
|
||||
PID uint `json:"pid"`
|
||||
}
|
||||
type InitUploadRequest struct {
|
||||
FileName string `json:"fileName"`
|
||||
FileHash string `json:"fileHash"`
|
||||
FileSize int64 `json:"fileSize"`
|
||||
ChunkSize int64 `json:"chunkSize"`
|
||||
ChunkTotal int `json:"chunkTotal"`
|
||||
}
|
||||
type CompleteUploadRequest struct {
|
||||
UploadID uint `json:"uploadId"`
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package dto
|
||||
|
||||
type DictionaryRequest struct {
|
||||
ID uint `json:"ID" form:"ID"`
|
||||
Name string `json:"name" form:"name"`
|
||||
Type string `json:"type" form:"type"`
|
||||
Status *bool `json:"status" form:"status"`
|
||||
Description string `json:"desc" form:"desc"`
|
||||
ParentID *uint `json:"parentID" form:"parentID"`
|
||||
}
|
||||
type DictionaryDetailRequest struct {
|
||||
ID uint `json:"ID" form:"ID"`
|
||||
Label string `json:"label" form:"label"`
|
||||
Value string `json:"value" form:"value"`
|
||||
Extend string `json:"extend" form:"extend"`
|
||||
Status *bool `json:"status" form:"status"`
|
||||
Sort int `json:"sort" form:"sort"`
|
||||
DictionaryID uint `json:"sysDictionaryID" form:"sysDictionaryID"`
|
||||
ParentID *uint `json:"parentID" form:"parentID"`
|
||||
Level int `json:"level"`
|
||||
Path string `json:"path"`
|
||||
}
|
||||
type ImportDictionaryRequest struct {
|
||||
JSON string `json:"json"`
|
||||
}
|
||||
type SystemParameterRequest struct {
|
||||
ID uint `json:"ID" form:"ID"`
|
||||
Name string `json:"name" form:"name"`
|
||||
Key string `json:"key" form:"key"`
|
||||
Value string `json:"value" form:"value"`
|
||||
Description string `json:"desc" form:"desc"`
|
||||
}
|
||||
type CreateAPITokenRequest struct {
|
||||
UserID uint `json:"userId"`
|
||||
AuthorityID uint `json:"authorityId"`
|
||||
Days int `json:"days"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
type APITokenListRequest struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
UserID uint `json:"userId"`
|
||||
Status *bool `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package dto
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Captcha string `json:"captcha"`
|
||||
CaptchaID string `json:"captchaId"`
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
Path string
|
||||
Method string
|
||||
}
|
||||
|
||||
type UserListRequest struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Username string `json:"username"`
|
||||
NickName string `json:"nickName"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
OrderKey string `json:"orderKey"`
|
||||
Desc bool `json:"desc"`
|
||||
}
|
||||
|
||||
type UserRequest struct {
|
||||
ID uint `json:"ID" form:"id"`
|
||||
Username string `json:"userName"`
|
||||
Password string `json:"passWord"`
|
||||
NickName string `json:"nickName"`
|
||||
HeaderImg string `json:"headerImg"`
|
||||
AuthorityID uint `json:"authorityId"`
|
||||
AuthorityIDs []uint `json:"authorityIds"`
|
||||
Enable int `json:"enable"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type SelfUserRequest struct {
|
||||
NickName string `json:"nickName"`
|
||||
HeaderImg string `json:"headerImg"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type ResetPasswordRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type ChangePasswordRequest struct {
|
||||
Password string `json:"password"`
|
||||
NewPassword string `json:"newPassword"`
|
||||
}
|
||||
|
||||
type UserAuthoritiesRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
AuthorityIDs []uint `json:"authorityIds"`
|
||||
}
|
||||
|
||||
type SwitchAuthorityRequest struct {
|
||||
AuthorityID uint `json:"authorityId"`
|
||||
}
|
||||
|
||||
type LoginLogRequest struct {
|
||||
Username string
|
||||
IP string
|
||||
Status bool
|
||||
ErrorMessage string
|
||||
Agent string
|
||||
UserID uint
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package dto
|
||||
|
||||
import "kra/internal/conf"
|
||||
|
||||
type SecurityConfigRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
CaptchaOpen int `json:"captchaOpen"`
|
||||
CaptchaTimeout int `json:"captchaTimeout"`
|
||||
KeyLong int `json:"keyLong"`
|
||||
ImgWidth int `json:"imgWidth"`
|
||||
ImgHeight int `json:"imgHeight"`
|
||||
PwdMinLength int `json:"pwdMinLength"`
|
||||
PwdRequireUpper bool `json:"pwdRequireUpper"`
|
||||
PwdRequireLower bool `json:"pwdRequireLower"`
|
||||
PwdRequireDigit bool `json:"pwdRequireDigit"`
|
||||
PwdRequireSpecial bool `json:"pwdRequireSpecial"`
|
||||
LimitEnable bool `json:"limitEnable"`
|
||||
LimitWindow int `json:"limitWindow"`
|
||||
LimitCount int `json:"limitCount"`
|
||||
LockEnable bool `json:"lockEnable"`
|
||||
LockThreshold int `json:"lockThreshold"`
|
||||
LockDuration int `json:"lockDuration"`
|
||||
PwdExpireEnable bool `json:"pwdExpireEnable"`
|
||||
PwdExpireDays int `json:"pwdExpireDays"`
|
||||
ForceNewUserChangePassword bool `json:"forceNewUserChangePassword"`
|
||||
}
|
||||
|
||||
type SetSystemConfigRequest struct {
|
||||
Config struct {
|
||||
Admin struct {
|
||||
RouterPrefix string `json:"routerPrefix"`
|
||||
JWT struct {
|
||||
SigningKey string `json:"signingKey"`
|
||||
Issuer string `json:"issuer"`
|
||||
} `json:"jwt"`
|
||||
Local struct {
|
||||
StorePath string `json:"storePath"`
|
||||
PathPrefix string `json:"pathPrefix"`
|
||||
} `json:"local"`
|
||||
Media struct {
|
||||
SessionTTL int32 `json:"sessionTtl"`
|
||||
} `json:"media"`
|
||||
Storage *conf.AdminBackend_Storage `json:"storage"`
|
||||
} `json:"admin"`
|
||||
Email *struct {
|
||||
To string `json:"to"`
|
||||
From string `json:"from"`
|
||||
Host string `json:"host"`
|
||||
Secret string `json:"secret"`
|
||||
Nickname string `json:"nickname"`
|
||||
Port int32 `json:"port"`
|
||||
IsSSL bool `json:"is-ssl"`
|
||||
IsLoginAuth bool `json:"is-loginauth"`
|
||||
} `json:"email"`
|
||||
} `json:"config"`
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package dto
|
||||
|
||||
type VersionMenuMetaRequest struct {
|
||||
ActiveName string `json:"activeName"`
|
||||
KeepAlive bool `json:"keepAlive"`
|
||||
DefaultMenu bool `json:"defaultMenu"`
|
||||
Title string `json:"title"`
|
||||
Icon string `json:"icon"`
|
||||
CloseTab bool `json:"closeTab"`
|
||||
TransitionType string `json:"transitionType"`
|
||||
}
|
||||
type VersionMenuButtonRequest struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"desc"`
|
||||
}
|
||||
type VersionMenuRequest struct {
|
||||
Path string `json:"path"`
|
||||
Name string `json:"name"`
|
||||
Hidden bool `json:"hidden"`
|
||||
Component string `json:"component"`
|
||||
Sort int `json:"sort"`
|
||||
Meta VersionMenuMetaRequest `json:"meta"`
|
||||
MenuButtons []VersionMenuButtonRequest `json:"menuBtn"`
|
||||
Children []VersionMenuRequest `json:"children"`
|
||||
}
|
||||
type VersionAPIRequest struct {
|
||||
Path string `json:"path"`
|
||||
Description string `json:"description"`
|
||||
APIGroup string `json:"apiGroup"`
|
||||
Method string `json:"method"`
|
||||
}
|
||||
type VersionDictionaryDetailRequest struct {
|
||||
Label string `json:"label"`
|
||||
Value string `json:"value"`
|
||||
Extend string `json:"extend"`
|
||||
Status *bool `json:"status"`
|
||||
Sort int `json:"sort"`
|
||||
ParentID *uint `json:"parentID"`
|
||||
Level int `json:"level"`
|
||||
Path string `json:"path"`
|
||||
}
|
||||
type VersionDictionaryRequest struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Status bool `json:"status"`
|
||||
Description string `json:"desc"`
|
||||
Details []VersionDictionaryDetailRequest `json:"sysDictionaryDetails"`
|
||||
}
|
||||
type ImportVersionRequest struct {
|
||||
Version struct {
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
ExportTime string `json:"exportTime"`
|
||||
} `json:"version"`
|
||||
Menus []VersionMenuRequest `json:"menus"`
|
||||
APIs []VersionAPIRequest `json:"apis"`
|
||||
Dictionaries []VersionDictionaryRequest `json:"dictionaries"`
|
||||
}
|
||||
type ExportVersionRequest struct {
|
||||
VersionName string `json:"versionName"`
|
||||
VersionCode string `json:"versionCode"`
|
||||
Description string `json:"description"`
|
||||
MenuIDs []uint `json:"menuIds"`
|
||||
APIIDs []uint `json:"apiIds"`
|
||||
DictIDs []uint `json:"dictIds"`
|
||||
}
|
||||
Reference in New Issue
Block a user