1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-20 00:39:17 +08:00
1Panel/backend/app/dto/website.go

113 lines
2.9 KiB
Go
Raw Normal View History

2022-10-28 17:04:57 +08:00
package dto
2022-11-03 18:02:07 +08:00
import (
"github.com/1Panel-dev/1Panel/backend/app/model"
)
2022-11-02 15:19:14 +08:00
type WebSiteReq struct {
2022-10-28 17:04:57 +08:00
PageInfo
}
2022-11-02 15:19:14 +08:00
type AppType string
const (
NewApp AppType = "new"
InstalledApp AppType = "installed"
)
2022-10-28 17:04:57 +08:00
type WebSiteCreate struct {
2022-11-02 15:19:14 +08:00
PrimaryDomain string `json:"primaryDomain" validate:"required"`
Type string `json:"type" validate:"required"`
Alias string `json:"alias" validate:"required"`
Remark string `json:"remark"`
2022-11-03 17:06:48 +08:00
OtherDomains string `json:"otherDomains"`
2022-11-21 16:28:51 +08:00
AppType AppType `json:"appType"`
2022-11-02 15:19:14 +08:00
AppInstall NewAppInstall `json:"appInstall"`
AppID uint `json:"appID"`
AppInstallID uint `json:"appInstallID"`
WebSiteGroupID uint `json:"webSiteGroupID" validate:"required"`
}
2022-11-16 10:31:35 +08:00
type WebsiteDTO struct {
model.WebSite
}
2022-11-08 17:21:13 +08:00
type WebSiteUpdate struct {
ID uint `json:"id" validate:"required"`
PrimaryDomain string `json:"primaryDomain" validate:"required"`
Remark string `json:"remark"`
WebSiteGroupID uint `json:"webSiteGroupID" validate:"required"`
}
2022-11-02 15:19:14 +08:00
type NewAppInstall struct {
Name string `json:"name"`
AppDetailId uint `json:"appDetailID"`
Params map[string]interface{} `json:"params"`
}
type WebSiteDel struct {
ID uint `json:"id"`
DeleteApp bool `json:"deleteApp"`
DeleteBackup bool `json:"deleteBackup"`
}
2022-11-30 10:34:44 +08:00
type WebSiteRecover struct {
WebsiteName string `json:"websiteName" validate:"required"`
Type string `json:"type" validate:"required"`
BackupName string `json:"backupName" validate:"required"`
}
type WebSiteRecoverByFile struct {
WebsiteName string `json:"websiteName" validate:"required"`
Type string `json:"type" validate:"required"`
FileDir string `json:"fileDir" validate:"required"`
FileName string `json:"fileName" validate:"required"`
}
2022-11-02 15:19:14 +08:00
type WebSiteDTO struct {
model.WebSite
2022-10-28 17:04:57 +08:00
}
2022-11-03 17:06:48 +08:00
type WebSiteGroupCreate struct {
2022-11-03 18:02:07 +08:00
Name string `json:"name"`
2022-11-03 17:06:48 +08:00
}
type WebSiteGroupUpdate struct {
2022-11-25 18:59:49 +08:00
ID uint `json:"id"`
Name string `json:"name"`
Default bool `json:"default"`
2022-11-03 17:06:48 +08:00
}
type WebSiteDomainCreate struct {
2022-11-03 18:02:07 +08:00
WebSiteID uint `json:"webSiteId"`
Port int `json:"port"`
Domain string `json:"domain"`
2022-11-03 17:06:48 +08:00
}
2022-11-20 18:32:56 +08:00
type WebsiteHTTPS struct {
Enable bool `json:"enable"`
SSL model.WebSiteSSL `json:"SSL"`
}
type SSlType string
const (
SSLExisted SSlType = "existed"
SSLAuto SSlType = "auto"
SSLManual SSlType = "manual"
)
type WebsiteHTTPSOp struct {
2022-11-24 17:50:47 +08:00
WebsiteID uint `json:"websiteId" validate:"required"`
Enable bool `json:"enable" validate:"required"`
2022-11-20 18:32:56 +08:00
WebsiteSSLID uint `json:"websiteSSLId"`
Type SSlType `json:"type"`
2022-11-24 17:50:47 +08:00
PrivateKey string `json:"privateKey"`
Certificate string `json:"certificate"`
2022-11-20 18:32:56 +08:00
}
2022-12-01 00:41:50 +08:00
type WebsiteNginxConfig struct {
Enable bool `json:"enable"`
Params []NginxParam `json:"params"`
}