From 93fe0b66e85e95e3a7e77a28504d6d289b6906b9 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Fri, 08 Oct 2021 13:11:22 +0800 Subject: [PATCH] screen-manage screen-api 更改拦截器逻辑,记录token无效的请求IP以及URL。 manage记录到数据库日志中 api记录在日志文件中 --- screen-manage/src/main/java/com/moral/api/controller/AccountController.java | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/screen-manage/src/main/java/com/moral/api/controller/AccountController.java b/screen-manage/src/main/java/com/moral/api/controller/AccountController.java index 0c39f9a..3d6d8af 100644 --- a/screen-manage/src/main/java/com/moral/api/controller/AccountController.java +++ b/screen-manage/src/main/java/com/moral/api/controller/AccountController.java @@ -1,18 +1,12 @@ package com.moral.api.controller; -import com.moral.api.entity.SysArea; import com.moral.api.pojo.dto.account.*; -import com.moral.api.pojo.dto.organization.OrganizationDTO; -import com.moral.api.pojo.form.account.AccountDeleteForm; -import com.moral.api.pojo.form.account.AccountInsertForm; -import com.moral.api.pojo.form.account.AccountQueryForm; -import com.moral.api.pojo.form.account.AccountUpdateForm; -import com.moral.api.pojo.vo.account.AccountDeleteVO; -import com.moral.api.pojo.vo.account.AccountInsertVO; +import com.moral.api.pojo.dto.accountRole.AccountRoleDTO; +import com.moral.api.pojo.form.account.*; +import com.moral.api.pojo.form.accountRole.AccountRoleUpdateForm; import com.moral.api.pojo.vo.account.AccountQueryVO; -import com.moral.api.pojo.vo.account.AccountUpdateVO; +import com.moral.api.service.ManageAccountRoleService; import com.moral.api.service.ManageAccountService; -import com.moral.api.service.SysAreaService; import com.moral.constant.ResponseCodeEnum; import com.moral.constant.ResultMessage; import io.swagger.annotations.*; @@ -20,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.List; @Slf4j @Api(tags = {"������������������"}) @@ -30,6 +23,8 @@ public class AccountController { @Autowired ManageAccountService accountService; + @Autowired + ManageAccountRoleService manageAccountRoleService; @PostMapping("insert") public ResultMessage insert(@RequestBody AccountInsertForm form) { @@ -47,10 +42,7 @@ //������������������ AccountDTO dto = accountService.insertAccount(form); - //������������������������ - AccountInsertVO accountInsertVO = AccountInsertVO.convert(dto); - - return new ResultMessage(dto.getCode(), dto.getMsg(), accountInsertVO); + return new ResultMessage(dto.getCode(), dto.getMsg(), null); } @PostMapping("update") @@ -69,10 +61,7 @@ //������������������ AccountDTO dto = accountService.updateAccount(form); - //��������������������������� - AccountUpdateVO vo = AccountUpdateVO.convert(dto); - - return new ResultMessage(dto.getCode(), dto.getMsg(), vo); + return new ResultMessage(dto.getCode(), dto.getMsg(), null); } @PostMapping("delete") @@ -85,10 +74,7 @@ //������������������ AccountDTO dto = accountService.deleteAccount(form); - //��������������������������� - AccountDeleteVO vo = AccountDeleteVO.convert(dto); - - return new ResultMessage(dto.getCode(), dto.getMsg(), vo); + return new ResultMessage(dto.getCode(), dto.getMsg(), null); } @GetMapping("query") @@ -108,4 +94,18 @@ return new ResultMessage(accountQueryDTO.getCode(), accountQueryDTO.getMsg(), accountQueryVO); } + @PostMapping("updateRole") + public ResultMessage updateRole(@RequestBody AccountRoleUpdateForm form){ + + //������������������������ + if (!form.valid()) + return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), + ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); + + //������������������ + AccountRoleDTO dto = manageAccountRoleService.updateAccountRole(form); + + return new ResultMessage(dto.getCode(), dto.getMsg(), null); + } + } -- Gitblit v1.8.0