🎨 新增轮播图修改状态接口
This commit is contained in:
		@@ -106,3 +106,22 @@ func (b *BannerApi) GetBannerById(ctx *gin.Context) {
 | 
			
		||||
 | 
			
		||||
	r.OkWithDetailed(banner, "获取成功", ctx)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UpdateBannerStatus 更新轮播图状态
 | 
			
		||||
func (b *BannerApi) UpdateBannerStatus(ctx *gin.Context) {
 | 
			
		||||
	var banner common.Banner
 | 
			
		||||
	if err := ctx.ShouldBindJSON(&banner); err != nil {
 | 
			
		||||
		global.GVA_LOG.Error("参数错误" + err.Error())
 | 
			
		||||
		r.FailWithMessage("参数错误"+err.Error(), ctx)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err := bannerService.UpdateBannerStatus(&banner)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		global.GVA_LOG.Error("更新失败" + err.Error())
 | 
			
		||||
		r.FailWithMessage("更新失败"+err.Error(), ctx)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r.OkWithMessage("更新成功", ctx)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user