123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- package thyyxxk.webserver.controller.settings;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import lombok.Data;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import thyyxxk.webserver.entity.ResultVo;
- import thyyxxk.webserver.entity.login.PersonnelQueryConditions;
- import thyyxxk.webserver.entity.login.UserInfo;
- import thyyxxk.webserver.entity.login.VueMenu;
- import thyyxxk.webserver.entity.settings.deptphones.DeptPhones;
- import thyyxxk.webserver.entity.settings.permissions.*;
- import thyyxxk.webserver.entity.settings.users.ChangePwdParam;
- import thyyxxk.webserver.entity.settings.users.WorkIntegrationPlatformAdvice;
- import thyyxxk.webserver.service.settings.SettingsService;
- import java.util.List;
- @RestController
- @RequestMapping("/settings")
- public class SettingsController {
- private final SettingsService service;
- @Autowired
- public SettingsController(SettingsService service) {
- this.service = service;
- }
- @GetMapping("/getUserInfo")
- public ResultVo<UserInfo> getUserInfo() {
- return service.getUserInfo();
- }
- @PostMapping("/changePassword")
- public ResultVo<String> changePassword(@RequestBody ChangePwdParam param) {
- return service.changePassword(param);
- }
- @GetMapping("/getDeptTree")
- public ResultVo<List<DeptTree>> getDeptTree() {
- return service.getDeptTree();
- }
- @PostMapping("/getAllUsers")
- public ResultVo<IPage<UserInfo>> getAllUsers(@RequestBody PersonnelQueryConditions param) {
- return service.getAllUsers(param);
- }
- @GetMapping("/getAllRoles")
- public ResultVo<List<Role>> getAllRoles() {
- return service.getAllRoles();
- }
- @GetMapping("/getUserRoles")
- public ResultVo<List<Integer>> getUserRoles(@RequestParam("code") String code) {
- return service.getUserRoles(code);
- }
- @PostMapping("/saveUserRoles")
- public ResultVo<String> saveUserRoles(@RequestBody SaveUserRolesParam param) {
- return service.saveUserRoles(param);
- }
- @GetMapping("/addNewRole")
- public ResultVo<String> addNewRole(@RequestParam("name") String name) {
- return service.addNewRole(name.trim());
- }
- @Deprecated
- @GetMapping("/getRoleMenus")
- public ResultVo<List<Integer>> getRoleMenus(@RequestParam("id") Integer id) {
- return service.getRoleMenus(id);
- }
- @Deprecated
- @PostMapping("/saveRoleMenus")
- public ResultVo<String> saveRoleMenus(@RequestBody SaveRoleMenusParam param) {
- return service.saveRoleMenus(param);
- }
- @GetMapping("/getDeptPhones")
- public ResultVo<List<DeptPhones>> getDeptPhones() {
- return service.getDeptPhones();
- }
- @PostMapping("/saveDeptPhone")
- public ResultVo<String> saveDeptPhone(@RequestBody DeptPhones param) {
- return service.saveDeptPhone(param);
- }
- @GetMapping("/getMyAdvices")
- public ResultVo<List<WorkIntegrationPlatformAdvice>> getMyAdvices() {
- return service.getMyAdvices();
- }
- @PostMapping("/submitNewAdvice")
- public ResultVo<String> submitNewAdvice(@RequestBody WorkIntegrationPlatformAdvice advice) {
- return service.submitNewAdvice(advice);
- }
- @GetMapping("/checkAdvice")
- public ResultVo<String> checkAdvice(@RequestParam("id") Integer id) {
- return service.checkAdvice(id);
- }
- @GetMapping("/dismissUserBadge")
- public ResultVo<String> dismissUserBadge(@RequestParam("id") Integer id) {
- return service.dismissUserBadge(id);
- }
- @PostMapping("/replyAdvice")
- public ResultVo<String> replyAdvice(@RequestBody WorkIntegrationPlatformAdvice advice) {
- return service.replyAdvice(advice);
- }
- @GetMapping("/getAllVueMenus")
- public ResultVo<List<VueMenu>> getAllVueMenus() {
- return service.getAllVueMenus();
- }
- @GetMapping("/getRoleVueMenus")
- public ResultVo<List<Integer>> getRoleVueMenus(@RequestParam("id") Integer id) {
- return service.getRoleVueMenus(id);
- }
- @PostMapping("/saveRoleVueMenus")
- public ResultVo<String> saveRoleVueMenus(@RequestBody SaveRoleMenusParam param) {
- return service.saveRoleVueMenus(param);
- }
- @PostMapping("/modifyEmployeeInfo")
- public ResultVo<String> modifyEmployeeInfo(@RequestBody UserInfo userInfo) {
- return service.modifyEmployeeInfo(userInfo);
- }
- @PostMapping("/saveEmployeeInfo")
- public ResultVo<String> saveEmployeeInfo(@RequestBody UserInfo userInfo) {
- return service.saveEmployeeInfo(userInfo);
- }
- @Data
- public static class ResetPassword {
- private String code;
- private Integer nextTime;
- }
- @PostMapping("/resetPasswordByCode")
- public ResultVo<String> resetPasswordByCode(@RequestBody ResetPassword r) {
- return service.resetPasswordByCode(r.getCode(), r.getNextTime());
- }
- }
|