处理 SpringMVC 全局处理
This commit is contained in:
@@ -18,10 +18,13 @@ import cn.iocoder.mall.systemservice.rpc.permission.RoleRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.permission.vo.RoleVO;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class AdminManager {
|
||||
|
||||
@Reference(version = "${dubbo.consumer.AdminRpc.version}", validation = "false")
|
||||
@@ -104,7 +107,7 @@ public class AdminManager {
|
||||
updateAdminResult.checkError();
|
||||
}
|
||||
|
||||
public void updateAdminStatus(AdminUpdateStatusDTO updateStatusDTO) {
|
||||
public void updateAdminStatus(@Valid AdminUpdateStatusDTO updateStatusDTO) {
|
||||
CommonResult<Boolean> updateAdminResult = adminRpc.updateAdmin(AdminConvert.INSTANCE.convert(updateStatusDTO));
|
||||
updateAdminResult.checkError();
|
||||
}
|
||||
|
||||
@@ -3,9 +3,12 @@ package cn.iocoder.mall.managementweb.manager.systemlog;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.dto.SystemExceptionLogPageDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.dto.SystemExceptionLogProcessDTO;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.vo.SystemExceptionLogDetailVO;
|
||||
import cn.iocoder.mall.managementweb.controller.systemlog.vo.SystemExceptionLogVO;
|
||||
import cn.iocoder.mall.managementweb.convert.systemlog.SystemExceptionLogConvert;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.AdminRpc;
|
||||
import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO;
|
||||
import cn.iocoder.mall.systemservice.rpc.systemlog.SystemExceptionLogRpc;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -16,8 +19,10 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SystemExceptionLogManager {
|
||||
|
||||
@Reference(version = "$ {dubbo.consumer.SystemExceptionLogRpc.version}", validation = "false")
|
||||
@Reference(version = "${dubbo.consumer.SystemExceptionLogRpc.version}", validation = "false")
|
||||
private SystemExceptionLogRpc systemExceptionLogRpc;
|
||||
@Reference(version = "${dubbo.consumer.AdminRpc.version}", validation = "false")
|
||||
private AdminRpc adminRpc;
|
||||
|
||||
/**
|
||||
* 获得系统异常日志
|
||||
@@ -26,11 +31,21 @@ public class SystemExceptionLogManager {
|
||||
* @return 系统异常日志
|
||||
*/
|
||||
public SystemExceptionLogDetailVO getSystemExceptionLogDetail(Integer systemExceptionLogId) {
|
||||
// 获得系统异常明细
|
||||
CommonResult<cn.iocoder.mall.systemservice.rpc.systemlog.vo.SystemExceptionLogVO> getSystemExceptionLogResult
|
||||
= systemExceptionLogRpc.getSystemExceptionLog(systemExceptionLogId);
|
||||
getSystemExceptionLogResult.checkError();
|
||||
// return SystemExceptionLogConvert.INSTANCE.convert(getSystemExceptionLogResult.getData());
|
||||
return null;
|
||||
SystemExceptionLogDetailVO logDetailVO = SystemExceptionLogConvert.INSTANCE.convert(getSystemExceptionLogResult.getData());
|
||||
// 拼接处理管理员信息
|
||||
if (getSystemExceptionLogResult.getData().getProcessAdminId() != null) {
|
||||
CommonResult<AdminVO> adminVOResult = adminRpc.getAdmin(getSystemExceptionLogResult.getData().getProcessAdminId());
|
||||
adminVOResult.checkError();
|
||||
if (adminVOResult.getData() != null) {
|
||||
SystemExceptionLogDetailVO.Admin admin = SystemExceptionLogConvert.INSTANCE.convert(adminVOResult.getData());
|
||||
logDetailVO.setProcessAdmin(admin);
|
||||
}
|
||||
}
|
||||
return logDetailVO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,4 +61,16 @@ public class SystemExceptionLogManager {
|
||||
return SystemExceptionLogConvert.INSTANCE.convertPage(pageSystemExceptionLogResult.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理系统异常日志
|
||||
*
|
||||
* @param processAdminId 处理管理员编号
|
||||
* @param processDTO 处理系统异常日志 DTO
|
||||
*/
|
||||
public void processSystemExceptionLog(Integer processAdminId, SystemExceptionLogProcessDTO processDTO) {
|
||||
CommonResult<Boolean> processSystemExceptionLogResult = systemExceptionLogRpc.processSystemExceptionLog(
|
||||
SystemExceptionLogConvert.INSTANCE.convert(processDTO).setProcessAdminId(processAdminId));
|
||||
processSystemExceptionLogResult.checkError();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user