瀏覽代碼

fix 日志

he2802 4 年之前
父節點
當前提交
cfb954dc0a

+ 7 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/monitor/SysOperlogController.java

@@ -1,6 +1,11 @@
 package com.zhongzheng.controller.monitor;
 
 import java.util.List;
+
+import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
+import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -22,6 +27,7 @@ import com.zhongzheng.modules.system.service.ISysOperLogService;
  *
  * @author zhongzheng
  */
+@Api(tags ="操作日志记录")
 @RestController
 @RequestMapping("/monitor/operlog")
 public class SysOperlogController extends BaseController
@@ -29,6 +35,7 @@ public class SysOperlogController extends BaseController
     @Autowired
     private ISysOperLogService operLogService;
 
+    @ApiOperation("操作日志分页列表")
     @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysOperLog operLog)

+ 21 - 6
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysDeptController.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.controller.system;
 
 import cn.hutool.core.util.StrUtil;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.constant.UserConstants;
 import com.zhongzheng.common.core.controller.BaseController;
@@ -9,20 +10,25 @@ import com.zhongzheng.common.core.domain.entity.SysDept;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.modules.system.service.ISysDeptService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 部门信息
  *
  * @author zhongzheng
  */
+@Api(tags ="部门信息管理")
 @RestController
 @RequestMapping("/system/dept")
 public class SysDeptController extends BaseController
@@ -33,6 +39,7 @@ public class SysDeptController extends BaseController
     /**
      * 获取部门列表
      */
+    @ApiOperation("部门列表")
     @PreAuthorize("@ss.hasPermi('system:dept:list')")
     @GetMapping("/list")
     public AjaxResult list(SysDept dept)
@@ -44,6 +51,7 @@ public class SysDeptController extends BaseController
     /**
      * 查询部门列表(排除节点)
      */
+    @ApiOperation("查询部门列表(节点)")
     @PreAuthorize("@ss.hasPermi('system:dept:list')")
     @GetMapping("/list/exclude/{deptId}")
     public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
@@ -65,6 +73,7 @@ public class SysDeptController extends BaseController
     /**
      * 根据部门编号获取详细信息
      */
+    @ApiOperation("根据部门编号获取详细信息")
     @PreAuthorize("@ss.hasPermi('system:dept:query')")
     @GetMapping(value = "/{deptId}")
     public AjaxResult getInfo(@PathVariable Long deptId)
@@ -75,6 +84,7 @@ public class SysDeptController extends BaseController
     /**
      * 获取部门下拉树列表
      */
+    @ApiOperation("获取部门下拉树列表")
     @GetMapping("/treeselect")
     public AjaxResult treeselect(SysDept dept)
     {
@@ -85,19 +95,22 @@ public class SysDeptController extends BaseController
     /**
      * 加载对应角色部门列表树
      */
+    @ApiOperation("加载对应角色部门列表树")
     @GetMapping(value = "/roleDeptTreeselect/{roleId}")
     public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
     {
         List<SysDept> depts = deptService.selectDeptList(new SysDept());
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
-        ajax.put("depts", deptService.buildDeptTreeSelect(depts));
-        return ajax;
+        Map<String,Object> map = new HashMap<>();
+        map.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
+        map.put("depts", deptService.buildDeptTreeSelect(depts));
+        return AjaxResult.success(map);
     }
 
     /**
      * 新增部门
      */
+    @ApiOperation("新增部门")
+    @ApiOperationSupport(includeParameters = {"deptName","parentId","orderNum","status"})
     @PreAuthorize("@ss.hasPermi('system:dept:add')")
     @Log(title = "部门管理", businessType = BusinessType.INSERT)
     @PostMapping
@@ -114,9 +127,10 @@ public class SysDeptController extends BaseController
     /**
      * 修改部门
      */
+    @ApiOperation("修改部门")
     @PreAuthorize("@ss.hasPermi('system:dept:edit')")
     @Log(title = "部门管理", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @PostMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysDept dept)
     {
         if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
@@ -139,9 +153,10 @@ public class SysDeptController extends BaseController
     /**
      * 删除部门
      */
+    @ApiOperation("删除部门")
     @PreAuthorize("@ss.hasPermi('system:dept:remove')")
     @Log(title = "部门管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{deptId}")
+    @PostMapping("/delete/{deptId}")
     public AjaxResult remove(@PathVariable Long deptId)
     {
         if (deptService.hasChildByDeptId(deptId))

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysLoginController.java

@@ -81,7 +81,7 @@ public class SysLoginController
         Set<String> roles = permissionService.getRolePermission(user);
         // 权限集合
         Set<String> permissions = permissionService.getMenuPermission(user);
-        Map map = new HashMap<>();
+        Map<String,Object> map = new HashMap<>();
         map.put("user", user);
         map.put("roles", roles);
         map.put("permissions", permissions);

+ 1 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysRoleController.java

@@ -48,6 +48,7 @@ public class SysRoleController extends BaseController
     @Autowired
     private ISysUserService userService;
 
+    @ApiOperation("角色列表")
     @PreAuthorize("@ss.hasPermi('system:role:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysRole role)

+ 7 - 2
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysDept.java

@@ -2,6 +2,7 @@ package com.zhongzheng.common.core.domain.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -14,7 +15,7 @@ import java.util.*;
 
 /**
  * 部门表 sys_dept
- * 
+ *
  * @author zhongzheng
  */
 
@@ -30,17 +31,20 @@ public class SysDept implements Serializable
     private Long deptId;
 
     /** 父部门ID */
+    @ApiModelProperty(value ="父部门ID",required = true)
     private Long parentId;
 
     /** 祖级列表 */
     private String ancestors;
 
     /** 部门名称 */
+    @ApiModelProperty(value ="部门名称",required = true)
     @NotBlank(message = "部门名称不能为空")
     @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
     private String deptName;
 
     /** 显示顺序 */
+    @ApiModelProperty(value ="显示顺序")
     @NotBlank(message = "显示顺序不能为空")
     private String orderNum;
 
@@ -57,6 +61,7 @@ public class SysDept implements Serializable
     private String email;
 
     /** 部门状态:0正常,1停用 */
+    @ApiModelProperty(value ="部门状态:1正常,0停用")
     private String status;
 
     /** 删除标志(0代表存在 2代表删除) */
@@ -84,7 +89,7 @@ public class SysDept implements Serializable
     @TableField(fill = FieldFill.INSERT_UPDATE)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
-    
+
     /** 子部门 */
     @TableField(exist = false)
     private List<SysDept> children = new ArrayList<SysDept>();

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysOperLog.java

@@ -154,7 +154,7 @@ public class SysOperLog implements Serializable {
         String params = getOperParam();
         //专业分类模块
         if(getOperUrl().startsWith("/course/category")&&getStatus()==0){
-            //新增
+            //新增分类
             if(getOperUrl().equals("/course/category")){
                 JSONObject jsonObject = JSONObject.parseObject(params);
                 JSONObject resultObject = JSONObject.parseObject(getJsonResult());
@@ -163,7 +163,7 @@ public class SysOperLog implements Serializable {
                     setOperContent("新增分类:"+ jsonObject.get("categoryName"));
                 }
             }
-            //修改
+            //修改分类
             if(getOperUrl().equals("/course/category/edit")){
                 JSONObject jsonObject = JSONObject.parseObject(params);
                 if (jsonObject.containsKey("categoryId")){