Skip to content

Commit 6dc6092

Browse files
authored
Merge pull request #657 from 0xJacky/feat/site-category
feat: site category
2 parents ed3c02f + 2ee057a commit 6dc6092

File tree

139 files changed

+8934
-4741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+8934
-4741
lines changed

api/certificate/acme_user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
func GetAcmeUser(c *gin.Context) {
1515
u := query.AcmeUser
16-
id := cast.ToInt(c.Param("id"))
16+
id := cast.ToUint64(c.Param("id"))
1717
user, err := u.FirstByID(id)
1818
if err != nil {
1919
api.ErrHandler(c, err)
@@ -79,7 +79,7 @@ func RecoverAcmeUser(c *gin.Context) {
7979
}
8080

8181
func RegisterAcmeUser(c *gin.Context) {
82-
id := cast.ToInt(c.Param("id"))
82+
id := cast.ToUint64(c.Param("id"))
8383
u := query.AcmeUser
8484
user, err := u.FirstByID(id)
8585
if err != nil {

api/certificate/certificate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func GetCertList(c *gin.Context) {
7171
func GetCert(c *gin.Context) {
7272
q := query.Cert
7373

74-
certModel, err := q.FirstByID(cast.ToInt(c.Param("id")))
74+
certModel, err := q.FirstByID(cast.ToUint64(c.Param("id")))
7575

7676
if err != nil {
7777
api.ErrHandler(c, err)
@@ -89,9 +89,9 @@ type certJson struct {
8989
SSLCertificateKey string `json:"ssl_certificate_key" binding:"omitempty,privatekey"`
9090
KeyType certcrypto.KeyType `json:"key_type" binding:"omitempty,auto_cert_key_type"`
9191
ChallengeMethod string `json:"challenge_method"`
92-
DnsCredentialID int `json:"dns_credential_id"`
93-
ACMEUserID int `json:"acme_user_id"`
94-
SyncNodeIds []int `json:"sync_node_ids"`
92+
DnsCredentialID uint64 `json:"dns_credential_id"`
93+
ACMEUserID uint64 `json:"acme_user_id"`
94+
SyncNodeIds []uint64 `json:"sync_node_ids"`
9595
}
9696

9797
func AddCert(c *gin.Context) {
@@ -141,7 +141,7 @@ func AddCert(c *gin.Context) {
141141
}
142142

143143
func ModifyCert(c *gin.Context) {
144-
id := cast.ToInt(c.Param("id"))
144+
id := cast.ToUint64(c.Param("id"))
145145

146146
var json certJson
147147

api/certificate/dns_credential.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
func GetDnsCredential(c *gin.Context) {
15-
id := cast.ToInt(c.Param("id"))
15+
id := cast.ToUint64(c.Param("id"))
1616

1717
d := query.DnsCredential
1818

@@ -70,7 +70,7 @@ func AddDnsCredential(c *gin.Context) {
7070
}
7171

7272
func EditDnsCredential(c *gin.Context) {
73-
id := cast.ToInt(c.Param("id"))
73+
id := cast.ToUint64(c.Param("id"))
7474

7575
var json DnsCredentialManageJson
7676
if !api.BindAndValid(c, &json) {

api/cluster/environment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
func GetEnvironment(c *gin.Context) {
18-
id := cast.ToInt(c.Param("id"))
18+
id := cast.ToUint64(c.Param("id"))
1919

2020
envQuery := query.Environment
2121

@@ -67,7 +67,7 @@ func EditEnvironment(c *gin.Context) {
6767
}
6868

6969
func DeleteEnvironment(c *gin.Context) {
70-
id := cast.ToInt(c.Param("id"))
70+
id := cast.ToUint64(c.Param("id"))
7171
envQuery := query.Environment
7272

7373
env, err := envQuery.FirstByID(id)

api/cluster/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ func InitRouter(r *gin.RouterGroup) {
66
// Environment
77
r.GET("environments", GetEnvironmentList)
88
r.POST("environments/load_from_settings", LoadEnvironmentFromSettings)
9-
envGroup := r.Group("environment")
9+
envGroup := r.Group("environments")
1010
{
1111
envGroup.GET("/:id", GetEnvironment)
1212
envGroup.POST("", AddEnvironment)

api/config/add.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import (
1717

1818
func AddConfig(c *gin.Context) {
1919
var json struct {
20-
Name string `json:"name" binding:"required"`
21-
NewFilepath string `json:"new_filepath" binding:"required"`
22-
Content string `json:"content"`
23-
Overwrite bool `json:"overwrite"`
24-
SyncNodeIds []int `json:"sync_node_ids"`
20+
Name string `json:"name" binding:"required"`
21+
NewFilepath string `json:"new_filepath" binding:"required"`
22+
Content string `json:"content"`
23+
Overwrite bool `json:"overwrite"`
24+
SyncNodeIds []uint64 `json:"sync_node_ids"`
2525
}
2626

2727
if !api.BindAndValid(c, &json) {

api/config/get.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414

1515
type APIConfigResp struct {
1616
config.Config
17-
SyncNodeIds []int `json:"sync_node_ids" gorm:"serializer:json"`
18-
SyncOverwrite bool `json:"sync_overwrite"`
17+
SyncNodeIds []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
18+
SyncOverwrite bool `json:"sync_overwrite"`
1919
}
2020

2121
func GetConfig(c *gin.Context) {

api/config/modify.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ type EditConfigJson struct {
2121
func EditConfig(c *gin.Context) {
2222
name := c.Param("name")
2323
var json struct {
24-
Name string `json:"name" binding:"required"`
25-
Filepath string `json:"filepath" binding:"required"`
26-
NewFilepath string `json:"new_filepath" binding:"required"`
27-
Content string `json:"content"`
28-
SyncOverwrite bool `json:"sync_overwrite"`
29-
SyncNodeIds []int `json:"sync_node_ids"`
24+
Name string `json:"name" binding:"required"`
25+
Filepath string `json:"filepath" binding:"required"`
26+
NewFilepath string `json:"new_filepath" binding:"required"`
27+
Content string `json:"content"`
28+
SyncOverwrite bool `json:"sync_overwrite"`
29+
SyncNodeIds []uint64 `json:"sync_node_ids"`
3030
}
3131
if !api.BindAndValid(c, &json) {
3232
return

api/config/rename.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414

1515
func Rename(c *gin.Context) {
1616
var json struct {
17-
BasePath string `json:"base_path"`
18-
OrigName string `json:"orig_name"`
19-
NewName string `json:"new_name"`
20-
SyncNodeIds []int `json:"sync_node_ids" gorm:"serializer:json"`
17+
BasePath string `json:"base_path"`
18+
OrigName string `json:"orig_name"`
19+
NewName string `json:"new_name"`
20+
SyncNodeIds []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
2121
}
2222
if !api.BindAndValid(c, &json) {
2323
return

api/config/router.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ func InitRouter(r *gin.RouterGroup) {
99
r.GET("config_base_path", GetBasePath)
1010

1111
r.GET("configs", GetConfigs)
12-
r.GET("config/*name", GetConfig)
13-
r.POST("config", AddConfig)
14-
r.POST("config/*name", EditConfig)
12+
r.GET("configs/*name", GetConfig)
13+
r.POST("configs", AddConfig)
14+
r.POST("configs/*name", EditConfig)
1515

1616
o := r.Group("", middleware.RequireSecureSession())
1717
{

0 commit comments

Comments
 (0)