Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into release

dev_shibei_match
= 5 years ago
parent
commit
53d39af400
  1. 4
      epmet-gateway/pom.xml
  2. 14
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  3. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java
  4. 2
      epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml
  5. 2
      epmet-openapi/epmet-openapi-scan/pom.xml
  6. 2
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java
  7. 36
      epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java
  8. 2
      epmet-openapi/epmet-openapi-scan/src/main/resources/readme

4
epmet-gateway/pom.xml

@ -170,8 +170,8 @@
<gateway.routes.resi-home-server.uri>lb://resi-home-server</gateway.routes.resi-home-server.uri>
<!-- <gateway.routes.resi-home-server.uri>http://localhost:8104</gateway.routes.resi-home-server.uri>-->
<!-- 26、政府端-党建声音 -->
<gateway.routes.gov-voice-server.uri>lb://gov-voice-server</gateway.routes.gov-voice-server.uri>
<!-- <gateway.routes.gov-voice-server.uri>http://localhost:8105</gateway.routes.gov-voice-server.uri>-->
<!-- <gateway.routes.gov-voice-server.uri>lb://gov-voice-server</gateway.routes.gov-voice-server.uri>-->
<gateway.routes.gov-voice-server.uri>http://localhost:8105</gateway.routes.gov-voice-server.uri>
<!-- 27、居民端-党建声音 -->
<gateway.routes.resi-voice-server.uri>lb://resi-voice-server</gateway.routes.resi-voice-server.uri>
<!-- <gateway.routes.resi-voice-server.uri>http://localhost:8106</gateway.routes.resi-voice-server.uri>-->

14
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -38,11 +38,12 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.constant.*;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.ArticleVisitRecordDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.DraftCoverDTO;
import com.epmet.dto.DraftDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
@ -66,7 +67,6 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.swing.text.StringContent;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
@ -173,6 +173,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO));
if (required) {
ValidatorUtils.validateEntity(fromDTO);
if (StringUtils.isBlank(fromDTO.getTitle())){
throw new RenException(ModuleConstant.ARTICLE_TITLE_IS_NULL);
}
if (CollectionUtils.isEmpty(fromDTO.getContentList())){
throw new RenException(ModuleConstant.ARTICLE_CONTENT_IS_NULL);
}
}
DraftEntity draftEntity = null;

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -89,4 +89,14 @@ public interface ModuleConstant {
* */
String MSG_ARTICLE_PUBLISH_ERROR = "您好,你发布的【%s】文章由于网络错误未发布成功,请重新发布,谢谢。";
/**
* 文章内容不能为空
* */
String ARTICLE_CONTENT_IS_NULL = "文章内容不能为空";
/**
* 文章标题不能为空
* */
String ARTICLE_TITLE_IS_NULL = "文章标题不能为空";
}

2
epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-openapi-scan:
container_name: epmet-openapi-scan-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.6
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.7
ports:
- "8107:8107"
network_mode: host # 不会创建新的网络

2
epmet-openapi/epmet-openapi-scan/pom.xml

@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.6</version>
<version>0.3.7</version>
<artifactId>epmet-openapi-scan</artifactId>
<packaging>jar</packaging>

2
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java

@ -25,7 +25,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(scanApiAuthInterceptor)//添加拦截器
.addPathPatterns("/**") //拦截所有请求
.excludePathPatterns("/UserCon/**");//对应的不拦截的请求
.excludePathPatterns("/opback/addWhite*");//对应的不拦截的请求
}
}

36
epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java

@ -1,36 +1,32 @@
package com.epmet.openapi.scan.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import com.epmet.openapi.scan.common.redis.RedisKeys;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @author jianjun liu
* @date 2020-06-04 20:39
**/
@RestController
@RequestMapping("test")
@RequestMapping("opback")
public class BackDoorController {
@Value("${aliyun.green.accessKeyId}")
private String accessKeyId;
@Autowired
private RedisTemplate redisTemplate;
@Value("${aliyun.green.accessKeySecret}")
private String accessKeySecret;
@Value("${aliyun.green.regionId}")
private String regionId;
@GetMapping("api")
public Result<String> page() {
Map<String,Object> map = new HashMap<>();
map.put(accessKeyId,accessKeyId);
map.put(accessKeySecret,accessKeySecret);
map.put(regionId, regionId);
return new Result<String>().ok(JSON.toJSONString(map));
@RequestMapping("addWhite")
public String addWhite(@RequestParam String ip) {
SetOperations setOperations = redisTemplate.opsForSet();
String whiteList = RedisKeys.getWhiteList();
Long add = setOperations.add(whiteList, ip);
Set members = setOperations.members(whiteList);
return "ip:" + ip + "添加" + (add > 0 ? "成功" : "失败") + ",当前所有列表:" + JSON.toJSONString(members);
}
}

2
epmet-openapi/epmet-openapi-scan/src/main/resources/readme

@ -0,0 +1,2 @@
#添加白名单
sadd epmet:openapi:scan:whitelist "客户端ip地址"
Loading…
Cancel
Save