Unifies the output of the routing layer and the isolated response structure

This commit is contained in:
Granty1
2020-04-08 14:00:08 +08:00
parent 5d222585dd
commit 4277505c6a
24 changed files with 250 additions and 121 deletions
+2 -2
View File
@@ -19,8 +19,8 @@ func CreateWorkFlow(c *gin.Context) {
_ = c.ShouldBindJSON(&wk)
err := service.Create(wk)
if err != nil {
response.Result(response.ERROR, gin.H{}, fmt.Sprintf("获取失败:%v", err), c)
response.FailWithMessage(fmt.Sprintf("获取失败:%v", err), c)
} else {
response.Result(response.SUCCESS, gin.H{}, "获取成功", c)
response.OkWithMessage("获取成功", c)
}
}