use themes

This commit is contained in:
张超
2025-04-01 17:59:10 +08:00
parent 5934ffd460
commit 577cd10161
13 changed files with 152 additions and 3 deletions

14
utils/utils.go Normal file
View 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)
}
// 解压到临时目录并校验文件结构
}