[测评系统]--测评系统核心代码库
linzhijie
2021-08-16 7c6ff5de779476a50c26182d9c5075cf7b3a2394
src/main/java/com/ots/project/system/user/controller/UserController.java
@@ -1,4 +1,5 @@
package com.ots.project.system.user.controller;
import com.ots.common.constant.UserConstants;
import com.ots.common.enums.UserTypeEnum;
import com.ots.common.utils.StringUtils;
@@ -20,6 +21,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Controller
@@ -32,16 +34,19 @@
    private IRoleService roleService;
    @Autowired
    private IPostService postService;
    @RequiresPermissions("system:user:view")
    @GetMapping()
    public String user() {
        return prefix + "/user";
    }
    @RequiresPermissions("system:user:manager:view")
    @GetMapping("/manager")
    public String manager() {
        return prefix + "/usermanager";
    }
    @RequiresPermissions("system:user:list")
    @PostMapping("/list")
    @ResponseBody
@@ -51,6 +56,7 @@
        List<User> list = userService.selectUserList(user);
        return getDataTable(list);
    }
    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
    @RequiresPermissions("system:user:export")
    @PostMapping("/export")
@@ -60,6 +66,7 @@
        ExcelUtil<User> util = new ExcelUtil<User>(User.class);
        return util.exportExcel(list, "用户数据");
    }
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @RequiresPermissions("system:user:import")
    @PostMapping("/importData")
@@ -70,6 +77,7 @@
        String message = userService.importUser(userList, updateSupport);
        return AjaxResult.success(message);
    }
    @RequiresPermissions("system:user:view")
    @GetMapping("/importTemplate")
    @ResponseBody
@@ -122,6 +130,7 @@
        }
        return toAjax(userService.updateUser(user));
    }
    @RequiresPermissions("system:user:resetPwd")
    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
    @GetMapping("/resetPwd/{userId}")
@@ -129,6 +138,7 @@
        mmap.put("user", userService.selectUserById(userId));
        return prefix + "/resetPwd";
    }
    @RequiresPermissions("system:user:resetPwd")
    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
    @PostMapping("/resetPwd")
@@ -142,6 +152,7 @@
        }
        return error();
    }
    @RequiresPermissions("system:user:remove")
    @Log(title = "用户管理", businessType = BusinessType.DELETE)
    @PostMapping("/remove")
@@ -179,4 +190,13 @@
    public AjaxResult changeStatus(User user) {
        return toAjax(userService.changeStatus(user));
    }
    @Log(title = "事中提示语授权", businessType = BusinessType.UPDATE)
    @RequiresPermissions("system:user:hint:auth")
    @GetMapping("/changeHintStatus")
    @ResponseBody
    public AjaxResult changeHintStatus(String userId,Integer type) {
        //type 0取消授权 1授权
        return toAjax(userService.changeHintStatus(userId,type));
    }
}