use themes
This commit is contained in:
14
utils/utils.go
Normal file
14
utils/utils.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// 示例:插件接口
|
||||
type Plugin interface {
|
||||
OnArticleCreate(article *models.Article) // 文章创建钩子
|
||||
RegisterRoutes(r *gin.Engine) // 添加新路由
|
||||
}
|
||||
|
||||
// 主题ZIP上传示例
|
||||
func handleThemeUpload(c *gin.Context) {
|
||||
file, _ := c.FormFile("theme")
|
||||
if !strings.HasSuffix(file.Filename, ".zip") {
|
||||
c.AbortWithStatus(400)
|
||||
}
|
||||
// 解压到临时目录并校验文件结构
|
||||
}
|
||||
Reference in New Issue
Block a user