Commit de08f5a1 authored by yangshuxing's avatar yangshuxing

切换榜单

parent ba470d82
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<relativePath></relativePath> <relativePath></relativePath>
</parent> </parent>
<!-- 项目属性 --> <!-- 项目属性 -->
<properties> <properties>
<!-- main version setting --> <!-- main version setting -->
...@@ -52,21 +53,13 @@ ...@@ -52,21 +53,13 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
<version>2.0.6.RELEASE</version> <version>2.0.6.RELEASE</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
...@@ -321,9 +314,44 @@ ...@@ -321,9 +314,44 @@
<artifactId>pagehelper-spring-boot-starter</artifactId> <artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.13</version> <version>1.2.13</version>
</dependency> </dependency>
<!-- spring-cloud-alibaba-dependencies 依赖同注册中心 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<!-- Sentinel依赖 -->
<!-- <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>0.2.2.RELEASE</version>
</dependency>-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-datasource</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<!-- Sentinel-nacos -->
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-nacos</artifactId>
<version>1.7.2</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>
<repository> <repository>
<id>nexus</id> <id>nexus</id>
<name>Private Repositories</name> <name>Private Repositories</name>
...@@ -334,16 +362,6 @@ ...@@ -334,16 +362,6 @@
<checksumPolicy>fail</checksumPolicy> <checksumPolicy>fail</checksumPolicy>
</snapshots> </snapshots>
</repository> </repository>
<!--<repository>
<id>center</id>
<name>Private Repositories</name>
<url>https://oss.sonatype.org/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:60</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>-->
</repositories> </repositories>
<pluginRepositories> <pluginRepositories>
<pluginRepository> <pluginRepository>
......
package com.dlbridge.feign;
import com.dlbridge.feign.bean.CmptScoreCheckpoint;
import com.dlbridge.jadp.config.web.FeignConfig;
import com.dlbridge.jadp.fallback.GeexekScoreFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 废弃单独处理成绩工程
*/
@FeignClient(name = "geexekscore", configuration = FeignConfig.class, fallbackFactory = GeexekScoreFallbackFactory.class)
@RequestMapping("geexekscore/api/v1/cmpt-score-checkpoint")
public interface GeexekScoreService {
@GetMapping(value = "/getCheckPointByRoadId")
List<CmptScoreCheckpoint> getCheckPointByRoadId(@RequestParam("roadId") int roadId);
@RequestMapping(value = "batchInsert",method = RequestMethod.POST)
List<CmptScoreCheckpoint> batchInsert(List<CmptScoreCheckpoint> cmptScoreCheckpoints);
@DeleteMapping(value = "deleteAllByRoadId/{roadId}")
List<CmptScoreCheckpoint> deleteAllByRoadId(@PathVariable("roadId") int roadId);
@PostMapping("saveCheckPoint")
void saveOrUpdateCheckPoint(@RequestBody List<CmptScoreCheckpoint> list);
@RequestMapping("hasCheckPoint/{cmptId}")
int hasCheckPoint(@PathVariable("cmptId") Integer cmptId);
}
package com.dlbridge.feign.bean; package com.dlbridge.feign.bean;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -40,17 +38,17 @@ public class CmptScoreRule{ ...@@ -40,17 +38,17 @@ public class CmptScoreRule{
private Integer scoreUploadTimes; private Integer scoreUploadTimes;
@ApiModelProperty(value = "成绩上传的开始时间(赛事的开始时间,过渡数据使用,后期优化掉)") @ApiModelProperty(value = "成绩上传的开始时间(赛事的开始时间,过渡数据使用,后期优化掉)")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime; private LocalDateTime startTime;
@ApiModelProperty(value = "成绩上传的截止时间(赛事的结束时间,过渡数据使用,后期优化掉)") @ApiModelProperty(value = "成绩上传的截止时间(赛事的结束时间,过渡数据使用,后期优化掉)")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime; private LocalDateTime endTime;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime insertTime; private LocalDateTime insertTime;
......
package com.dlbridge.jadp; package com.dlbridge.jadp;
import com.dlbridge.feign.NewsService;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
...@@ -9,14 +8,9 @@ import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; ...@@ -9,14 +8,9 @@ import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
...@@ -25,7 +19,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; ...@@ -25,7 +19,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
* @Description: springboot启动器 * @Description: springboot启动器
*/ */
@EnableCaching @EnableCaching
@SpringBootApplication(exclude = RedisAutoConfiguration.class) @SpringBootApplication(exclude = {RedisAutoConfiguration.class})
@EnableWebMvc @EnableWebMvc
@MapperScan(basePackages = "com.dlbridge.jadp.plugins.cmpt.dao.mapper") @MapperScan(basePackages = "com.dlbridge.jadp.plugins.cmpt.dao.mapper")
@EnableAspectJAutoProxy(proxyTargetClass = true) @EnableAspectJAutoProxy(proxyTargetClass = true)
...@@ -33,8 +27,9 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; ...@@ -33,8 +27,9 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@EnableDiscoveryClient @EnableDiscoveryClient
public class Application extends SpringBootServletInitializer { public class Application extends SpringBootServletInitializer {
@Override @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { public SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class); return application.sources(Application.class);
} }
......
package com.dlbridge.jadp.config.dbconnect; package com.dlbridge.jadp.config.dbconnect;
import javax.sql.DataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.alibaba.druid.pool.DruidDataSource;
/** /**
* @ClassName: DataSourceConfiguration * @ClassName: DataSourceConfiguration
* @Description: 单数据源配置 * @Description: 单数据源配置
*/ */
@Configuration //@Configuration
@MapperScan(basePackages = "com.dlbridge.jadp") //配置mapper //@MapperScan(basePackages = "com.dlbridge.jadp") //配置mapper
public class DataSourceConfiguration { public class DataSourceConfiguration {
@Bean /*@Bean
@ConfigurationProperties(prefix = "jdbc.ds") @ConfigurationProperties(prefix = "jdbc.ds")
public DataSource readDataSource() { public DataSource readDataSource() {
return new DruidDataSource(); return new DruidDataSource();
} }*/
} }
package com.dlbridge.jadp.config.filter;
import com.alibaba.csp.sentinel.Entry;
import com.alibaba.csp.sentinel.EntryType;
import com.alibaba.csp.sentinel.SphU;
import com.alibaba.csp.sentinel.Tracer;
import com.alibaba.csp.sentinel.adapter.servlet.callback.RequestOriginParser;
import com.alibaba.csp.sentinel.adapter.servlet.callback.UrlCleaner;
import com.alibaba.csp.sentinel.adapter.servlet.callback.WebCallbackManager;
import com.alibaba.csp.sentinel.adapter.servlet.util.FilterUtil;
import com.alibaba.csp.sentinel.context.ContextUtil;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.dlbridge.jadp.config.sentinel.RestfulUrlCleaner;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.HandlerExecutionChain;
import org.springframework.web.servlet.HandlerMapping;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
//@Service
@Slf4j
public class SpringCommonFilter implements Filter {
public final static String HTTP_METHOD_SPECIFY = "HTTP_METHOD_SPECIFY";
public final static String EXCLUDE_URLS = "EXCLUDE_URLS";
private final static String COLON = ":";
private final static String ROOT_PATH = "/";
private boolean httpMethodSpecify = false;
private List<String> excludeUrls = Arrays.asList("/static/**","**.jpg","**.css");
private Map<HandlerMethod,String> handlerMethodUrlMap = new ConcurrentHashMap<>(32);
@Autowired
private DispatcherServlet dispatcherServlet;
private AntPathMatcher antPathMatcher = new AntPathMatcher();
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest)request;
HttpServletResponse httpServletResponse = (HttpServletResponse)response;
String originalTarget = FilterUtil.filterTarget(httpServletRequest);
if(excludeUrls.stream().anyMatch(url-> antPathMatcher.match(url,originalTarget))){
chain.doFilter(request,response);
return;
}
Entry entry = null;
Entry methodEntry = null;
try {
String target = this.resolveTarget(httpServletRequest);
// Parse the request origin using registered origin parser.
String origin = parseOrigin(httpServletRequest);
ContextUtil.enter(target, origin);
entry = SphU.entry(target, EntryType.IN);
// Add method specification if necessary
if (httpMethodSpecify) {
methodEntry = SphU.entry(httpServletRequest.getMethod().toUpperCase() + COLON + target, EntryType.IN);
}
chain.doFilter(request, response);
} catch (BlockException e) {
// Return the block page, or redirect to another URL.
WebCallbackManager.getUrlBlockHandler().blocked(httpServletRequest, httpServletResponse, e);
} catch (IOException e2) {
Tracer.trace(e2);
throw e2;
} catch (ServletException e3) {
Tracer.trace(e3);
throw e3;
} catch (RuntimeException e4) {
Tracer.trace(e4);
throw e4;
} finally {
if (methodEntry != null) {
methodEntry.exit();
}
if (entry != null) {
entry.exit();
}
ContextUtil.exit();
}
}
/**
* Use Spring Mvc principle that searching the best matching HandlerMethod(aka. Controller Method)
* 使用SpringMVC的查询Handler机制,查找合适的`HandlerMethod`
* @param request servlet http request
* @return
*/
protected String resolveTarget(HttpServletRequest request) {
String target = FilterUtil.filterTarget(request);
String pattern = "";
for (HandlerMapping mapping : dispatcherServlet.getHandlerMappings()) {
HandlerExecutionChain handler = null;
try {
handler = mapping.getHandler(request);
// handler hit, then resolve resource name from Controller and it's Controller method
if (handler != null) {
Object handlerObject = handler.getHandler();
if (handlerObject instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod)handlerObject;
//use it as cache
pattern = handlerMethodUrlMap.getOrDefault(handlerMethod,"");
if(StringUtils.isEmpty(pattern)){
//提取Controller方法上的注解值,拼装成Pattern
pattern = resolveResourceNameHandlerMethod(handlerMethod);
handlerMethodUrlMap.put(handlerMethod,pattern);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
// Clean and unify the URL.
// For REST APIs, you have to clean the URL (e.g. `/foo/1` and `/foo/2` -> `/foo/:id`), or
// the amount of context and resources will exceed the threshold.
UrlCleaner urlCleaner = WebCallbackManager.getUrlCleaner();
if (urlCleaner != null) {
if(StringUtils.isNotEmpty(pattern) && urlCleaner instanceof RestfulUrlCleaner){
RestfulUrlCleaner restfulUrlCleaner = (RestfulUrlCleaner)urlCleaner;
target = restfulUrlCleaner.clean(target,pattern);
}else{
target = urlCleaner.clean(target);
}
}
return target;
}
/**
* A HandlerMethod object usually represents a controller's method which is annotated with
*
* @param handlerMethod An object that represents an Controller's Method
* @return the resource name
* @RequestMapping ,@GetMapping , @PostMapping, @DeleteMapping and so on,
* so the resource can be represented with the controller's methods correspondingly.
* Although Controller's methods is not good option to represent Resources.
* As a result , the Annotations on Controllers and their methods can be introspected according to
* Spring original mechanisms.
* <p>
* The Resource should use following patterns:
* <Http_method>:<Controller-class-level-url-annotation><Controller-method-level-url-annotation>
*/
private String resolveResourceNameHandlerMethod(HandlerMethod handlerMethod) {
String target;
String typeMapping = "";
RequestMapping typeRequestMapping =
AnnotatedElementUtils.findMergedAnnotation(handlerMethod.getBeanType(), RequestMapping.class);
if (typeRequestMapping!=null && typeRequestMapping.value().length > 0) {
typeMapping = typeRequestMapping.value()[0];
}
RequestMapping methodRequestMapping =
AnnotatedElementUtils.findMergedAnnotation(handlerMethod.getMethod(), RequestMapping.class);
String methodMapping = methodRequestMapping.value()[0];
/* if (typeMapping.length() > 1 && typeMapping.endsWith(ROOT_PATH)) {
typeMapping = typeMapping.substring(0, typeMapping.length() - 1);
}*/
target = typeMapping + methodMapping;
return target;
}
@Override
public void init(FilterConfig filterConfig) {
httpMethodSpecify = Boolean.parseBoolean(filterConfig.getInitParameter(HTTP_METHOD_SPECIFY));
String excludeUrlsString = filterConfig.getInitParameter(EXCLUDE_URLS);
if(!StringUtils.isEmpty(excludeUrlsString)){
excludeUrls = Arrays.asList(excludeUrlsString.split(","));
}
}
private String parseOrigin(HttpServletRequest request) {
RequestOriginParser originParser = WebCallbackManager.getRequestOriginParser();
String origin = EMPTY_ORIGIN;
if (originParser != null) {
origin = originParser.parseOrigin(request);
if (StringUtil.isEmpty(origin)) {
return EMPTY_ORIGIN;
}
}
return origin;
}
@Override
public void destroy() {
}
private static final String EMPTY_ORIGIN = "";
}
\ No newline at end of file
package com.dlbridge.jadp.config.sentinel;
import com.alibaba.csp.sentinel.adapter.servlet.callback.UrlBlockHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.google.gson.Gson;
import com.neusoft.www.utils.web.Result;
import org.springframework.context.annotation.Configuration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Configuration
public class CommonLimitRateBlocked implements UrlBlockHandler {
@Override
public void blocked(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, BlockException e) throws IOException {
httpServletResponse.setHeader("Content-Type","application/json;charset=UTF-8");
Result result = Result.fail().setMsg("限流无法访问,请稍后再试!");
//如果加了转义符号看不明白
//使用类创建就json对象
httpServletResponse.getWriter().write(new Gson().toJson(result));
}
}
package com.dlbridge.jadp.config.sentinel;
import com.alibaba.csp.sentinel.adapter.servlet.callback.UrlCleaner;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RestfulUrlCleaner implements UrlCleaner {
public static final String ROOT_PATH = "/";
private Set<String> skipSet = new HashSet<>();
private static final Pattern pathVariable = Pattern.compile("\\{(\\w+)\\}");
public RestfulUrlCleaner() {
}
public RestfulUrlCleaner(Set<String> skipSet) {
this.skipSet = skipSet;
}
/***
* <p>Process the url. Some path variables should be handled and unified.</p>
* <p>e.g. collect_item_relation--10200012121-.html will be converted to collect_item_relation.html</p>
*
* @param originUrl original url
* @return processed url
*/
@Override
public String clean(String originUrl) {
return originUrl;
}
/***
* 根据restful接口类型,进行清空
* url的格式: /api/{tenantId}/name/{transactionId}
* 提取变量信息,然后确定哪些应该被替换,当前采用的默认策略是租户编号被替换,而营销订单ID不被替换
* @param originUrl original url
* @param pattern 匹配的pattern
* @return processed url
*/
public String clean(String originUrl, String pattern) {
if (originUrl.startsWith(ROOT_PATH)) {
originUrl = originUrl.substring(1);
}
if (pattern.startsWith(ROOT_PATH)) {
pattern = pattern.substring(1);
}
String[] original = originUrl.split(ROOT_PATH);
String[] patternArray = pattern.split(ROOT_PATH);
if (original.length != patternArray.length) {
return originUrl;
}
Matcher matcher;
StringBuilder replacedUrl = new StringBuilder();
for (int i = 0; i < patternArray.length; i++) {
replacedUrl.append(ROOT_PATH);
matcher = pathVariable.matcher(patternArray[i]);
if (matcher.matches() && skipSet.contains(matcher.group(1))) {
replacedUrl.append(matcher.group(0));
} else {
replacedUrl.append(original[i]);
}
}
return replacedUrl.toString();
}
public static void main(String[] args) {
HashSet<String> set = new HashSet<>();
// set.add("tenantId");
set.add("transactionId");
// set.add("activityId");
RestfulUrlCleaner restfulUrlCleaner = new RestfulUrlCleaner(set);
String result = restfulUrlCleaner
.clean("/api/00001234/A1224455/44433344566", "/api/{tenantId}/{activityId}/{transactionId}");
System.out.println(result);
}
}
\ No newline at end of file
package com.dlbridge.jadp.config.sentinel;
import com.alibaba.cloud.sentinel.SentinelProperties;
import com.alibaba.csp.sentinel.adapter.servlet.callback.UrlCleaner;
import com.dlbridge.jadp.config.filter.SpringCommonFilter;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import java.util.*;
import static com.dlbridge.jadp.config.filter.SpringCommonFilter.HTTP_METHOD_SPECIFY;
@Log4j2
@Configuration
@EnableConfigurationProperties(SentinelProperties.class)
public class SentinelAutoConfiguration {
/**
* spring.cloud.sentinel.pathvariable.skip.list
*/
@Value("${spring.cloud.sentinel.skip-keys}")
private String SKIP_LIST_KEY;
/**
* spring.cloud.sentinel.excludeUrls
*/
@Value("${spring.cloud.sentinel.exclude-urls}")
private String EXCLUDE_URLS;
@Bean
@ConditionalOnProperty(name = {"spring.cloud.sentinel.filter.enabled"}, havingValue = "false")
@ConditionalOnBean(SentinelProperties.class)
public FilterRegistrationBean sentinelFilter(SentinelProperties properties, SpringCommonFilter springCommonFilter, ApplicationContext applicationContext) {
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean();
SentinelProperties.Filter filterConfig = properties.getFilter();
if (filterConfig.getUrlPatterns() == null || filterConfig.getUrlPatterns().isEmpty()) {
List<String> defaultPatterns = new ArrayList();
defaultPatterns.add("/*");
filterConfig.setUrlPatterns(defaultPatterns);
}
registration.addUrlPatterns((String[])filterConfig.getUrlPatterns().toArray(new String[0]));
registration.setFilter(springCommonFilter);
Map<String,String> parameters = new HashMap<>();
parameters.put(HTTP_METHOD_SPECIFY,"false");
parameters.put(EXCLUDE_URLS,applicationContext.getEnvironment().getProperty(EXCLUDE_URLS, ""));
registration.setInitParameters(parameters);
registration.setOrder(filterConfig.getOrder());
log.info("[Sentinel Starter] register Sentinel with urlPatterns: {}.", filterConfig.getUrlPatterns());
return registration;
}
@Bean
public SpringCommonFilter springCommonFilter(ApplicationContext applicationContext) {
return new SpringCommonFilter();
}
@Bean
@ConditionalOnMissingBean
public UrlCleaner urlCleaner(ApplicationContext applicationContext) {
String[] skipList = SKIP_LIST_KEY.split(",");
Set<String> skipSet = new HashSet<>();
skipSet.addAll(Arrays.asList(skipList));
return new RestfulUrlCleaner(skipSet);
}
}
\ No newline at end of file
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
start_time, start_time,
logo, logo,
bg_color, bg_color,
cmpt_type,
create_by, create_by,
create_date, create_date,
update_by, update_by,
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
#{startTime}, #{startTime},
#{logo}, #{logo},
#{cmptbgColor}, #{cmptbgColor},
#{cmptType},
#{createBy}, #{createBy},
#{createDate}, #{createDate},
#{updateBy}, #{updateBy},
...@@ -159,7 +161,10 @@ ...@@ -159,7 +161,10 @@
cmpt_name = #{cmptName}, cmpt_name = #{cmptName},
</if> </if>
<if test="startTime != null"> <if test="startTime != null">
start_time = #{startTime} start_time = #{startTime},
</if>
<if test="cmptType != null">
cmpt_type = #{cmptType}
</if> </if>
</set> </set>
where cmpt_id = #{cmptId} where cmpt_id = #{cmptId}
...@@ -195,8 +200,8 @@ ...@@ -195,8 +200,8 @@
<select id="getCmptFromEnroll" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt"> <select id="getCmptFromEnroll" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
select cmptName,date_format(startTime,'%Y-%m-%d %H:%i:%s') startTime, select cmptName,date_format(startTime,'%Y-%m-%d %H:%i:%s') startTime,
date_format(ifnull(endTime,now()),'%Y-%m-%d %H:%i:%s') endTime from date_format(ifnull(endTime,now()),'%Y-%m-%d %H:%i:%s') endTime,type cmptType
common.neucmpt a inner join raceenroll.competition b on a.gcmptid = b.cmptid from common.neucmpt a inner join raceenroll.competition b on a.gcmptid = b.cmptid
where a.gtcmptid=#{cmptid} where a.gtcmptid=#{cmptid}
</select> </select>
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
select id,cmptId,rule_id as ruleId,mark_no as markNo,subsectionTime,subsectionscore,subsectionMileage,cmptPace from gk_cmpt_score_rule_scoreinfo where cmptId=#{cmptId} and mark_no=#{markNo} and checkStatus=1 and isDelete=0 select id,cmptId,rule_id as ruleId,mark_no as markNo,subsectionTime,subsectionscore,subsectionMileage,cmptPace from gk_cmpt_score_rule_scoreinfo where cmptId=#{cmptId} and mark_no=#{markNo} and checkStatus=1 and isDelete=0
</select> </select>
<select id="getCmptScoreRuleScoreInfoIdByruleIdAndMarkNo" resultType="Integer"> <select id="getCmptScoreRuleScoreInfoIdByruleIdAndMarkNo" resultType="Integer">
select id from gk_cmpt_score_rule_scoreinfo where cmptId=#{cmptId} and rule_id=#{ruleId} and mark_no=#{markNo} and isDelete=0 select id from gk_cmpt_score_rule_scoreinfo where cmptId=#{cmptId} and rule_id=#{ruleId}
and mark_no=#{markNo} and isDelete=0 limit 1
</select> </select>
<select id="getCmptScoreRuleScoreInfoToalNumer" resultType="int"> <select id="getCmptScoreRuleScoreInfoToalNumer" resultType="int">
select count(1) from geerunner.cmpt_enroll as a left join gk_cmpt_score_rule_scoreinfo as b on a.cmpt_id=b.cmptId and a.nick_id=b.mark_no where a.cmpt_id=#{cmptId} and a.cmpt_item=#{roadId} and rule_id=#{ruleId} and checkStatus=#{checkStatus} and a.del_flg=0 and b.isDelete=0 select count(1) from geerunner.cmpt_enroll as a left join gk_cmpt_score_rule_scoreinfo as b on a.cmpt_id=b.cmptId and a.nick_id=b.mark_no where a.cmpt_id=#{cmptId} and a.cmpt_item=#{roadId} and rule_id=#{ruleId} and checkStatus=#{checkStatus} and a.del_flg=0 and b.isDelete=0
......
package com.dlbridge.jadp.plugins.cmpt.dao.model; package com.dlbridge.jadp.plugins.cmpt.dao.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.dlbridge.jadp.common.persistence.JaapRecord;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.ibatis.type.Alias;
import org.hibernate.validator.constraints.Length;
import com.dlbridge.jadp.common.persistence.JaapRecord;
/** /**
* 赛事表 * 赛事表
...@@ -35,5 +31,8 @@ public class Cmpt extends JaapRecord<Cmpt> { ...@@ -35,5 +31,8 @@ public class Cmpt extends JaapRecord<Cmpt> {
private String startTime; private String startTime;
@ApiModelProperty(value = "赛事结束时间", notes = "赛事结束时间") @ApiModelProperty(value = "赛事结束时间", notes = "赛事结束时间")
private String endTime; private String endTime;
private boolean isDayRank; private boolean isDayRank;
private int cmptType;
} }
...@@ -61,6 +61,10 @@ public class CmptService { ...@@ -61,6 +61,10 @@ public class CmptService {
localCmpt.setStartTime(cmpt.getStartTime()); localCmpt.setStartTime(cmpt.getStartTime());
update(localCmpt); update(localCmpt);
} }
if(cmpt.getCmptType() != localCmpt.getCmptType()){
localCmpt.setCmptType(cmpt.getCmptType());
update(localCmpt);
}
localCmpt.setEndTime(cmpt.getEndTime()); localCmpt.setEndTime(cmpt.getEndTime());
return localCmpt; return localCmpt;
......
...@@ -16,7 +16,7 @@ import java.util.*; ...@@ -16,7 +16,7 @@ import java.util.*;
@Controller @Controller
@Log4j2 @Log4j2
@RequestMapping("gk/auto") @RequestMapping("gk/auto/")
@ApiIgnore @ApiIgnore
public class AutoScoreController { public class AutoScoreController {
......
...@@ -4,7 +4,6 @@ package com.dlbridge.jadp.plugins.cmpt.web; ...@@ -4,7 +4,6 @@ package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView; import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.job.CountJob; import com.dlbridge.jadp.job.CountJob;
import com.dlbridge.jadp.plugins.cmpt.bean.Banner; import com.dlbridge.jadp.plugins.cmpt.bean.Banner;
import com.dlbridge.jadp.plugins.cmpt.bean.Equipment;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt; import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.BannerService; import com.dlbridge.jadp.plugins.cmpt.service.BannerService;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService; import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
...@@ -14,14 +13,13 @@ import org.springframework.stereotype.Controller; ...@@ -14,14 +13,13 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@Controller @Controller
@RequestMapping("gk/banner") @RequestMapping("gk/banner/")
public class BannerController { public class BannerController {
@Resource @Resource
......
...@@ -20,7 +20,7 @@ import java.util.HashMap; ...@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
@Controller @Controller
@RequestMapping(value = "/api/cmptScoreRule") @RequestMapping(value = "/api/cmptScoreRule/")
@Log4j2 @Log4j2
public class CmptScoreRuleController { public class CmptScoreRuleController {
......
package com.dlbridge.jadp.plugins.cmpt.web; package com.dlbridge.jadp.plugins.cmpt.web;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.dlbridge.jadp.common.interceptor.PageView; import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.bean.CmptSettingTemplate; import com.dlbridge.jadp.plugins.cmpt.bean.CmptSettingTemplate;
import com.dlbridge.jadp.plugins.cmpt.bean.FuncSetting; import com.dlbridge.jadp.plugins.cmpt.bean.FuncSetting;
import com.dlbridge.jadp.plugins.cmpt.bean.Road; import com.dlbridge.jadp.plugins.cmpt.bean.Road;
import com.dlbridge.jadp.plugins.cmpt.bean.SettingTemplate; import com.dlbridge.jadp.plugins.cmpt.bean.SettingTemplate;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.dao.model.CmptSetting;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Manual; import com.dlbridge.jadp.plugins.cmpt.dao.model.Manual;
import com.dlbridge.jadp.plugins.cmpt.service.*; import com.dlbridge.jadp.plugins.cmpt.service.*;
import com.neusoft.www.utils.web.RequestParamHelper;
import com.neusoft.www.utils.web.Result; import com.neusoft.www.utils.web.Result;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt; import org.springframework.web.bind.annotation.ResponseBody;
import com.dlbridge.jadp.plugins.cmpt.dao.model.CmptSetting;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* 赛事活动controller * 赛事活动controller
...@@ -36,7 +31,7 @@ import sun.misc.BASE64Decoder; ...@@ -36,7 +31,7 @@ import sun.misc.BASE64Decoder;
* @author zy * @author zy
*/ */
@Controller @Controller
@RequestMapping(value = "gk/cmpt/cmptSetting") @RequestMapping(value = "gk/cmpt/cmptSetting/")
@ApiIgnore @ApiIgnore
public class CmptSettingController { public class CmptSettingController {
......
...@@ -37,7 +37,7 @@ import java.util.*; ...@@ -37,7 +37,7 @@ import java.util.*;
* @author zy * @author zy
*/ */
@Controller @Controller
@RequestMapping(value = "/admin/cmpt/cmptWechart") @RequestMapping(value = "/admin/cmpt/cmptWechart/")
@ApiIgnore @ApiIgnore
public class CmptWechartController { public class CmptWechartController {
......
...@@ -15,7 +15,7 @@ import org.springframework.web.servlet.ModelAndView; ...@@ -15,7 +15,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import javax.annotation.Resource;
@Controller @Controller
@RequestMapping("gk/customer") @RequestMapping("gk/customer/")
public class CustomerController { public class CustomerController {
@Resource @Resource
private CmptService cmptService; private CmptService cmptService;
......
...@@ -31,7 +31,7 @@ import sun.rmi.runtime.Log; ...@@ -31,7 +31,7 @@ import sun.rmi.runtime.Log;
@Log4j2 @Log4j2
@Controller @Controller
@RequestMapping(value = "gk/cmpt/manual") @RequestMapping(value = "gk/cmpt/manual/")
@ApiIgnore @ApiIgnore
public class ManualController { public class ManualController {
......
...@@ -17,7 +17,7 @@ import java.util.Collections; ...@@ -17,7 +17,7 @@ import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@RestController("api") @RestController("api/")
@Api(tags = "多次提交成绩版本") @Api(tags = "多次提交成绩版本")
public class MicroApiExtendController { public class MicroApiExtendController {
......
...@@ -26,7 +26,7 @@ import java.util.*; ...@@ -26,7 +26,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Controller @Controller
@RequestMapping(value = "gk/cmpt/nameList") @RequestMapping(value = "gk/cmpt/nameList/")
@ApiIgnore @ApiIgnore
@Log4j2 @Log4j2
public class NameListController { public class NameListController {
......
...@@ -5,9 +5,7 @@ import com.dlbridge.jadp.plugins.cmpt.bean.Album; ...@@ -5,9 +5,7 @@ import com.dlbridge.jadp.plugins.cmpt.bean.Album;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt; import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService; import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import com.dlbridge.jadp.plugins.cmpt.service.PhotoService; import com.dlbridge.jadp.plugins.cmpt.service.PhotoService;
import com.dlbridge.jadp.plugins.cmpt.utils.Base64Utils;
import com.neusoft.www.utils.web.Result; import com.neusoft.www.utils.web.Result;
import org.apache.commons.codec.binary.Base64;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,7 +17,7 @@ import javax.annotation.Resource; ...@@ -19,7 +17,7 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
@Controller @Controller
@RequestMapping("/gk/photo") @RequestMapping("/gk/photo/")
public class PhotoController { public class PhotoController {
@Resource @Resource
......
...@@ -4,9 +4,9 @@ import com.dlbridge.feign.GeexekScoreService; ...@@ -4,9 +4,9 @@ import com.dlbridge.feign.GeexekScoreService;
import com.dlbridge.feign.bean.CmptScoreCheckpoint; import com.dlbridge.feign.bean.CmptScoreCheckpoint;
import com.dlbridge.jadp.common.interceptor.PageView; import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.bean.Road; import com.dlbridge.jadp.plugins.cmpt.bean.Road;
import com.dlbridge.jadp.plugins.cmpt.bean.RoadsGpsCheckpointMap;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt; import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.*; import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import com.dlbridge.jadp.plugins.cmpt.service.RemoteService;
import com.dlbridge.jadp.plugins.cmpt.utils.QRCodeUtil; import com.dlbridge.jadp.plugins.cmpt.utils.QRCodeUtil;
import com.neusoft.www.utils.web.Result; import com.neusoft.www.utils.web.Result;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -20,7 +20,6 @@ import springfox.documentation.annotations.ApiIgnore; ...@@ -20,7 +20,6 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
...@@ -35,7 +34,7 @@ import java.util.zip.ZipOutputStream; ...@@ -35,7 +34,7 @@ import java.util.zip.ZipOutputStream;
@Controller @Controller
@Log4j2 @Log4j2
@RequestMapping("gk/scan") @RequestMapping("gk/scan/")
@ApiIgnore @ApiIgnore
public class ScanController { public class ScanController {
......
package com.dlbridge.jadp.plugins.cmpt.web; package com.dlbridge.jadp.plugins.cmpt.web;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@Log4j2 @Log4j2
@RefreshScope
public class TestController { public class TestController {
@Value("${server.port}") @Value("${server.port}")
private String port; private String port;
@RequestMapping("/api/test") /**
@ResponseBody * spring.cloud.sentinel.pathvariable.skip.list
public String test(){ */
log.info(port); @Value("${spring.cloud.sentinel.skip-keys}")
return port; private String SKIP_LIST_KEY;
}
@RequestMapping("/gksite/test") @RequestMapping("/gksite/test")
@ResponseBody @ResponseBody
@SentinelResource(value = "gksite/test")
public String gksite(){ public String gksite(){
log.info(port); log.info(port);
return port; return SKIP_LIST_KEY;
} }
} }
jdbc.ds.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
jdbc.type=mysql spring.datasource.password=geexekNewPass4!
jdbc.ds.url=jdbc:mysql://47.111.166.211:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false spring.datasource.username=geexek
jdbc.ds.username=geexek spring.datasource.driver-class-name=com.mysql.jdbc.Driver
jdbc.ds.password=geexekNewPass4! spring.datasource.url=jdbc:mysql://47.111.166.211:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
jdbc.ds.driver-class-name=com.mysql.jdbc.Driver
mybatis.typeAliasesPackage=com.dlbridge.jadp.plugins mybatis.typeAliasesPackage=com.dlbridge.jadp.plugins
mybatis.mapperLocations=classpath:com/dlbridge/jadp/plugins/**/**.xml mybatis.mapperLocations=classpath:com/dlbridge/jadp/plugins/**/**.xml
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
...@@ -65,10 +64,9 @@ spring.servlet.multipart.max-file-size=10Mb ...@@ -65,10 +64,9 @@ spring.servlet.multipart.max-file-size=10Mb
spring.servlet.multipart.enabled=true spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-request-size=50Mb spring.servlet.multipart.max-request-size=50Mb
spring.application.name=micro-gksite spring.application.name=micro-gksite
spring.cloud.nacos.server-addr=http://nacos.geexek.com.cn
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
spring.cloud.nacos.discovery.namespace=dev
spring.cloud.nacos.discovery.group=dev
#feign调用连接超时时间 #feign调用连接超时时间
feign.client.config.default.connect-timeout=30000 feign.client.config.default.connect-timeout=30000
#feign调用读取超时时间 #feign调用读取超时时间
...@@ -79,14 +77,10 @@ feign.okhttp.enabled=true ...@@ -79,14 +77,10 @@ feign.okhttp.enabled=true
#feign.hystrix.enabled=true #feign.hystrix.enabled=true
feign.sentinel.enabled=true feign.sentinel.enabled=true
#sentinel
spring.cloud.sentinel.transport.dashboard=http://localhost:9948
spring.cloud.sentinel.transport.port=8719
hystrix.metrics.enabled=true hystrix.metrics.enabled=true
hystrix.command.default.execution.timeout.enabled=false hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=5000 hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=5000
hystrix.
logging.level.com.dlbridge.feign.NewsService=debug logging.level.com.dlbridge.feign.NewsService=debug
logging.level.org.springframework.cloud.openfeign=debug logging.level.org.springframework.cloud.openfeign=debug
spring.zipkin.base-url=http://zipkin.geexek.com.cn spring.zipkin.base-url=http://zipkin.geexek.com.cn
...@@ -94,3 +88,21 @@ spring.zipkin.sender.type=web ...@@ -94,3 +88,21 @@ spring.zipkin.sender.type=web
spring.sleuth.sampler.probability=1 spring.sleuth.sampler.probability=1
swagger.enable=true swagger.enable=true
#spring.cloud.sentinel.servlet.blockPage=test
spring.cloud.sentinel.transport.dashboard=http://localhost:9948
spring.cloud.sentinel.transport.port=8719
spring.cloud.sentinel.eager=true
spring.cloud.sentinel.filter.enabled=false
spring.cloud.sentinel.skip-keys=cmptId
spring.cloud.sentinel.exclude-urls=/static/**,**.css,**.js
## nacos 地址
spring.cloud.sentinel.datasource.ds.nacos.server-addr=192.168.43.254:8848
spring.cloud.sentinel.datasource.ds.nacos.dataId=micro-gksite-sentinel
spring.cloud.sentinel.datasource.ds.nacos.data-type=json
spring.cloud.sentinel.datasource.ds.nacos.groupId=dev
#spring.cloud.sentinel.datasource.ds1.nacos.namespace=fad8a39-a3e7-49a1-ae96-0f7aaf39136b
#
## 规则类型
spring.cloud.sentinel.datasource.ds.nacos.rule-type=flow
jdbc.ds.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
jdbc.type=mysql spring.datasource.password=mysql_master_geexek_408
jdbc.ds.url=jdbc:mysql://rm-bp15ojs1ys1eur32zwo.mysql.rds.aliyuncs.com:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true spring.datasource.username=mysql_master
jdbc.ds.username=mysql_master spring.datasource.driver-class-name=com.mysql.jdbc.Driver
jdbc.ds.password=mysql_master_geexek_408 spring.datasource.url=jdbc:mysql://rm-bp15ojs1ys1eur32zwo.mysql.rds.aliyuncs.com:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc.ds.driver-class-name=com.mysql.jdbc.Driver
mybatis.typeAliasesPackage=com.dlbridge.jadp.plugins mybatis.typeAliasesPackage=com.dlbridge.jadp.plugins
mybatis.mapperLocations=classpath:com/dlbridge/jadp/**/**.xml mybatis.mapperLocations=classpath:com/dlbridge/jadp/**/**.xml
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
......
jdbc.ds.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
jdbc.type=mysql spring.datasource.password=geexekNewPass4!
jdbc.ds.url=jdbc:mysql://172.16.214.238:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true spring.datasource.username=geexek
jdbc.ds.username=geexek spring.datasource.driver-class-name=com.mysql.jdbc.Driver
jdbc.ds.password=geexekNewPass4! spring.datasource.url=jdbc:mysql://47.111.166.211:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
jdbc.ds.driver-class-name=com.mysql.jdbc.Driver
mybatis.typeAliasesPackage=com.dlbridge.jadp.plugins mybatis.typeAliasesPackage=com.dlbridge.jadp.plugins
mybatis.mapperLocations=classpath:com/dlbridge/jadp/**/**.xml mybatis.mapperLocations=classpath:com/dlbridge/jadp/**/**.xml
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
...@@ -55,8 +54,7 @@ spring.servlet.multipart.max-file-size=1500Mb ...@@ -55,8 +54,7 @@ spring.servlet.multipart.max-file-size=1500Mb
spring.servlet.multipart.enabled=true spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-request-size=50Mb spring.servlet.multipart.max-request-size=50Mb
spring.application.name=micro-gksite spring.application.name=micro-gksite
spring.cloud.nacos.server-addr=http://nacos.geexek.com.cn
spring.cloud.nacos.discovery.group=test
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
#feign调用连接超时时间 #feign调用连接超时时间
feign.client.config.default.connect-timeout=1000 feign.client.config.default.connect-timeout=1000
...@@ -78,5 +76,28 @@ logging.level.com.dlbridge.feign.NewsService=debug ...@@ -78,5 +76,28 @@ logging.level.com.dlbridge.feign.NewsService=debug
logging.level.org.springframework.cloud.openfeign=debug logging.level.org.springframework.cloud.openfeign=debug
spring.zipkin.base-url=http://zipkin.geexke.com.cn spring.zipkin.base-url=http://zipkin.geexke.com.cn
spring.zipkin.sender.type=web spring.zipkin.sender.type=web
spring.sleuth.sampler.probability=0.1 spring.sleuth.sampler.probability=0.1
swagger.enable=true swagger.enable=true
\ No newline at end of file
spring.cloud.nacos.server-addr=http://nacos.geexek.com.cn
spring.cloud.nacos.discovery.group=test
#spring.cloud.sentinel.servlet.blockPage=test
spring.cloud.sentinel.transport.dashboard=http://sentinel.geexek.com.cn
spring.cloud.sentinel.transport.port=8719
spring.cloud.sentinel.eager=true
spring.cloud.sentinel.filter.enabled=false
spring.cloud.sentinel.skip-keys=cmptId
spring.cloud.sentinel.exclude-urls=/static/**,**.css,**.js
## nacos 地址
spring.cloud.sentinel.datasource.ds.nacos.server-addr=http://nacos.geexek.com.cn
spring.cloud.sentinel.datasource.ds.nacos.dataId=micro-gksite-sentinel
spring.cloud.sentinel.datasource.ds.nacos.data-type=json
spring.cloud.sentinel.datasource.ds.nacos.groupId=test
#spring.cloud.sentinel.datasource.ds1.nacos.namespace=fad8a39-a3e7-49a1-ae96-0f7aaf39136b
#
## 规则类型
spring.cloud.sentinel.datasource.ds.nacos.rule-type=flow
\ No newline at end of file
---
spring:
profiles: dev
cloud:
nacos:
config:
server-addr: http://192.168.43.254:8848
file-extension: properties
group: dev
namespace: 7fad8a39-a3e7-49a1-ae96-0f7aaf39136b
server-addr: http://192.168.43.254:8848
discovery:
group: dev
namespace: 7fad8a39-a3e7-49a1-ae96-0f7aaf39136b
---
spring:
profiles: test
cloud:
nacos:
config:
server-addr: http://nacos.geexek.com.cn
file-extension: properties
group: test
namespace: adbadd76-45e9-4214-9ffc-1aadfb1c5039
server-addr: http://nacos.geexek.com.cn
discovery:
group: test
namespace: adbadd76-45e9-4214-9ffc-1aadfb1c5039
---
spring:
profiles: production
cloud:
nacos:
config:
server-addr: http://nacos.geexek.com
file-extension: properties
group: production
namespace: 73e0758d-52b9-4fcc-90ef-139495455c25
server-addr: http://nacos.geexek.com
discovery:
group: production
namespace: 73e0758d-52b9-4fcc-90ef-139495455c25
\ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
getCharts(); getCharts();
function getCharts() { function getCharts() {
$.ajax({ $.ajax({
url : 'http://localhost:8081/geexekscore/api/v1/cmpt-score-rule-scoreinfo/scoreStatistic?cmptId='+getCId(), url : 'http://testzs.geexek.com.cn/geexekscore/api/v1/cmpt-score-rule-scoreinfo/scoreStatistic?cmptId='+getCId(),
success:function (data) { success:function (data) {
var roads = data.data; var roads = data.data;
var roadNames = []; var roadNames = [];
......
...@@ -122,7 +122,7 @@ var score = new Vue({ ...@@ -122,7 +122,7 @@ var score = new Vue({
return ; return ;
} }
$.ajax({ $.ajax({
url:"http://localhost:8081/geexekscore/api/v1/cmpt-score-rule-scoreinfo/getCmptScoreRuleScoreDetails?scoreId="+id, url:"http://testzs.geexek.com.cn/geexekscore/api/v1/cmpt-score-rule-scoreinfo/getCmptScoreRuleScoreDetails?scoreId="+id,
success:function (data) { success:function (data) {
if(data.code == 1){ if(data.code == 1){
if(data.data.length == 0){ if(data.data.length == 0){
...@@ -181,7 +181,7 @@ var reviewPage = { ...@@ -181,7 +181,7 @@ var reviewPage = {
score.$data.param.origin = score.$data.selectedOrigin; score.$data.param.origin = score.$data.selectedOrigin;
score.$data.param.keyword = score.$data.searchWord; score.$data.param.keyword = score.$data.searchWord;
$.ajax({ $.ajax({
url : 'http://localhost:8081/geexekscore/api/v1/cmpt-score-rule-scoreinfo/getCmptScoreRuleScoreInfo', url : 'http://testzs.geexek.com.cn/geexekscore/api/v1/cmpt-score-rule-scoreinfo/getCmptScoreRuleScoreInfo',
data:score.$data.param, data:score.$data.param,
type:'post', type:'post',
beforeSend:function(){ beforeSend:function(){
...@@ -214,7 +214,7 @@ var reviewPage = { ...@@ -214,7 +214,7 @@ var reviewPage = {
}, },
getStatistic:function(){ getStatistic:function(){
$.ajax({ $.ajax({
url : 'http://localhost:8081/geexekscore/api/v1/cmpt-score-rule-scoreinfo/getCmptScoreRuleScoreInfoStatistics?cmptId='+getCId()+'&roadId='+ url : 'http://testzs.geexek.com.cn/geexekscore/api/v1/cmpt-score-rule-scoreinfo/getCmptScoreRuleScoreInfoStatistics?cmptId='+getCId()+'&roadId='+
score.$data.selectedRoadId score.$data.selectedRoadId
+'&origin='+ score.$data.selectedOrigin+"&keyword="+score.$data.searchWord, +'&origin='+ score.$data.selectedOrigin+"&keyword="+score.$data.searchWord,
type:'post', type:'post',
...@@ -250,7 +250,7 @@ var reviewPage = { ...@@ -250,7 +250,7 @@ var reviewPage = {
var param = {cmptId : getCId(),'checkstatus':score.$data.param.checkstatus, var param = {cmptId : getCId(),'checkstatus':score.$data.param.checkstatus,
roadId: score.$data.selectedRoadId,passedIds:passedIds.join(','),noPassedIds:noPassedIds.join(',')}; roadId: score.$data.selectedRoadId,passedIds:passedIds.join(','),noPassedIds:noPassedIds.join(',')};
$.ajax({ $.ajax({
url : 'http://localhost:8081/geexekscore/api/v1/cmpt-score-rule-scoreinfo/uploadCmptScoreRuleScoreInfo', url : 'http://testzs.geexek.com.cn/geexekscore/api/v1/cmpt-score-rule-scoreinfo/uploadCmptScoreRuleScoreInfo',
data: param, data: param,
beforeSend:function(){ beforeSend:function(){
layer.load(); layer.load();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment