fix: fix update site general info incorrect request process

This commit is contained in:
LinkinStar 2022-09-30 15:30:50 +08:00
parent b615b59593
commit a05e76ddf3
1 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,9 @@ func (sc *SiteInfoController) GetInterface(ctx *gin.Context) {
// @Router /answer/admin/api/siteinfo/general [put]
func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context) {
req := schema.SiteGeneralReq{}
handler.BindAndCheck(ctx, &req)
if handler.BindAndCheck(ctx, &req) {
return
}
err := sc.siteInfoService.SaveSiteGeneral(ctx, req)
handler.HandleResponse(ctx, err, nil)
}
@ -72,7 +74,9 @@ func (sc *SiteInfoController) UpdateGeneral(ctx *gin.Context) {
// @Router /answer/admin/api/siteinfo/interface [put]
func (sc *SiteInfoController) UpdateInterface(ctx *gin.Context) {
req := schema.SiteInterfaceReq{}
handler.BindAndCheck(ctx, &req)
if handler.BindAndCheck(ctx, &req) {
return
}
err := sc.siteInfoService.SaveSiteInterface(ctx, req)
handler.HandleResponse(ctx, err, nil)
}