编号:ZSSAC-585 描述:新增appcode验证
This commit is contained in:
parent
6ee4325537
commit
7fdeb3f39d
@ -10,8 +10,13 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
public class RequestUtils {
|
public class RequestUtils {
|
||||||
|
|
||||||
public static String getHeader(String code){
|
public static String getHeader(String code){
|
||||||
RequestAttributes requestAttributes1 = RequestContextHolder.getRequestAttributes();
|
HttpServletRequest request = null;
|
||||||
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes1).getRequest();
|
try {
|
||||||
|
RequestAttributes requestAttributes1 = RequestContextHolder.getRequestAttributes();
|
||||||
|
request = ((ServletRequestAttributes) requestAttributes1).getRequest();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new SecurityException("获取header中获取appCode信息");
|
||||||
|
}
|
||||||
if(StringUtils.isBlank(request.getHeader(code))){
|
if(StringUtils.isBlank(request.getHeader(code))){
|
||||||
throw new SecurityException("参数异常appCode为空");
|
throw new SecurityException("参数异常appCode为空");
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,9 @@ public class DeploymentApplyEnvironmentController extends BaseController
|
|||||||
public TableDataInfo list(DeploymentApplyEnvironment deploymentApplyEnvironment)
|
public TableDataInfo list(DeploymentApplyEnvironment deploymentApplyEnvironment)
|
||||||
{
|
{
|
||||||
deploymentApplyEnvironment.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentApplyEnvironment.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentApplyEnvironment.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<DeploymentApplyEnvironment> list = deploymentApplyEnvironmentService.selectDeploymentApplyEnvironmentList(deploymentApplyEnvironment);
|
List<DeploymentApplyEnvironment> list = deploymentApplyEnvironmentService.selectDeploymentApplyEnvironmentList(deploymentApplyEnvironment);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -89,6 +92,9 @@ public class DeploymentApplyEnvironmentController extends BaseController
|
|||||||
public AjaxResult add(@RequestBody DeploymentApplyEnvironment deploymentApplyEnvironment)
|
public AjaxResult add(@RequestBody DeploymentApplyEnvironment deploymentApplyEnvironment)
|
||||||
{
|
{
|
||||||
deploymentApplyEnvironment.setAppCode( RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentApplyEnvironment.setAppCode( RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentApplyEnvironment.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
return toAjax(deploymentApplyEnvironmentService.insertDeploymentApplyEnvironment(deploymentApplyEnvironment));
|
return toAjax(deploymentApplyEnvironmentService.insertDeploymentApplyEnvironment(deploymentApplyEnvironment));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,9 @@ public class DeploymentModuleListController extends BaseController
|
|||||||
public TableDataInfo list(DeploymentModuleList deploymentModuleList)
|
public TableDataInfo list(DeploymentModuleList deploymentModuleList)
|
||||||
{
|
{
|
||||||
deploymentModuleList.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentModuleList.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentModuleList.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<DeploymentModuleList> list = deploymentModuleListService.selectDeploymentModuleListList(deploymentModuleList);
|
List<DeploymentModuleList> list = deploymentModuleListService.selectDeploymentModuleListList(deploymentModuleList);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -57,11 +60,11 @@ public class DeploymentModuleListController extends BaseController
|
|||||||
@GetMapping("/qurey/list")
|
@GetMapping("/qurey/list")
|
||||||
public AjaxResult queryByCore(ModuleListByCoreRequest request)
|
public AjaxResult queryByCore(ModuleListByCoreRequest request)
|
||||||
{
|
{
|
||||||
if(StringUtils.isEmpty(request.getAppCore())){
|
|
||||||
throw new SecurityException("参数异常appCode为空");
|
|
||||||
}
|
|
||||||
DeploymentModuleList deploymentModuleList = new DeploymentModuleList();
|
DeploymentModuleList deploymentModuleList = new DeploymentModuleList();
|
||||||
deploymentModuleList.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentModuleList.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentModuleList.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
deploymentModuleList.setSysType(request.getSysType());
|
deploymentModuleList.setSysType(request.getSysType());
|
||||||
List<DeploymentModuleList> list = deploymentModuleListService.selectDeploymentModuleListList(deploymentModuleList);
|
List<DeploymentModuleList> list = deploymentModuleListService.selectDeploymentModuleListList(deploymentModuleList);
|
||||||
return success(list);
|
return success(list);
|
||||||
@ -99,6 +102,9 @@ public class DeploymentModuleListController extends BaseController
|
|||||||
public AjaxResult add(@RequestBody DeploymentModuleList deploymentModuleList)
|
public AjaxResult add(@RequestBody DeploymentModuleList deploymentModuleList)
|
||||||
{
|
{
|
||||||
deploymentModuleList.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentModuleList.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentModuleList.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
return toAjax(deploymentModuleListService.insertDeploymentModuleList(deploymentModuleList));
|
return toAjax(deploymentModuleListService.insertDeploymentModuleList(deploymentModuleList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import com.sf.common.enums.RequestHeaderEnums;
|
import com.sf.common.enums.RequestHeaderEnums;
|
||||||
import com.sf.common.utils.DateUtils;
|
import com.sf.common.utils.DateUtils;
|
||||||
|
import com.sf.common.utils.StringUtils;
|
||||||
import com.sf.common.utils.http.RequestUtils;
|
import com.sf.common.utils.http.RequestUtils;
|
||||||
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
import com.sf.system.deployment.domain.DeploymentServicePublish;
|
||||||
import com.sf.system.deployment.service.IDeploymentServicePublishService;
|
import com.sf.system.deployment.service.IDeploymentServicePublishService;
|
||||||
@ -47,6 +48,9 @@ public class DeploymentServicePublishController extends BaseController
|
|||||||
public TableDataInfo list(DeploymentServicePublish deploymentServicePublish)
|
public TableDataInfo list(DeploymentServicePublish deploymentServicePublish)
|
||||||
{
|
{
|
||||||
deploymentServicePublish.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentServicePublish.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentServicePublish.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<DeploymentServicePublish> list = deploymentServicePublishService.selectDeploymentServicePublishList(deploymentServicePublish);
|
List<DeploymentServicePublish> list = deploymentServicePublishService.selectDeploymentServicePublishList(deploymentServicePublish);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -84,6 +88,9 @@ public class DeploymentServicePublishController extends BaseController
|
|||||||
public AjaxResult add(@RequestBody DeploymentServicePublish deploymentServicePublish)
|
public AjaxResult add(@RequestBody DeploymentServicePublish deploymentServicePublish)
|
||||||
{
|
{
|
||||||
deploymentServicePublish.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
deploymentServicePublish.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(deploymentServicePublish.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
return toAjax(deploymentServicePublishService.insertDeploymentServicePublish(deploymentServicePublish));
|
return toAjax(deploymentServicePublishService.insertDeploymentServicePublish(deploymentServicePublish));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import com.sf.common.core.domain.AjaxResult;
|
|||||||
import com.sf.common.core.page.TableDataInfo;
|
import com.sf.common.core.page.TableDataInfo;
|
||||||
import com.sf.common.enums.BusinessType;
|
import com.sf.common.enums.BusinessType;
|
||||||
import com.sf.common.enums.RequestHeaderEnums;
|
import com.sf.common.enums.RequestHeaderEnums;
|
||||||
|
import com.sf.common.utils.StringUtils;
|
||||||
import com.sf.common.utils.http.RequestUtils;
|
import com.sf.common.utils.http.RequestUtils;
|
||||||
import com.sf.common.utils.poi.ExcelUtil;
|
import com.sf.common.utils.poi.ExcelUtil;
|
||||||
import com.sf.system.deployment.domain.SysApkInfo;
|
import com.sf.system.deployment.domain.SysApkInfo;
|
||||||
@ -38,6 +39,9 @@ public class SysApkInfoController extends BaseController
|
|||||||
public TableDataInfo list(SysApkInfo sysApkInfo)
|
public TableDataInfo list(SysApkInfo sysApkInfo)
|
||||||
{
|
{
|
||||||
sysApkInfo.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
sysApkInfo.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(sysApkInfo.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<SysApkInfo> list = sysApkInfoService.selectSysApkInfoList(sysApkInfo);
|
List<SysApkInfo> list = sysApkInfoService.selectSysApkInfoList(sysApkInfo);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -75,6 +79,9 @@ public class SysApkInfoController extends BaseController
|
|||||||
public AjaxResult add(@RequestBody SysApkInfo sysApkInfo)
|
public AjaxResult add(@RequestBody SysApkInfo sysApkInfo)
|
||||||
{
|
{
|
||||||
sysApkInfo.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
sysApkInfo.setAppCode(RequestUtils.getHeader(RequestHeaderEnums.APP_CODE.getCode()));
|
||||||
|
if(StringUtils.isEmpty(sysApkInfo.getAppCode())){
|
||||||
|
throw new SecurityException("参数异常header中的appCode为空");
|
||||||
|
}
|
||||||
sysApkInfo.setCreated(getUsername());
|
sysApkInfo.setCreated(getUsername());
|
||||||
sysApkInfo.setModified(getUsername());
|
sysApkInfo.setModified(getUsername());
|
||||||
return toAjax(sysApkInfoService.insertSysApkInfo(sysApkInfo));
|
return toAjax(sysApkInfoService.insertSysApkInfo(sysApkInfo));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user