feat: dashboard 初版

This commit is contained in:
tbphp
2025-07-12 20:24:21 +08:00
parent b0e273060b
commit e07ef88e2a
9 changed files with 1027 additions and 252 deletions

View File

@@ -711,3 +711,21 @@ func (s *Server) GetGroupStats(c *gin.Context) {
response.Success(c, resp)
}
// List godoc
// @Summary List all groups for selection
// @Description Get a list of all groups with their ID and display name
// @Tags Groups
// @Accept json
// @Produce json
// @Success 200 {object} response.Response{data=[]models.Group}
// @Router /groups/list [get]
func (s *Server) List(c *gin.Context) {
var groups []models.Group
if err := s.DB.Select("id, display_name").Find(&groups).Error; err != nil {
response.Error(c, app_errors.NewAPIError(app_errors.ErrDatabase, "无法获取分组列表"))
return
}
response.Success(c, groups)
}