package handler import ( "net/http" "github.com/gin-gonic/gin" ) // Boards 获取板块列表 func (h *Handlers) Boards(c *gin.Context) { boards, err := h.Board.List() if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } c.JSON(http.StatusOK, gin.H{"boards": nonNilSlice(boards)}) }