style: 错误信息英文返回-system 模块路由
This commit is contained in:
@@ -42,7 +42,7 @@ func (s *SysNoticeController) List(c *gin.Context) {
|
||||
func (s *SysNoticeController) Info(c *gin.Context) {
|
||||
noticeId := c.Param("noticeId")
|
||||
if noticeId == "" {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
data := s.sysNoticeService.SelectNoticeById(noticeId)
|
||||
@@ -60,7 +60,7 @@ func (s *SysNoticeController) Add(c *gin.Context) {
|
||||
var body model.SysNotice
|
||||
err := c.ShouldBindBodyWith(&body, binding.JSON)
|
||||
if err != nil || body.NoticeID != "" {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -80,14 +80,15 @@ func (s *SysNoticeController) Edit(c *gin.Context) {
|
||||
var body model.SysNotice
|
||||
err := c.ShouldBindBodyWith(&body, binding.JSON)
|
||||
if err != nil || body.NoticeID == "" {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否存在
|
||||
notice := s.sysNoticeService.SelectNoticeById(body.NoticeID)
|
||||
if notice.NoticeID != body.NoticeID {
|
||||
c.JSON(200, result.ErrMsg("没有权限访问公告信息数据!"))
|
||||
// 没有可访问公告信息数据!
|
||||
c.JSON(200, result.ErrMsg("There is no accessible bulletin information data!"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -106,7 +107,7 @@ func (s *SysNoticeController) Edit(c *gin.Context) {
|
||||
func (s *SysNoticeController) Remove(c *gin.Context) {
|
||||
noticeIds := c.Param("noticeIds")
|
||||
if noticeIds == "" {
|
||||
c.JSON(400, result.CodeMsg(400, "参数错误"))
|
||||
c.JSON(400, result.CodeMsg(400, "parameter error"))
|
||||
return
|
||||
}
|
||||
// 处理字符转id数组后去重
|
||||
@@ -121,6 +122,6 @@ func (s *SysNoticeController) Remove(c *gin.Context) {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
msg := fmt.Sprintf("删除成功:%d", rows)
|
||||
msg := fmt.Sprintf("Deleted successfully: %d", rows)
|
||||
c.JSON(200, result.OkMsg(msg))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user