Files
go_blog/utils/utils.go

14 lines
399 B
Go
Raw Normal View History

2025-04-01 17:59:10 +08:00
// 示例:插件接口
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)
}
// 解压到临时目录并校验文件结构
}