优化首页公告与轮播图
This commit is contained in:
@@ -36,6 +36,24 @@ func (h *Handler) PublishOptions(c *gin.Context) {
|
||||
response.OK(c, options)
|
||||
}
|
||||
|
||||
func (h *Handler) HomeAnnouncements(c *gin.Context) {
|
||||
announcements, err := h.service.HomeAnnouncements()
|
||||
if err != nil {
|
||||
writeConfigError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, announcements)
|
||||
}
|
||||
|
||||
func (h *Handler) HomeConfig(c *gin.Context) {
|
||||
config, err := h.service.HomeConfig()
|
||||
if err != nil {
|
||||
writeConfigError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, config)
|
||||
}
|
||||
|
||||
func (h *Handler) Update(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user