mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
41 lines
778 B
Go
41 lines
778 B
Go
package sites
|
|
|
|
import (
|
|
"github.com/0xJacky/Nginx-UI/model"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/uozi-tech/cosy"
|
|
)
|
|
|
|
func GetCategory(c *gin.Context) {
|
|
|
|
}
|
|
|
|
func GetCategoryList(c *gin.Context) {
|
|
cosy.Core[model.SiteCategory](c).PagingList()
|
|
}
|
|
|
|
func AddCategory(c *gin.Context) {
|
|
cosy.Core[model.SiteCategory](c).
|
|
SetValidRules(gin.H{
|
|
"name": "required",
|
|
"sync_node_ids": "omitempty",
|
|
}).
|
|
Create()
|
|
}
|
|
|
|
func ModifyCategory(c *gin.Context) {
|
|
cosy.Core[model.SiteCategory](c).
|
|
SetValidRules(gin.H{
|
|
"name": "required",
|
|
"sync_node_ids": "omitempty",
|
|
}).
|
|
Modify()
|
|
}
|
|
|
|
func DeleteCategory(c *gin.Context) {
|
|
cosy.Core[model.SiteCategory](c).Destroy()
|
|
}
|
|
|
|
func RecoverCategory(c *gin.Context) {
|
|
cosy.Core[model.SiteCategory](c).Recover()
|
|
}
|