enhance(controller):统一常见操作返回的状态码。

This commit is contained in:
徐涛 2022-08-15 21:21:44 +08:00
parent 1e01954e43
commit cd98d0917a
3 changed files with 6 additions and 6 deletions

View File

@ -79,7 +79,7 @@ func recordNewCharge(c *gin.Context) {
result.Error(http.StatusInternalServerError, err.Error())
return
}
result.Success("指定用户的服务已延期。")
result.Created("指定用户的服务已延期。")
}
type _StateChangeFormData struct {
@ -101,5 +101,5 @@ func modifyChargeState(c *gin.Context) {
result.Error(http.StatusInternalServerError, err.Error())
return
}
result.Success("指定用户服务延期记录状态已经更新。")
result.Updated("指定用户服务延期记录状态已经更新。")
}

View File

@ -103,7 +103,7 @@ func createNewPark(c *gin.Context) {
result.Error(http.StatusInternalServerError, err.Error())
return
}
result.Success("新园区完成创建。")
result.Created("新园区完成创建。")
}
func modifyPark(c *gin.Context) {

View File

@ -141,7 +141,7 @@ func resetUserPassword(c *gin.Context) {
return
}
if completed {
result.Success("用户凭据已更新。")
result.Updated("用户凭据已更新。")
return
}
result.NotAccept("用户凭据未能成功更新。")
@ -199,7 +199,7 @@ func switchUserEnabling(c *gin.Context) {
return
}
}
result.Success("用户状态已经更新。")
result.Updated("用户状态已经更新。")
}
type _OPSAccountCreationFormData struct {
@ -345,7 +345,7 @@ func modifyAccountDetail(c *gin.Context) {
result.Error(http.StatusInternalServerError, err.Error())
return
}
result.Success("指定用户的信息已经更新。")
result.Updated("指定用户的信息已经更新。")
}
func quickSearchEnterprise(c *gin.Context) {