feat: PhotoWall 毕业照存储系统初始版本

后端: Go(Gin+GORM+MySQL+Redis)
- 17张业务表(yz_pw_前缀), 自动迁移
- JWT认证(3小时) + 盐+MD5密码 + 图形验证码
- 班级CRUD/加入(8人姓名验证/邀请码)/审核/30天自动清理
- 系统配置(16项)/菜单管理(动态路由)/数据统计
- 文件MD5去重/数据隔离/账号封禁/敏感词DFA检测

前端: Vue3+Vite+Element Plus+Less+ECharts+FontAwesome
- 动态路由(数据库菜单驱动)
- 蓝白配色, H5响应式
- 登录/注册/忘记密码/个人中心
- 班级创建向导/详情/加入/列表
- 管理后台: 审核/配置/菜单/统计/用户/敏感词

数据库: MySQL 10.31.100.3:3306/photowall
管理员: hero920103 / 920103
This commit is contained in:
hero920103
2026-09-03 05:55:23 +08:00
commit 57d9866dab
82 changed files with 12668 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
package handler
import (
"photowall/internal/service"
"photowall/pkg/response"
"strconv"
"github.com/gin-gonic/gin"
)
type RegionHandler struct {
svc *service.RegionService
}
func NewRegionHandler(svc *service.RegionService) *RegionHandler {
return &RegionHandler{svc: svc}
}
// List GET /api/regions?parent_id=0
func (h *RegionHandler) List(c *gin.Context) {
parentID, _ := strconv.ParseUint(c.DefaultQuery("parent_id", "0"), 10, 64)
list, err := h.svc.ListByParent(uint(parentID))
if err != nil {
response.Internal(c, err.Error())
return
}
response.OK(c, list)
}
// Countries GET /api/regions/countries
func (h *RegionHandler) Countries(c *gin.Context) {
list, err := h.svc.ListCountries()
if err != nil {
response.Internal(c, err.Error())
return
}
response.OK(c, list)
}
// Path GET /api/regions/:id/path
func (h *RegionHandler) Path(c *gin.Context) {
id, _ := strconv.ParseUint(c.Param("id"), 10, 64)
path, err := h.svc.GetPath(uint(id))
if err != nil {
response.NotFound(c, "地区不存在")
return
}
response.OK(c, path)
}
// Search GET /api/regions/search?keyword=xxx
func (h *RegionHandler) Search(c *gin.Context) {
keyword := c.Query("keyword")
if keyword == "" {
response.BadRequest(c, "请输入搜索关键词")
return
}
list, err := h.svc.Search(keyword, 20)
if err != nil {
response.Internal(c, err.Error())
return
}
response.OK(c, list)
}