Compare commits
25 Commits
integratio
...
master
Author | SHA1 | Date |
---|---|---|
huan.xu | 75cd1faf5e | 4 years ago |
huan.xu | e490449c58 | 4 years ago |
huan.xu | 2bff674480 | 4 years ago |
huan.xu | 5417d726d7 | 4 years ago |
fengyu.wang | a8e11b590d | 4 years ago |
fengyu.wang | bfb1a0cc76 | 4 years ago |
huan.xu | 332af212ff | 4 years ago |
huan.xu | 23927365bc | 4 years ago |
fengyu.wang | 96691ea013 | 4 years ago |
fengyu.wang | 26f71afade | 4 years ago |
fengyu.wang | 3306fb2473 | 4 years ago |
huan.xu | 9467cc4823 | 4 years ago |
fengyu.wang | cb783c3040 | 4 years ago |
huan.xu | a36cb7c7b5 | 4 years ago |
fengyu.wang | e8824d8b65 | 4 years ago |
fengyu.wang | 83e50a26a3 | 4 years ago |
fengyu.wang | 07a37581ba | 4 years ago |
fengyu.wang | 4f5b91fa82 | 4 years ago |
fengyu.wang | 6e43b3feb8 | 4 years ago |
unclekh | 4914c57520 | 4 years ago |
unclekh | 0961639ed1 | 4 years ago |
unclekh | fcc3fdaa84 | 4 years ago |
unclekh | aeec182834 | 4 years ago |
unclekh | 2298799078 | 4 years ago |
unclekh | 7c0c2cacb8 | 4 years ago |
79 changed files with 1105 additions and 223 deletions
@ -0,0 +1,22 @@ |
||||
package com.blockchain.server.btc.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author zijie |
||||
* @version 1.0 |
||||
* @className YyyyfMoneyFeign |
||||
* @description |
||||
* @date 2020-07-07 20:31 |
||||
*/ |
||||
@FeignClient("dapp-yyyf-server") |
||||
public interface YyyyfMoneyFeign { |
||||
|
||||
@GetMapping("/yyyfMoney/resetWallet") |
||||
ResultDTO<Boolean> resetWallet(@RequestParam("assessUserId") String assessUserId, @RequestParam("coinName") String coinName, @RequestParam("balance") BigDecimal balance); |
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.blockchain.server.eos.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author |
||||
* @version 1.0 |
||||
* @className YyyyfMoneyFeign |
||||
* @description |
||||
* @date 2020-07-07 20:31 |
||||
*/ |
||||
@FeignClient("dapp-yyyf-server") |
||||
public interface YyyyfMoneyFeign { |
||||
|
||||
@GetMapping("/yyyfMoney/resetWallet") |
||||
ResultDTO<Boolean> resetWallet(@RequestParam("assessUserId") String assessUserId, @RequestParam("coinName") String coinName, @RequestParam("balance") BigDecimal balance); |
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.blockchain.server.eth.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author |
||||
* @version 1.0 |
||||
* @className YyyyfMoneyFeign |
||||
* @description |
||||
* @date 2020-07-07 20:31 |
||||
*/ |
||||
@FeignClient("dapp-yyyf-server") |
||||
public interface YyyyfMoneyFeign { |
||||
|
||||
@GetMapping("/yyyfMoney/resetWallet") |
||||
ResultDTO<Boolean> resetWallet(@RequestParam("assessUserId") String assessUserId, @RequestParam("coinName") String coinName, @RequestParam("balance") BigDecimal balance); |
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.blockchain.server.otc.common.config; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor; |
||||
|
||||
@Component |
||||
public class ApplicationConfig { |
||||
@Bean |
||||
public ThreadPoolTaskExecutor executor() { |
||||
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); |
||||
threadPoolTaskExecutor.setCorePoolSize(5); |
||||
threadPoolTaskExecutor.setMaxPoolSize(10); |
||||
threadPoolTaskExecutor.setQueueCapacity(50); |
||||
threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy()); |
||||
threadPoolTaskExecutor.setThreadNamePrefix("executor-"); |
||||
return threadPoolTaskExecutor; |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.blockchain.server.otc.feign; |
||||
|
||||
import com.blockchain.common.base.dto.ResultDTO; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @author |
||||
* @version 1.0 |
||||
* @className YyyyfMoneyFeign |
||||
* @description |
||||
* @date 2020-07-07 20:31 |
||||
*/ |
||||
@FeignClient("dapp-yyyf-server") |
||||
public interface YyyyfMoneyFeign { |
||||
|
||||
@GetMapping("/yyyfMoney/resetWallet") |
||||
ResultDTO<Boolean> resetWallet(@RequestParam("assessUserId") String assessUserId, @RequestParam("coinName") String coinName, @RequestParam("balance") BigDecimal balance); |
||||
} |
@ -0,0 +1,47 @@ |
||||
package com.blockchain.server.yyyf.init; |
||||
|
||||
import com.blockchain.server.yyyf.service.AssessUserService; |
||||
|
||||
/** |
||||
* @author Mr.Xu |
||||
* @version 1.0 |
||||
* @className InitData |
||||
* @description |
||||
* @date 2020-05-06 15:42 |
||||
*/ |
||||
public class InitData { |
||||
private static InitData initData=null; |
||||
|
||||
public InitData(){ |
||||
|
||||
} |
||||
|
||||
|
||||
public static InitData getInstance(){ |
||||
synchronized (InitData.class){ |
||||
if(initData==null){ |
||||
initData=new InitData(); |
||||
} |
||||
} |
||||
return initData; |
||||
} |
||||
|
||||
|
||||
public void init(){ |
||||
initExamPaperDto(); |
||||
} |
||||
|
||||
/** |
||||
* @description 初始化试卷(项目)数据 |
||||
* @author Mr.Xu |
||||
* @date 2020-05-06 16:21:52 |
||||
* @param [] |
||||
* @return void |
||||
**/ |
||||
private void initExamPaperDto(){ |
||||
AssessUserService trainManageService= (AssessUserService) SpringContextUtil.getBean("assessUserService"); |
||||
trainManageService.initAllExamPaperDto(); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,33 @@ |
||||
package com.blockchain.server.yyyf.init; |
||||
|
||||
|
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.boot.ApplicationArguments; |
||||
import org.springframework.boot.ApplicationRunner; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
/** |
||||
* @author Mr.Xu |
||||
* @version 1.0 |
||||
* @className InitProject |
||||
* @description 初始化项目 |
||||
* @date 2020-05-06 16:16 |
||||
*/ |
||||
@Component |
||||
public class InitProject implements ApplicationRunner { |
||||
private static final Logger LOG = LoggerFactory.getLogger(InitProject.class); |
||||
|
||||
|
||||
@Override |
||||
public void run(ApplicationArguments args) throws Exception { |
||||
LOG.info("==========init project==========="); |
||||
try { |
||||
InitData.getInstance().init(); |
||||
LOG.info("============init data success============"); |
||||
} catch (Exception e) { |
||||
LOG.error("init data error={}", e.getMessage()); |
||||
} |
||||
|
||||
} |
||||
} |
@ -0,0 +1,59 @@ |
||||
package com.blockchain.server.yyyf.init; |
||||
|
||||
import org.springframework.beans.BeansException; |
||||
import org.springframework.context.ApplicationContext; |
||||
import org.springframework.context.ApplicationContextAware; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.web.context.request.RequestContextHolder; |
||||
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.servlet.http.HttpSession; |
||||
|
||||
@Component |
||||
public class SpringContextUtil implements ApplicationContextAware { |
||||
|
||||
// Spring应用上下文环境
|
||||
private static ApplicationContext applicationContext; |
||||
|
||||
/** |
||||
* 实现ApplicationContextAware接口的回调方法。设置上下文环境 |
||||
* |
||||
* @param applicationContext |
||||
*/ |
||||
public void setApplicationContext(ApplicationContext applicationContext) { |
||||
SpringContextUtil.applicationContext = applicationContext; |
||||
} |
||||
|
||||
/** |
||||
* @return ApplicationContext |
||||
*/ |
||||
public static ApplicationContext getApplicationContext() { |
||||
return applicationContext; |
||||
} |
||||
|
||||
/** |
||||
* 获取对象 |
||||
* |
||||
* @param name |
||||
* @return Object |
||||
* @throws BeansException |
||||
*/ |
||||
public static Object getBean(String name) throws BeansException { |
||||
return applicationContext.getBean(name); |
||||
} |
||||
public static <T> T getBean(Class<T> requiredType) throws BeansException { |
||||
return applicationContext.getBean(requiredType); |
||||
} |
||||
public static HttpServletRequest getHttpServletRequest() { |
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
} |
||||
public static HttpServletResponse getHttpServletResponse() { |
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); |
||||
} |
||||
public static HttpSession getHttpSession() { |
||||
HttpServletRequest request = getHttpServletRequest(); |
||||
return request.getSession(); |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.blockchain.server.yyyf.mapper; |
||||
|
||||
import com.blockchain.server.train.dto.ExamPaperDto; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* (TrainCaseManage)表数据库访问层 |
||||
* |
||||
* @author qianqian.zhang |
||||
* @since 2020-04-16 16:03:48 |
||||
*/ |
||||
@Repository |
||||
public interface TrainCaseManageMapper { |
||||
|
||||
|
||||
/** |
||||
* @description |
||||
* @author Mr.Xu |
||||
* @date 2020-05-06 15:50:51 |
||||
* @param [] |
||||
* @return void |
||||
**/ |
||||
|
||||
List<ExamPaperDto> getAllExamPaperDto(); |
||||
} |
@ -0,0 +1,36 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.blockchain.server.yyyf.mapper.TrainCaseManageMapper"> |
||||
|
||||
|
||||
<resultMap type="com.blockchain.server.train.dto.ExamPaperDto" id="ExamPaperDtoMap"> |
||||
<result property="id" column="id" jdbcType="VARCHAR"/> |
||||
<result property="name" column="name" jdbcType="VARCHAR"/> |
||||
<result property="type" column="type" jdbcType="INTEGER"/> |
||||
<result property="wechatInitMoney" column="wechat_init_money" jdbcType="DECIMAL"/> |
||||
<result property="alipayInitMoney" column="alipay_init_money" jdbcType="DECIMAL"/> |
||||
<result property="bankcardInitMoney" column="bankcard_init_money" jdbcType="DECIMAL"/> |
||||
<result property="digitwalletInitMoney" column="digitwallet_init_money" jdbcType="DECIMAL"/> |
||||
<collection property="trainCaseTargetList" javaType="list" ofType="com.blockchain.server.train.dto.TrainCaseTargetDto"> |
||||
<result property="id" column="case_target_id" jdbcType="VARCHAR"/> |
||||
<result property="name" column="target_name" jdbcType="VARCHAR"/> |
||||
<result property="taskOperate" column="task_operate" jdbcType="INTEGER"/> |
||||
<result property="taskRate" column="task_rate" jdbcType="DOUBLE"/> |
||||
<result property="taskScore" column="task_score" jdbcType="DOUBLE"/> |
||||
<result property="targetId" column="target_id" jdbcType="VARCHAR"/> |
||||
<result property="code" column="code" jdbcType="VARCHAR"/> |
||||
</collection> |
||||
</resultMap> |
||||
<select id="getAllExamPaperDto" resultMap="ExamPaperDtoMap"> |
||||
SELECT |
||||
cm.id ,cm.name,cm.type,cm.wechat_init_money,cm.alipay_init_money,cm.bankcard_init_money,cm.digitwallet_init_money,ct.id case_target_id,dt.name target_name,ct.task_rate,ct.task_score,ct.task_operate,dt.code,dt.id target_id |
||||
FROM |
||||
train_case_manage cm, |
||||
train_case_target ct, |
||||
train_dict_target dt |
||||
WHERE |
||||
cm.id = ct.case_id and ct.target_id=dt.id |
||||
AND cm.is_del = 0 |
||||
</select> |
||||
|
||||
</mapper> |
@ -1,4 +1,4 @@ |
||||
#分布式事务配置 |
||||
tm: |
||||
manager: |
||||
url: http://${redis-host}:7000/tx/manager/ |
||||
url: http://${tx-host}:7000/tx/manager/ |
||||
|
@ -0,0 +1,41 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>spring-cloud</artifactId> |
||||
<groupId>com.blockchain</groupId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>spring-cloud-gateway</artifactId> |
||||
<version>1.0-SNAPSHOT</version> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-actuator</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-starter-webflux</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework.cloud</groupId> |
||||
<artifactId>spring-cloud-starter-gateway</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework.cloud</groupId> |
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
<build> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
@ -0,0 +1,14 @@ |
||||
package com.blockchain.spring.cloud.gateway; |
||||
|
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
||||
|
||||
|
||||
@SpringBootApplication |
||||
@EnableEurekaClient |
||||
public class GatewayApplication { |
||||
public static void main(String[] args) { |
||||
SpringApplication.run(GatewayApplication.class,args); |
||||
} |
||||
} |
Loading…
Reference in new issue