fix: 显示分组名
This commit is contained in:
@@ -712,18 +712,10 @@ func (s *Server) GetGroupStats(c *gin.Context) {
|
|||||||
response.Success(c, resp)
|
response.Success(c, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// List godoc
|
// 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) {
|
func (s *Server) List(c *gin.Context) {
|
||||||
var groups []models.Group
|
var groups []models.Group
|
||||||
if err := s.DB.Select("id, display_name").Find(&groups).Error; err != nil {
|
if err := s.DB.Select("id, name,display_name").Find(&groups).Error; err != nil {
|
||||||
response.Error(c, app_errors.NewAPIError(app_errors.ErrDatabase, "无法获取分组列表"))
|
response.Error(c, app_errors.NewAPIError(app_errors.ErrDatabase, "无法获取分组列表"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user