未验证 提交 118f9b08 编写于 作者: P pnck 提交者: GitHub

chore: 修正几个okwithdata 的误用 (#1077)

上级 301906b3
......@@ -110,7 +110,7 @@ func (s *SystemApiApi) GetApiById(c *gin.Context) {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithData(systemRes.SysAPIResponse{Api: api}, c)
response.OkWithDetailed(systemRes.SysAPIResponse{Api: api}, "获取成功", c)
}
}
......
......@@ -35,7 +35,7 @@ func (i *DBApi) InitDB(c *gin.Context) {
response.FailWithMessage("自动创建数据库失败,请查看后台日志,检查后在进行初始化", c)
return
}
response.OkWithData("自动创建数据库成功", c)
response.OkWithMessage("自动创建数据库成功", c)
}
// CheckDB
......
......@@ -42,7 +42,7 @@ func (s *SystemApi) SetSystemConfig(c *gin.Context) {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
response.FailWithMessage("设置失败", c)
} else {
response.OkWithData("设置成功", c)
response.OkWithMessage("设置成功", c)
}
}
......
......@@ -35,7 +35,7 @@ func OkWithMessage(message string, c *gin.Context) {
}
func OkWithData(data interface{}, c *gin.Context) {
Result(SUCCESS, data, "操作成功", c)
Result(SUCCESS, data, "查询成功", c)
}
func OkWithDetailed(data interface{}, message string, c *gin.Context) {
......
......@@ -22,7 +22,7 @@ func (s *EmailApi) EmailTest(c *gin.Context) {
global.GVA_LOG.Error("发送失败!", zap.Error(err))
response.FailWithMessage("发送失败", c)
} else {
response.OkWithData("发送成功", c)
response.OkWithMessage("发送成功", c)
}
}
......@@ -40,6 +40,6 @@ func (s *EmailApi) SendEmail(c *gin.Context) {
global.GVA_LOG.Error("发送失败!", zap.Error(err))
response.FailWithMessage("发送失败", c)
} else {
response.OkWithData("发送成功", c)
response.OkWithMessage("发送成功", c)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册