style: 错误信息英文返回-system 模块路由

This commit is contained in:
TsMask
2023-11-08 14:56:36 +08:00
parent ae7f2d050c
commit a102f772cb
21 changed files with 460 additions and 342 deletions

View File

@@ -45,7 +45,7 @@ func (s *SysLogOperateController) List(c *gin.Context) {
func (s *SysLogOperateController) Remove(c *gin.Context) {
operIds := c.Param("operIds")
if operIds == "" {
c.JSON(400, result.CodeMsg(400, "参数错误"))
c.JSON(400, result.CodeMsg(400, "parameter error"))
return
}
@@ -58,7 +58,7 @@ func (s *SysLogOperateController) Remove(c *gin.Context) {
}
rows := s.SysLogOperateService.DeleteSysLogOperateByIds(uniqueIDs)
if rows > 0 {
msg := fmt.Sprintf("删除成功:%d", rows)
msg := fmt.Sprintf("Deleted successfully: %d", rows)
c.JSON(200, result.OkMsg(msg))
return
}
@@ -85,7 +85,8 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
querys := ctx.BodyJSONMap(c)
data := s.SysLogOperateService.SelectSysLogOperatePage(querys)
if data["total"].(int64) == 0 {
c.JSON(200, result.ErrMsg("导出数据记录为空"))
// 导出数据记录为空
c.JSON(200, result.ErrMsg("Export data record is empty"))
return
}
rows := data["rows"].([]model.SysLogOperate)
@@ -94,22 +95,22 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
fileName := fmt.Sprintf("sys_log_operate_export_%d_%d.xlsx", len(rows), time.Now().UnixMilli())
// 第一行表头标题
headerCells := map[string]string{
"A1": "操作序号",
"B1": "操作模块",
"C1": "业务类型",
"D1": "请求方法",
"E1": "请求方式",
"F1": "操作类别",
"G1": "操作人员",
"H1": "部门名称",
"I1": "请求地址",
"J1": "操作地址",
"K1": "操作地点",
"L1": "请求参数",
"M1": "操作消息",
"N1": "状态",
"O1": "消耗时间(毫秒)",
"P1": "操作时间",
"A1": "ID",
"B1": "Title",
"C1": "BusinessType",
"D1": "Method",
"E1": "RequestMethod",
"F1": "OperatorType",
"G1": "OperName",
"H1": "DeptName",
"I1": "URL",
"J1": "IP",
"K1": "Location",
"L1": "Param",
"M1": "Msg",
"N1": "Status",
"O1": "CostTime (ms)",
"P1": "OperTime",
}
// 从第二行开始的数据
dataCells := make([]map[string]any, 0)
@@ -118,11 +119,11 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
// 业务类型
businessType := ""
// 操作类别
OperatorType := ""
operatorType := ""
// 状态
statusValue := "失败"
statusValue := "fail"
if row.Status == "1" {
statusValue = "成功"
statusValue = "success"
}
dataCells = append(dataCells, map[string]any{
"A" + idx: row.OperID,
@@ -130,7 +131,7 @@ func (s *SysLogOperateController) Export(c *gin.Context) {
"C" + idx: businessType,
"D" + idx: row.Method,
"E" + idx: row.RequestMethod,
"F" + idx: OperatorType,
"F" + idx: operatorType,
"G" + idx: row.OperName,
"H" + idx: row.DeptName,
"I" + idx: row.OperURL,