39 files modified
7 files added
| | |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>ripple</groupId> |
| | | <artifactId>ripple</artifactId> |
| | | <version>0.0.1</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/ripple-core-0.0.1-SNAPSHOT.jar</systemPath> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>taobao</groupId> |
| | | <artifactId>taobao-sdk</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/taobao-sdk-java.jar</systemPath> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.security</groupId>--> |
| | | <!-- <artifactId>spring-security-test</artifactId>--> |
| | | <!-- <scope>test</scope>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.security</groupId>--> |
| | | <!-- <artifactId>spring-security-test</artifactId>--> |
| | | <!-- <scope>test</scope>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>${mysql-driver.version}</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.web3j</groupId> |
| | | <artifactId>core</artifactId> |
| | |
| | | <version>4.3.5</version> |
| | | </dependency> |
| | | <!-- submail邮件 end --> |
| | | |
| | | <dependency> |
| | | <groupId>ripple</groupId> |
| | | <artifactId>ripple</artifactId> |
| | | <version>0.0.1</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/ripple-core-0.0.1-SNAPSHOT.jar</systemPath> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>taobao</groupId> |
| | | <artifactId>taobao-sdk</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/taobao-sdk-java.jar</systemPath> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>ztron-sdk</groupId> |
| | | <artifactId>ztron-sdk</artifactId> |
| | | <version>0.0.1</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/tron-sdk.jar</systemPath> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>wallet-cli</groupId>--> |
| | | <!--<artifactId>wallet-cli</artifactId>--> |
| | | <!--<version>0.0.1</version>--> |
| | | <!--<scope>system</scope>--> |
| | | <!--<systemPath>${basedir}/lib/wallet-cli.jar</systemPath>--> |
| | | <!--</dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.ki5fpl.tronj</groupId> |
| | | <artifactId>abi</artifactId> |
| | | <version>0.4.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/abi-0.4.0.jar</systemPath> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.ki5fpl.tronj</groupId> |
| | | <artifactId>client</artifactId> |
| | | <version>0.4.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/client-0.4.0.jar</systemPath> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.ki5fpl.tronj</groupId> |
| | | <artifactId>utils</artifactId> |
| | | <version>0.4.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${basedir}/lib/utils-0.4.0.jar</systemPath> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | |
| | | // 发送手机验证码 |
| | | if (AppContants.ACCOUNT_TYPE_MOBILE.equals(type)) { |
| | | boolean result = Sms106Send.sendVerifyCode(account, code.toString(), 2); |
| | | boolean result = Sms106Send.sendVerifyCode(account, code.toString(), 10); |
| | | if (result) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | boolean flag = redisUtils.set(AppContants.VERIFY_CODE_PREFIX + account, code, 600); |
| | |
| | | |
| | | @Override |
| | | public LoginUserBean loadUserByUsername(String username) throws UsernameNotFoundException { |
| | | log.info("#登陆账号:{}#", username); |
| | | //log.info("#登陆账号:{}#", username); |
| | | List<GrantedAuthority> grantedAuthorities = new ArrayList<>(); |
| | | // GrantedAuthority grantedAuthority = new SimpleGrantedAuthority("ROLE_ADMIN"); |
| | | // grantedAuthorities.add(grantedAuthority); |
| | |
| | | @Configuration |
| | | public class RabbitMqConfig { |
| | | |
| | | public static final String EXCHANGE_ONE = "biue-exchange-one"; |
| | | public static final String EXCHANGE_ONE = "biue-exchange-one_t"; |
| | | |
| | | public static final String QUEUE_TEST = "test-queue"; |
| | | public static final String QUEUE_TEST = "test-queue_t"; |
| | | |
| | | public static final String ROUTING_KEY_TEST = "test-routingKey"; |
| | | public static final String ROUTING_KEY_TEST = "test-routingKey_t"; |
| | | |
| | | public static final String EXCHANGE_A = "biue-exchange-A"; |
| | | public static final String EXCHANGE_A = "biue-exchange-A_t"; |
| | | |
| | | |
| | | public static final String EXCHANGE_USDT_UPDATE = "exchange_usdt_update"; |
| | | public static final String EXCHANGE_USDT_UPDATE = "exchange_usdt_update_t"; |
| | | |
| | | public static final String QUEUE_USDT_UPDATE = "queue_usdt_update"; |
| | | public static final String QUEUE_USDT_UPDATE = "queue_usdt_update_t"; |
| | | |
| | | public static final String ROUTING_KEY_USDT_UPDATE = "routing_key_usdt_update"; |
| | | public static final String ROUTING_KEY_USDT_UPDATE = "routing_key_usdt_update_t"; |
| | | |
| | | public static final String EXCHANGE_USDT_ADDRESS = "exchange_usdt_address"; |
| | | public static final String EXCHANGE_USDT_ADDRESS = "exchange_usdt_address_t"; |
| | | |
| | | public static final String QUEUE_USDT_ADDRESS= "queue_usdt_address"; |
| | | public static final String QUEUE_USDT_ADDRESS= "queue_usdt_address_t"; |
| | | |
| | | public static final String ROUTING_KEY_USDT_ADDRESS = "routing_key_usdt_address"; |
| | | public static final String ROUTING_KEY_USDT_ADDRESS = "routing_key_usdt_address_t"; |
| | | |
| | | |
| | | /** |
| | | * 撮合交易 |
| | | */ |
| | | public static final String EXCHANGE_B = "biue-exchange-B"; |
| | | public static final String EXCHANGE_B = "biue-exchange-B_t"; |
| | | |
| | | |
| | | // 开多止盈队列 |
| | | public static final String QUEUE_MOREPRO = "QUEUE_MOREPRO_NEW"; |
| | | public static final String QUEUE_MOREPRO = "QUEUE_MOREPRO_NEW_t"; |
| | | // 开空止盈队列 |
| | | public static final String QUEUE_LESSPRO = "QUEUE_LESSPRO_NEW"; |
| | | public static final String QUEUE_LESSPRO = "QUEUE_LESSPRO_NEW_t"; |
| | | // 开多止损队列 |
| | | public static final String QUEUE_MORELOSS = "QUEUE_MORELOSS_NEW"; |
| | | public static final String QUEUE_MORELOSS = "QUEUE_MORELOSS_NEW_t"; |
| | | // 开空止损队列 |
| | | public static final String QUEUE_LESSLOSS = "QUEUE_LESSLOSS_NEW"; |
| | | public static final String QUEUE_LESSLOSS = "QUEUE_LESSLOSS_NEW_t"; |
| | | |
| | | // 限价委托 |
| | | public static final String QUEUE_LIMIT = "QUEUE_LIMIT_NEW"; |
| | | public static final String QUEUE_LIMIT = "QUEUE_LIMIT_NEW_t"; |
| | | |
| | | // 爆仓队列 |
| | | public static final String QUEUE_COINOUT = "QUEUE_COINOUT_NEW"; |
| | | public static final String QUEUE_COINOUT = "QUEUE_COINOUT_NEW_t"; |
| | | |
| | | //价格操作 |
| | | public static final String QUEUE_PRICEOPERATE = "QUEUE_PRICEOPERATE_NEW"; |
| | | public static final String QUEUE_PRICEOPERATE = "QUEUE_PRICEOPERATE_NEW_t"; |
| | | |
| | | // 平仓队列 |
| | | public static final String QUEUE_CLOSETRADE = "QUEUE_CLOSETRADE_NEW"; |
| | | public static final String QUEUE_CLOSETRADE = "QUEUE_CLOSETRADE_NEW_t"; |
| | | |
| | | // 盘口队列 |
| | | public static final String QUEUE_TRADE_PLATE = "QUEUE_TRADE_PLATE"; |
| | | public static final String QUEUE_TRADE_PLATE = "QUEUE_TRADE_PLATE_t"; |
| | | |
| | | // 处理交易 |
| | | public static final String QUEUE_HANDLE_TRADE = "QUEUE_HANDLE_TRADE"; |
| | | public static final String QUEUE_HANDLE_TRADE = "QUEUE_HANDLE_TRADE_t"; |
| | | |
| | | |
| | | // 开多止盈路由键 |
| | | public static final String ROUTINGKEY_MOREPRO = "ROUTINGKEY_MOREPRO"; |
| | | public static final String ROUTINGKEY_MOREPRO = "ROUTINGKEY_MOREPRO_t"; |
| | | // 开空止盈路由 |
| | | public static final String ROUTINGKEY_LESSPRO = "ROUTINGKEY_LESSPRO"; |
| | | public static final String ROUTINGKEY_LESSPRO = "ROUTINGKEY_LESSPRO_t"; |
| | | // 开多止损路由 |
| | | public static final String ROUTINGKEY_MORELOSS = "ROUTINGKEY_MORELOSS"; |
| | | public static final String ROUTINGKEY_MORELOSS = "ROUTINGKEY_MORELOSS_t"; |
| | | // 开空止损路由 |
| | | public static final String ROUTINGKEY_LESSLOSS = "ROUTINGKEY_LESSLOSS"; |
| | | public static final String ROUTINGKEY_LESSLOSS = "ROUTINGKEY_LESSLOSS_t"; |
| | | // 限价委托 |
| | | public static final String ROUTINGKEY_LIMIT = "ROUTINGKEY_LIMIT"; |
| | | public static final String ROUTINGKEY_LIMIT = "ROUTINGKEY_LIMIT_t"; |
| | | |
| | | // 爆仓路由 |
| | | public static final String ROUTINGKEY_COINOUT = "ROUTINGKEY_COINOUT"; |
| | | public static final String ROUTINGKEY_COINOUT = "ROUTINGKEY_COINOUT_t"; |
| | | |
| | | |
| | | // 价格操作 |
| | | public static final String ROUTINGKEY_PRICEOPERATE = "ROUTINGKEY_PRICEOPERATE"; |
| | | public static final String ROUTINGKEY_PRICEOPERATE = "ROUTINGKEY_PRICEOPERATE_t"; |
| | | // 平仓路由 |
| | | public static final String ROUTINGKEY_CLOSETRADE = "ROUTINGKEY_CLOSETRADE"; |
| | | public static final String ROUTINGKEY_CLOSETRADE = "ROUTINGKEY_CLOSETRADE_t"; |
| | | |
| | | // 盘口理路由 |
| | | public static final String ROUTINGKEY_TRADE_PLATE = "ROUTINGKEY_TRADE_PLATE"; |
| | | public static final String ROUTINGKEY_TRADE_PLATE = "ROUTINGKEY_TRADE_PLATE_t"; |
| | | |
| | | // 交易订单处理 |
| | | public static final String ROUTINGKEY_HANDLE_TRADE = "ROUTINGKEY_HANDLE_TRADE"; |
| | | public static final String ROUTINGKEY_HANDLE_TRADE = "ROUTINGKEY_HANDLE_TRADE_t"; |
| | | |
| | | public static final String EXCHANGE_ROC = "roc-transfer"; |
| | | public static final String EXCHANGE_ROC = "roc-transfer_t"; |
| | | |
| | | public static final String QUEUE_ROC= "roc-queue"; |
| | | public static final String QUEUE_ROC= "roc-queue_t"; |
| | | |
| | | public static final String ROUTING_KEY_ROC = "roc-transfer-routingKey"; |
| | | public static final String ROUTING_KEY_ROC = "roc-transfer-routingKey_t"; |
| | | |
| | | public static final String EXCHANGE_ROC_ORDER_SUBMIT = "roc-exchange-order-submit"; |
| | | public static final String EXCHANGE_ROC_ORDER_SUBMIT = "roc-exchange-order-submit_t"; |
| | | |
| | | public static final String QUEUE_ROC_ORDER_SUBMIT = "roc-order-queue-submit"; |
| | | public static final String QUEUE_ROC_ORDER_SUBMIT = "roc-order-queue-submit_t"; |
| | | |
| | | public static final String ROUTING_KEY_ROC_ORDER_SUBMIT = "roc-order-routingKey-submit"; |
| | | public static final String ROUTING_KEY_ROC_ORDER_SUBMIT = "roc-order-routingKey-submit_t"; |
| | | |
| | | public static final String EXCHANGE_ROC_ORDER_CANCEL = "roc-exchange-order-cancel"; |
| | | public static final String EXCHANGE_ROC_ORDER_CANCEL = "roc-exchange-order-cancel_t"; |
| | | |
| | | public static final String QUEUE_ROC_ORDER_CANCEL = "roc-order-queue-cancel"; |
| | | public static final String QUEUE_ROC_ORDER_CANCEL = "roc-order-queue-cancel_t"; |
| | | |
| | | public static final String ROUTING_KEY_ROC_ORDER_CANCEL = "roc-order-routingKey-cancel"; |
| | | public static final String ROUTING_KEY_ROC_ORDER_CANCEL = "roc-order-routingKey-cancel_t"; |
| | | |
| | | public static final String EXCHANGE_ROC_ORDER_COMPLETE = "roc-exchange-order-complete"; |
| | | public static final String EXCHANGE_ROC_ORDER_COMPLETE = "roc-exchange-order-complete_t"; |
| | | |
| | | public static final String QUEUE_ROC_ORDER_COMPLETE = "roc-order-queue-complete"; |
| | | public static final String QUEUE_ROC_ORDER_COMPLETE = "roc-order-queue-complete_t"; |
| | | |
| | | public static final String ROUTING_KEY_ROC_ORDER_COMPLETE = "roc-order-routingKey-complete"; |
| | | public static final String ROUTING_KEY_ROC_ORDER_COMPLETE = "roc-order-routingKey-complete_t"; |
| | | |
| | | |
| | | @Resource |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.SpringBootConfiguration; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.format.FormatterRegistry; |
| | | import org.springframework.http.converter.HttpMessageConverter; |
| | | import org.springframework.validation.MessageCodesResolver; |
| | | import org.springframework.validation.Validator; |
| | | import org.springframework.web.method.support.HandlerMethodArgumentResolver; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | import org.springframework.web.method.support.HandlerMethodReturnValueHandler; |
| | | import org.springframework.web.servlet.HandlerExceptionResolver; |
| | | import org.springframework.web.servlet.config.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | resolvers.add(new UserAuthenticationArgumentResolver()); |
| | | } |
| | | |
| | | @Override |
| | | public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> list) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void configureMessageConverters(List<HttpMessageConverter<?>> list) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void extendMessageConverters(List<HttpMessageConverter<?>> list) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> list) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> list) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Validator getValidator() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public MessageCodesResolver getMessageCodesResolver() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void configurePathMatch(PathMatchConfigurer pathMatchConfigurer) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void configureContentNegotiation(ContentNegotiationConfigurer contentNegotiationConfigurer) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void configureAsyncSupport(AsyncSupportConfigurer asyncSupportConfigurer) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void configureDefaultServletHandling(DefaultServletHandlerConfigurer defaultServletHandlerConfigurer) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void addFormatters(FormatterRegistry formatterRegistry) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry interceptorRegistry) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry resourceHandlerRegistry) { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 设置cors跨域支持 |
| | | * |
| | |
| | | .allowCredentials(true).maxAge(3600); |
| | | } |
| | | |
| | | @Override |
| | | public void addViewControllers(ViewControllerRegistry viewControllerRegistry) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void configureViewResolvers(ViewResolverRegistry viewResolverRegistry) { |
| | | |
| | | } |
| | | |
| | | @Bean |
| | | public OSS ossClient() { |
| | | return new OSSClientBuilder().build(aliOssProperties.getEndPoint(), aliOssProperties.getAccessKeyId(), aliOssProperties.getAccessKeySecret()); |
| | |
| | | SecurityContextHolder.getContext().setAuthentication(authentication); |
| | | redisUtils.expire(redisKey, 36000); |
| | | } else { |
| | | log.info("token无法查询:{}", token); |
| | | //log.info("token无法查询:{}", token); |
| | | SecurityContextHolder.clearContext(); |
| | | } |
| | | } else { |
| | |
| | | } |
| | | // log.info("bearerToken---->{}", bearerToken); |
| | | } catch (Exception e) { |
| | | log.error("#解析token异常#", e); |
| | | //log.error("#解析token异常#", e); |
| | | return null; |
| | | } |
| | | return null; |
| | |
| | | })
|
| | | @GetMapping(value = "/findBlockAddress")
|
| | | @SubmitRepeat
|
| | | public Result findBlockAddress(String symbol) {
|
| | | return blockSerive.findBlockAddress(symbol);
|
| | | public Result findBlockAddress(String symbol,String lable) {
|
| | | return blockSerive.findBlockAddress(symbol,lable);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private String address; |
| | | private String hash; |
| | | private BigDecimal balance; |
| | | private String symbol; |
| | | |
| | | public interface Symbol{ |
| | | String USDT_ERC20 = "USDT_ERC20"; |
| | | String USDT_TRC20 = "USDT_TRC20"; |
| | | } |
| | | |
| | | public EthUsdtChargeDto() { |
| | | } |
| | |
| | |
|
| | | public interface BlockSerive {
|
| | |
|
| | | Result findBlockAddress(String symbol);
|
| | | Result findBlockAddress(String symbol,String lable);
|
| | |
|
| | | }
|
| | |
| | | // System.out.println("222="+dateDiffStr("2014-06-11 00:00:00","2014-06-25 23:59:59"));
|
| | | // System.out.println("getUTCTimeStr()=="+DateUtil.currentTimeDiffToHour("2015-01-22 18:12:59"));
|
| | | //System.out.println(DateUtil.dateDiff("2015-09-02 09:55:14",DateUtil.dateToString(new Date())));
|
| | | System.out.println(DateUtil.currentTimeDiff("2018-07-11 18:00:00"));
|
| | | String yyyyMMdd = dateToString(new Date(), "yyyyMMdd");
|
| | | System.out.println(yyyyMMdd);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return simpleDateFormat.format(date);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 把日期格式转换为YYMMDDHHMMSS格式
|
| | | * @param
|
| | |
| | | /**
|
| | | * 服务器地址
|
| | | */
|
| | | //private static final String ETH_UTL = "http://120.55.86.146:8545";
|
| | | private static final String ETH_UTL = "http://114.55.250.231:8545";
|
| | | private static final String ETH_UTL = "http://120.55.86.146:8545";
|
| | | //private static final String ETH_UTL = "http://114.55.250.231:8545";
|
| | |
|
| | | public EthService() {
|
| | | try {
|
| | |
| | | import com.xcong.excoin.modules.blackchain.service.*;
|
| | | import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | |
| | | private UsdtUpdateProducer usdtUpdateProducer;
|
| | |
|
| | | @Override
|
| | | public Result findBlockAddress(String symbol) {
|
| | | public Result findBlockAddress(String symbol,String lable) {
|
| | | //获取用户ID
|
| | | String mId = LoginUserUtils.getAppLoginUser().getId().toString();
|
| | | MemberEntity member = memberDao.selectById(mId);
|
| | | if (member == null) {
|
| | | return Result.fail(MessageSourceUtils.getString("member_service_0003"));
|
| | | }
|
| | | String lable = "ERC20";
|
| | | if(StringUtils.isBlank(lable)){
|
| | | //lable = "ERC20";
|
| | | lable = "TRC20";
|
| | | }
|
| | |
|
| | | Result result = new Result();
|
| | | try {
|
| | | Map<String, String> map = new HashMap<String, String>();
|
| | |
| | | } else {
|
| | | memberCoinAddress = memberMapper.selectBlockAddress(Long.parseLong(mId), symbol);
|
| | | }
|
| | | log.info("--->{}", memberCoinAddress);
|
| | | //log.info("--->{}", memberCoinAddress);
|
| | | if (memberCoinAddress != null) {
|
| | | map.put("address", memberCoinAddress.getAddress());
|
| | | map.put("lable", memberCoinAddress.getLabel());
|
| | |
| | | memberMapper.insert(coinAddress);
|
| | | }
|
| | |
|
| | | } else {
|
| | | } else if ("ERC20".equals(lable)) {
|
| | | MemberCoinAddressEntity ethAddress2 = memberMapper.selectBlockAddress(Long.parseLong(mId), "ETH");
|
| | | if (ethAddress2 != null) {
|
| | | address = ethAddress2.getAddress();
|
| | |
| | | coinAddress.setLabel(uuid);
|
| | | memberMapper.insert(coinAddress);
|
| | | }
|
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address);
|
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address+","+"ERC20");
|
| | | } else if ("TRC20".equals(lable)) {
|
| | | Map<String, String> usdtMap = Trc20Service.createAddress();
|
| | | address = usdtMap.get("address");
|
| | | key = usdtMap.get("privateKey");
|
| | | map.put("address", address);
|
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address+","+"TRC20");
|
| | | }
|
| | | break;
|
| | | case "ROC":
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | String wallet = RocService.createWallet();
|
| | | System.out.println(wallet);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.xcong.excoin.modules.blackchain.service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Auther: little liu |
| | | * @Date: 2020/09/03/16:03 |
| | | * @Description: |
| | | */ |
| | | public class TransformUtil { |
| | | |
| | | |
| | | /** |
| | | * 长度不够前面补0 |
| | | * |
| | | * @param str |
| | | * @param strLength |
| | | * @return |
| | | */ |
| | | public static String addZeroForNum(String str, int strLength) { |
| | | int strLen = str.length(); |
| | | if (strLen < strLength) { |
| | | while (strLen < strLength) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append("0").append(str);// 左补0 |
| | | // sb.append(str).append("0");//右补0 |
| | | str = sb.toString(); |
| | | strLen = str.length(); |
| | | } |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | public static String delZeroForNum(String str) { |
| | | return str.replaceAll("^(0+)", ""); |
| | | } |
| | | |
| | | public static String getSeqNumByLong(Long l, int bitCount) { |
| | | return String.format("%0" + bitCount + "d", l); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 字符串转换为16进制字符串 |
| | | * |
| | | * @param s |
| | | * @return |
| | | */ |
| | | public static String stringToHexString(String s) { |
| | | String str = ""; |
| | | for (int i = 0; i < s.length(); i++) { |
| | | int ch = s.charAt(i); |
| | | String s4 = Integer.toHexString(ch); |
| | | str = str + s4; |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * 16进制字符串转换为字符串 |
| | | * |
| | | * @param s |
| | | * @return |
| | | */ |
| | | public static String hexStringToString(String s) { |
| | | if (s == null || s.equals("")) { |
| | | return null; |
| | | } |
| | | s = s.replace(" ", ""); |
| | | byte[] baKeyword = new byte[s.length() / 2]; |
| | | for (int i = 0; i < baKeyword.length; i++) { |
| | | try { |
| | | baKeyword[i] = (byte) (0xff & Integer.parseInt( |
| | | s.substring(i * 2, i * 2 + 2), 16)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | try { |
| | | s = new String(baKeyword, "gbk"); |
| | | new String(); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | /** |
| | | * 16进制表示的字符串转换为字节数组 |
| | | * |
| | | * @param s 16进制表示的字符串 |
| | | * @return byte[] 字节数组 |
| | | */ |
| | | public static byte[] hexStringToByteArray(String s) { |
| | | int len = s.length(); |
| | | byte[] b = new byte[len / 2]; |
| | | for (int i = 0; i < len; i += 2) { |
| | | // 两位一组,表示一个字节,把这样表示的16进制字符串,还原成一个字节 |
| | | b[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character |
| | | .digit(s.charAt(i + 1), 16)); |
| | | } |
| | | return b; |
| | | } |
| | | |
| | | /** |
| | | * byte数组转16进制字符串 |
| | | * |
| | | * @param bArray |
| | | * @return |
| | | */ |
| | | public static final String bytesToHexString(byte[] bArray) { |
| | | StringBuffer sb = new StringBuffer(bArray.length); |
| | | String sTemp; |
| | | for (int i = 0; i < bArray.length; i++) { |
| | | sTemp = Integer.toHexString(0xFF & bArray[i]); |
| | | if (sTemp.length() < 2) |
| | | sb.append(0); |
| | | sb.append(sTemp.toUpperCase()); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param: [hex] |
| | | * @return: int |
| | | * @description: 按位计算,位值乘权重 |
| | | */ |
| | | public static int hexToDecimal(String hex) { |
| | | int outcome = 0; |
| | | for (int i = 0; i < hex.length(); i++) { |
| | | char hexChar = hex.charAt(i); |
| | | outcome = outcome * 16 + charToDecimal(hexChar); |
| | | } |
| | | return outcome; |
| | | } |
| | | |
| | | /** |
| | | * @param: [c] |
| | | * @return: int |
| | | * @description:将字符转化为数字 |
| | | */ |
| | | public static int charToDecimal(char c) { |
| | | if (c >= 'A' && c <= 'F') |
| | | return 10 + c - 'A'; |
| | | else |
| | | return c - '0'; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 把原始字符串分割成指定长度的字符串列表 |
| | | * |
| | | * @param inputString |
| | | * 原始字符串 |
| | | * @param length |
| | | * 指定长度 |
| | | * @return |
| | | */ |
| | | public static List<String> getStrList(String inputString, int length) { |
| | | int size = inputString.length() / length; |
| | | if (inputString.length() % length != 0) { |
| | | size += 1; |
| | | } |
| | | return getStrList(inputString, length, size); |
| | | } |
| | | |
| | | /** |
| | | * 把原始字符串分割成指定长度的字符串列表 |
| | | * |
| | | * @param inputString |
| | | * 原始字符串 |
| | | * @param length |
| | | * 指定长度 |
| | | * @param size |
| | | * 指定列表大小 |
| | | * @return |
| | | */ |
| | | public static List<String> getStrList(String inputString, int length, |
| | | int size) { |
| | | List<String> list = new ArrayList<String>(); |
| | | for (int index = 0; index < size; index++) { |
| | | String childStr = substring(inputString, index * length, |
| | | (index + 1) * length); |
| | | list.add(childStr); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 分割字符串,如果开始位置大于字符串长度,返回空 |
| | | * |
| | | * @param str |
| | | * 原始字符串 |
| | | * @param f |
| | | * 开始位置 |
| | | * @param t |
| | | * 结束位置 |
| | | * @return |
| | | */ |
| | | public static String substring(String str, int f, int t) { |
| | | if (f > str.length()) |
| | | return null; |
| | | if (t > str.length()) { |
| | | return str.substring(f, str.length()); |
| | | } else { |
| | | return str.substring(f, t); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.sunlight.tronsdk.TrxService; |
| | | import com.sunlight.tronsdk.transaction.TransactionResult; |
| | | import com.xcong.excoin.modules.blackchain.model.Trc20TransactionsData; |
| | | import com.xcong.excoin.modules.blackchain.model.Trc20TransactionsResult; |
| | | import org.apache.commons.codec.binary.Hex; |
| | | import org.tron.common.crypto.SignInterface; |
| | | import org.tron.common.crypto.SignUtils; |
| | | import org.tron.common.utils.ByteArray; |
| | | import org.tron.common.utils.Utils; |
| | | import org.tron.walletserver.WalletApi; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | private final static String FULL_NODE_URL = "https://api.trongrid.io"; |
| | | |
| | | public static Map<String,String> createAddress(){ |
| | | String url ="https://api.trongrid.io/wallet/generateaddress"; |
| | | // {privateKey=ed0bae6e49fa4dd8a622fe77baa0d6e4077155b28ed6637870745c6da3cf372e, address=THeRNk25ps69fzqhN6tZ4Ecxur3RvDNDtY, hexAddress=4154336ea2a3a26be8a722053ee26c61e3f7f3e0ec} |
| | | String s = HttpUtil.get(url); |
| | | return JSONObject.parseObject(s,Map.class); |
| | | public final static String TRX_PRIVATE_KEY = "ea176fff7ba171154aed643321d1f9ba239e128124d8ffa5d075575ef3b58f81"; |
| | | public final static String TRX_ADDRESS = "TPSPfAZ8UG9WiXDNX6SbYHNpX46oLV6xAs"; |
| | | public final static String POOL_ADDRESS = "TPSPfAZ8UG9WiXDNX6SbYHNpX46oLV6xAs"; |
| | | |
| | | |
| | | /** |
| | | * 创建用户钱包地址 |
| | | **/ |
| | | public static Map<String,String> createAddress() { |
| | | // String url = http + "/wallet/generateaddress"; |
| | | SignInterface sign = SignUtils.getGeneratedRandomSign(Utils.getRandom(), true); |
| | | byte[] priKey = sign.getPrivateKey(); |
| | | byte[] address = sign.getAddress(); |
| | | String priKeyStr = Hex.encodeHexString(priKey); |
| | | String base58check = WalletApi.encode58Check(address); |
| | | String hexString = ByteArray.toHexString(address); |
| | | Map<String,String> jsonAddress = new HashMap<>(); |
| | | jsonAddress.put("address", base58check); |
| | | jsonAddress.put("hexAddress", hexString); |
| | | jsonAddress.put("privateKey", priKeyStr); |
| | | return jsonAddress; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param address |
| | | * @param time 2020-09-07T00:00 |
| | | * @return |
| | | * 转TRX |
| | | * @param sendPrivateKey |
| | | * @param receiveAddress |
| | | * @param amount |
| | | */ |
| | | public static List<Trc20TransactionsData> getAddressTransactions(String address,String time) { |
| | | String url = "https://api.trongrid.io/v1/accounts/"+address+"/transactions/trc20?only_confirmed=true&only_to=true&min_timestamp="+time+"&contract_address=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"; |
| | | //String url = "https://api.trongrid.io/v1/accounts/"+address+"/transactions/trc20?limit=100&contract_address=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t&only_confirmed=true"; |
| | | String s = HttpUtil.get(url); |
| | | Trc20TransactionsResult trc20TransactionsResult = JSONObject.parseObject(s, Trc20TransactionsResult.class); |
| | | if (trc20TransactionsResult.isSuccess()) { |
| | | return trc20TransactionsResult.getData(); |
| | | } else { |
| | | public static void sendTrx(String sendPrivateKey,String receiveAddress,BigDecimal amount) { |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | TransactionResult transactionResult = service.testSendTrxTransaction(sendPrivateKey, receiveAddress, amount); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 转TRC20 |
| | | * @param sendPrivateKey |
| | | * @param receiveAddress |
| | | * @param amount |
| | | */ |
| | | public static void sendTrc20(String sendPrivateKey,String receiveAddress,BigDecimal amount){ |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | TransactionResult transactionResult = service.sendTrc20TransactionTest(sendPrivateKey, receiveAddress, amount); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public static BigDecimal getTrxBalance(String address){ |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | BigDecimal trxBalanceTest = service.getTrxBalanceTest(address); |
| | | return trxBalanceTest; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static BigDecimal getTrc20Balance(String address){ |
| | | TrxService service = new TrxService(); |
| | | try { |
| | | BigDecimal trxBalanceTest = service.trc20BalanceOfTest(address); |
| | | return trxBalanceTest; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | public static void main(String[] args) { |
| | | System.out.println(createAddress()); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.blackchain.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum; |
| | | import com.xcong.excoin.modules.blackchain.model.EthUsdtChargeDto; |
| | | import com.xcong.excoin.modules.member.dao.MemberCoinAddressDao; |
| | | import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity; |
| | | import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.tron.common.utils.ByteArray; |
| | | import org.tron.walletserver.WalletApi; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class TrxUsdtUpdateService { |
| | | |
| | | public static List<String> addressList = new ArrayList<>(); |
| | | private static String http = "https://api.trongrid.io"; |
| | | |
| | | private static String TRC20_CONTRACT_ADDRESS = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"; |
| | | |
| | | @Resource |
| | | private UsdtUpdateProducer usdtUpdateProducer; |
| | | |
| | | @Resource |
| | | private MemberCoinAddressDao memberCoinAddressDao; |
| | | |
| | | @Resource |
| | | RedisUtils redisUtils; |
| | | |
| | | public void monitorCoinListener() { |
| | | if (CollectionUtils.isEmpty(addressList)) { |
| | | List<MemberCoinAddressEntity> coinAddressList = memberCoinAddressDao.selectAllBlockAddressBySymbolAndTag(CoinTypeEnum.USDT.name(), "TRC20"); |
| | | if (CollectionUtils.isNotEmpty(coinAddressList)) { |
| | | coinAddressList.forEach(e -> { |
| | | addressList.add(e.getAddress()); |
| | | }); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(addressList)) { |
| | | return; |
| | | } |
| | | Object trc20BlockNum = redisUtils.get("USDT_TRC20_BLOCK_NUM"); |
| | | Long blockNum = (Long) trc20BlockNum; |
| | | // http 请求 |
| | | // httpTransactionInfo(addressList, 26599313L); |
| | | //httpTransactionInfo(addressList, 26603621L); |
| | | httpTransactionInfo(addressList, blockNum); |
| | | redisUtils.set("USDT_TRC20_BLOCK_NUM", (blockNum + 1L)); |
| | | } |
| | | |
| | | private void httpTransactionInfo(List<String> addressList, Long num) { |
| | | String transactionInfoByBlockNum = getTransactionInfoByBlockNum(BigInteger.valueOf(num)); |
| | | if (StringUtils.isBlank(transactionInfoByBlockNum)) { |
| | | return; |
| | | } |
| | | JSONArray parseArray = JSON.parseArray(transactionInfoByBlockNum); |
| | | if (parseArray.size() > 0) { |
| | | for (Object e : parseArray) { |
| | | try { |
| | | String txId = JSON.parseObject(e.toString()).getString("id"); |
| | | //判断 数据库 txId 有 就不用往下继续了 |
| | | JSONObject parseObject = JSON.parseObject(getTransactionById(txId)); |
| | | String contractRet = parseObject.getJSONArray("ret").getJSONObject(0).getString("contractRet"); |
| | | //交易成功 |
| | | if ("SUCCESS".equals(contractRet)) { |
| | | String type = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getString("type"); |
| | | if ("TriggerSmartContract".equals(type)) { |
| | | //合约地址转账 |
| | | triggerSmartContract(addressList, txId, parseObject); |
| | | |
| | | } else if ("TransferContract".equals(type)) { |
| | | //trx 转账 |
| | | transferContract(parseObject); |
| | | } |
| | | } |
| | | } catch (Exception exception) { |
| | | exception.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void transferContract(JSONObject parseObject) { |
| | | //数量 |
| | | BigDecimal amount = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getJSONObject("parameter").getJSONObject("value").getBigDecimal("amount"); |
| | | |
| | | //调用者地址 |
| | | String owner_address = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getJSONObject("parameter").getJSONObject("value").getString("owner_address"); |
| | | owner_address = WalletApi.encode58Check(ByteArray.fromHexString(owner_address)); |
| | | |
| | | //转入地址 |
| | | String to_address = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getJSONObject("parameter").getJSONObject("value").getString("to_address"); |
| | | to_address = WalletApi.encode58Check(ByteArray.fromHexString(to_address)); |
| | | |
| | | amount = amount.divide(new BigDecimal(1 + TransformUtil.getSeqNumByLong(0L, 6))); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取特定区块的所有交易 Info 信息 |
| | | * |
| | | * @param num 区块 |
| | | * @return |
| | | */ |
| | | public static String getTransactionInfoByBlockNum(BigInteger num) { |
| | | String url = http + "/wallet/gettransactioninfobyblocknum"; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("num", num); |
| | | String param = JSON.toJSONString(map); |
| | | return postForEntity(url, param).getBody(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * https://cn.developers.tron.network/docs/%E4%BA%A4%E6%98%9311#%E4%BA%A4%E6%98%93%E7%A1%AE%E8%AE%A4%E6%96%B9%E6%B3%95 |
| | | * 按交易哈希查询交易 |
| | | * |
| | | * @param txId 交易id |
| | | * @return |
| | | */ |
| | | public static String getTransactionById(String txId) { |
| | | // String url = walletSolidityHttp + "/walletsolidity/gettransactionbyid"; |
| | | String url = http + "/wallet/gettransactionbyid"; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("value", txId); |
| | | String param = JSON.toJSONString(map); |
| | | return postForEntity(url, param).getBody(); |
| | | } |
| | | |
| | | /** |
| | | * 执行 post 请求 |
| | | * |
| | | * @param url url |
| | | * @param param 请求参数 |
| | | * @return |
| | | */ |
| | | private static ResponseEntity<String> postForEntity(String url, String param) { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | HttpEntity<String> request = new HttpEntity<>(param); |
| | | ResponseEntity<String> result = restTemplate.postForEntity(url, request, String.class); |
| | | // System.out.println("url:" + url + ",param:" + param + ",result:" + result.getBody()); |
| | | return result; |
| | | } |
| | | |
| | | private void triggerSmartContract(List<String> addressList, String txId, JSONObject parseObject) { |
| | | //方法参数 |
| | | String data = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getJSONObject("parameter").getJSONObject("value").getString("data"); |
| | | // 调用者地址 |
| | | String owner_address = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getJSONObject("parameter").getJSONObject("value").getString("owner_address"); |
| | | owner_address = WalletApi.encode58Check(ByteArray.fromHexString(owner_address)); |
| | | //System.out.println("owner_address:"+owner_address); |
| | | // 合约地址 |
| | | String contract_address = parseObject.getJSONObject("raw_data").getJSONArray("contract").getJSONObject(0).getJSONObject("parameter").getJSONObject("value").getString("contract_address"); |
| | | contract_address = WalletApi.encode58Check(ByteArray.fromHexString(contract_address)); |
| | | |
| | | String dataStr = data.substring(8); |
| | | List<String> strList = TransformUtil.getStrList(dataStr, 64); |
| | | //System.out.println(strList); |
| | | if (strList.size() != 2) { |
| | | return; |
| | | } |
| | | |
| | | String to_address = TransformUtil.delZeroForNum(strList.get(0)); |
| | | |
| | | if (!to_address.startsWith("41")) { |
| | | to_address = "41" + to_address; |
| | | } |
| | | |
| | | to_address = WalletApi.encode58Check(ByteArray.fromHexString(to_address)); |
| | | //System.out.println("to_address:"+to_address); |
| | | String amountStr = TransformUtil.delZeroForNum(strList.get(1)); |
| | | |
| | | if (amountStr.length() > 0) { |
| | | amountStr = new BigInteger(amountStr, 16).toString(10); |
| | | } |
| | | |
| | | BigDecimal amount = BigDecimal.ZERO; |
| | | //相匹配的合约地址 |
| | | if (!TRC20_CONTRACT_ADDRESS.equals(contract_address)) { |
| | | return; |
| | | } |
| | | |
| | | //币种 |
| | | if (StringUtils.isNotEmpty(amountStr)) { |
| | | amount = new BigDecimal(amountStr).divide(new BigDecimal(1 + TransformUtil.getSeqNumByLong(0L, 6))); |
| | | } |
| | | for (String address : addressList) { |
| | | if (address.equals(to_address)) { |
| | | System.out.println("存在本地的地址:" + address); |
| | | // 金额 |
| | | // 发送消息队列 |
| | | EthUsdtChargeDto dto = new EthUsdtChargeDto(address, txId, amount); |
| | | dto.setSymbol(EthUsdtChargeDto.Symbol.USDT_TRC20); |
| | | usdtUpdateProducer.sendMsg(JSONObject.toJSONString(dto)); |
| | | System.out.println("===to_address:" + to_address + "===amount:" + amount); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public boolean poolByAddress(String address) { |
| | | // 首先查询trx余额 |
| | | BigDecimal trxBalance = Trc20Service.getTrxBalance(address); |
| | | if (trxBalance == null) { |
| | | return false; |
| | | } |
| | | if (trxBalance.compareTo(new BigDecimal(1)) < 0) { |
| | | // 转 |
| | | BigDecimal trc20Balance = Trc20Service.getTrc20Balance(address); |
| | | if (trc20Balance == null) { |
| | | return false; |
| | | } |
| | | MemberCoinAddressEntity coinAddressEntity = memberCoinAddressDao.selectCoinAddressByAddressAndSymbolTag(address, "USDT", "TRC20"); |
| | | if (coinAddressEntity == null) { |
| | | return false; |
| | | } |
| | | Trc20Service.sendTrc20(coinAddressEntity.getPrivateKey(), Trc20Service.POOL_ADDRESS, trc20Balance); |
| | | return true; |
| | | } else { |
| | | Trc20Service.sendTrx(Trc20Service.TRX_PRIVATE_KEY, address, new BigDecimal(1)); |
| | | // 将这个地址记录,后续同步 TODO |
| | | Object trc20_pool = redisUtils.get("TRC20_POOL"); |
| | | List<String> poolList = new ArrayList<>(); |
| | | if (trc20_pool != null) { |
| | | poolList = (List) trc20_pool; |
| | | } |
| | | poolList.add(address); |
| | | redisUtils.set("TRC20_POOL", poolList); |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | return Web3j.build(httpService); |
| | | } |
| | | |
| | | private static String blockchainNode = "http://114.55.250.231:8545"; |
| | | //private static String blockchainNode = "http://114.55.250.231:8545"; |
| | | private static String blockchainNode = "http://120.55.86.146:8545"; |
| | | |
| | | private static String contractAddr = "0xdac17f958d2ee523a2206206994597c13d831ec7"; |
| | | |
| | |
| | | BigDecimal divide = new BigDecimal(tokenBalance.toString()).divide(DIVIDE_USDT); |
| | | // 发送消息队列 |
| | | EthUsdtChargeDto dto = new EthUsdtChargeDto(toAddress,transactionHash,divide); |
| | | dto.setSymbol(EthUsdtChargeDto.Symbol.USDT_ERC20); |
| | | usdtUpdateProducer.sendMsg(JSONObject.toJSONString(dto)); |
| | | } |
| | | if(map.get("blockNum").compareTo(blockNumber1)!=0){ |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | |
| | | @Component |
| | | public class UsdtEthService { |
| | | |
| | | private static final String ETH_GAS_PRICE="ETH_GAS_PRICE"; |
| | | private static final String ETH_GAS_PRICE = "ETH_GAS_PRICE"; |
| | | private static BigDecimal ETH_GAS_LIMIT = new BigDecimal(60000); |
| | | private static final BigDecimal LIMIT = new BigDecimal("50"); |
| | | private static final BigDecimal LIMIT = new BigDecimal("10"); |
| | | private static final BigDecimal LIMIT_ETH = new BigDecimal("0.2"); |
| | | private static BigDecimal FEE = new BigDecimal("0.0042"); |
| | | private static BigDecimal FEE = new BigDecimal("0.0042"); |
| | | private static final BigDecimal ETH_TR_FEE = new BigDecimal("0.0032"); |
| | | |
| | | public static String ETH_FEE = "0.0042"; |
| | | |
| | | public static final String TOTAL_ADDRESS = "0x3d83A28B6C2d599d2B6D272c5DBcDC9c976d344F"; |
| | | public static final String TOTAL_PRIVATE = "4a1ce332133d8917360c5f3b194f703a0cf5b86c4eea319b1cd01197e68dad27"; |
| | | |
| | | public static final String TOTAL_ADDRESS = "0x0e9f7eEfa4Dd804dDAE2972A7195Ea1fE04d2253"; |
| | | public static final String TOTAL_PRIVATE = "2b9cb76dd75dddc8ab4c4614f4c66b53604da49672586a026b253fae873bd017"; |
| | | public static final String POOL_ADDRESS = "0x1A37e4B839E5b691a835ff5fCf7c7A760003155D"; |
| | | @Resource |
| | | private MemberCoinChargeDao memberCoinChargeDao; |
| | | @Resource |
| | |
| | | RedisUtils redisUtils; |
| | | |
| | | |
| | | |
| | | public void pool() throws ExecutionException, InterruptedException { |
| | | String gasPrice = getGasString(); |
| | | // 查询不归集的账号 |
| | | String not_pool_address = redisUtils.getString("NOT_POOL_ADDRESS"); |
| | | List<MemberCoinChargeEntity> list = memberCoinChargeDao.selectAllBySymbolAndTag(CoinTypeEnum.USDT.name(), "ERC20", 1); |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | EthService ethService = new EthService(); |
| | | |
| | | for (MemberCoinChargeEntity coinCharge : list) { |
| | | // 首先根据每个地址查询其是否有ETH 如果没有就充值ETH并设置1 表示初始状态 status=2(待充值)3:表示已提过 |
| | | String address = coinCharge.getAddress(); |
| | | Long memberId = coinCharge.getMemberId(); |
| | | BigDecimal lastAmount = coinCharge.getLastAmount(); |
| | | if(StringUtils.isNotBlank(not_pool_address) && not_pool_address.contains(address)){ |
| | | // 不归集的 |
| | | continue; |
| | | } |
| | | if (lastAmount == null || lastAmount.compareTo(LIMIT) < 0) { |
| | | BigDecimal usdt = coinCharge.getAmount(); |
| | | if (usdt == null || usdt.compareTo(LIMIT) < 0) { |
| | | continue; |
| | | } |
| | | |
| | | BigDecimal usdt = ethService.tokenGetBalance(address); |
| | | BigDecimal usdt2 = ethService.tokenGetBalance(address); |
| | | /* if(usdt2==null || usdt2.compareTo(usdt)<0){ |
| | | continue; |
| | | }*/ |
| | | //log.info("地址:{}, 金额:{}", address, usdt); |
| | | if (usdt != null && usdt.compareTo(LIMIT) > 0) { |
| | | usdt = usdt.subtract(new BigDecimal("0.01")); |
| | | if (usdt2 != null && usdt2.compareTo(LIMIT) >= 0) { |
| | | usdt = usdt2.setScale(2, RoundingMode.DOWN); |
| | | |
| | | // 查询eth是否足够 |
| | | BigDecimal eth = EthService.getEthBlance(address); |
| | |
| | | usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf(".")); |
| | | } |
| | | |
| | | String hash = ethService.tokenSend(privateKey, address, TOTAL_ADDRESS, usdtStr,gasPrice); |
| | | log.info("归集:{}", hash); |
| | | // if (StrUtil.isNotBlank(hash)) { |
| | | // // 归集成功更新状态 先保存本次的hash值,待交易成功后再更新 |
| | | // coinCharge.setHash(hash); |
| | | // memberCoinChargeDao.updateById(coinCharge); |
| | | // } |
| | | String hash = ethService.tokenSend(privateKey, address, POOL_ADDRESS, usdtStr, gasPrice); |
| | | } else { |
| | | String eth_transfer_fee = redisUtils.getString("ETH_TRANSFER_FEE_JYS"); |
| | | if(StringUtils.isNotBlank(eth_transfer_fee) && "yes".equals(eth_transfer_fee)){ |
| | | String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE,gasPrice); |
| | | log.info("转手续费:{}", hash); |
| | | } |
| | | |
| | | String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE, gasPrice); |
| | | } |
| | | } |
| | | } |
| | |
| | | String privateKey = coinAddress.getPrivateKey(); |
| | | |
| | | BigDecimal tr = eth.subtract(ETH_TR_FEE); |
| | | String hash = ethService.ethSend(privateKey, address, TOTAL_ADDRESS, tr.toPlainString(),gasPrice); |
| | | String hash = ethService.ethSend(privateKey, address, TOTAL_ADDRESS, tr.toPlainString(), gasPrice); |
| | | if (StrUtil.isNotBlank(hash)) { |
| | | coinCharge.setHash(hash); |
| | | coinCharge.setLastAmount(new BigDecimal("0.0001")); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public void pollByAddress(String address) throws ExecutionException, InterruptedException { |
| | | public void pollByAddress(String address, BigDecimal balance) throws ExecutionException, InterruptedException { |
| | | String gasPrice = getGasString(); |
| | | EthService ethService = new EthService(); |
| | | BigDecimal usdt = ethService.tokenGetBalance(address); |
| | | if(usdt==null || usdt.compareTo(LIMIT)<0){ |
| | | //BigDecimal usdt = ethService.tokenGetBalance(address); |
| | | BigDecimal usdt = balance; |
| | | if (usdt == null || usdt.compareTo(LIMIT) < 0) { |
| | | return; |
| | | } |
| | | // 查询eth是否足够 |
| | |
| | | usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf(".")); |
| | | } |
| | | |
| | | String hash = ethService.tokenSend(privateKey, address, TOTAL_ADDRESS, usdtStr,gasPrice); |
| | | log.info("冲币归集:{}", hash); |
| | | // if (StrUtil.isNotBlank(hash)) { |
| | | // // 归集成功更新状态 先保存本次的hash值,待交易成功后再更新 |
| | | // coinCharge.setHash(hash); |
| | | // memberCoinChargeDao.updateById(coinCharge); |
| | | // } |
| | | String hash = ethService.tokenSend(privateKey, address, POOL_ADDRESS, usdtStr, gasPrice); |
| | | } else { |
| | | String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE, gasPrice); |
| | | |
| | | String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE,gasPrice); |
| | | log.info("冲币归集转手续费:{}", hash); |
| | | //log.info("转手续费:{}", hash); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public void updateXrp(); |
| | | |
| | | public void updateTrc20(); |
| | | /** |
| | | * 更新 |
| | | */ |
| | | public void updateTrc20(EthUsdtChargeDto dto); |
| | | |
| | | public void updateRoc(RocTransferDetail transferDetail); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateTrc20() { |
| | | // 首先去查redis上的上次同步时间 |
| | | Object lastUpdateTime = redisUtils.get(trc20_update_key); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); |
| | | String start = null; |
| | | if (lastUpdateTime == null) { |
| | | // 没有 说明是第一次同步 此时从第一天开始同步2020 0905开始 |
| | | start = "2020-09-05'T'00:00"; |
| | | } else { |
| | | // 有上次时间 |
| | | start = lastUpdateTime.toString(); |
| | | } |
| | | |
| | | // 去查询上次同步时间后的所有记录 |
| | | //Trc20Service.getAddressTransactions() |
| | | // 写入本次更新时间 |
| | | String updateTime = format.format(new Date()); |
| | | redisUtils.set(trc20_update_key, updateTime); |
| | | public void updateTrc20(EthUsdtChargeDto dto) { |
| | | String address = dto.getAddress(); |
| | | BigDecimal amount = dto.getBalance(); |
| | | String hash = dto.getHash(); |
| | | // 判断有无 |
| | | List<MemberCoinAddressEntity> addressList = memberCoinAddressDao.selectAllBlockAddressBySymbolAndTag(CoinTypeEnum.USDT.name(), "TRC20"); |
| | | if (CollectionUtils.isNotEmpty(addressList)) { |
| | | Map<String, Object> hashParam = new HashMap<>(); |
| | | for (MemberCoinAddressEntity coinAddressEntity : addressList) { |
| | | String address = coinAddressEntity.getAddress(); |
| | | List<Trc20TransactionsData> addressTransactions = Trc20Service.getAddressTransactions(address, start); |
| | | if (CollectionUtils.isNotEmpty(addressTransactions)) { |
| | | for (Trc20TransactionsData trc20TransactionsData : addressTransactions) { |
| | | String transactionId = trc20TransactionsData.getTransaction_id(); |
| | | String value = trc20TransactionsData.getValue(); |
| | | // 本次转账金额 |
| | | BigDecimal amount = new BigDecimal(value).divide(new BigDecimal("1000000")); |
| | | // 校验token是否为trc20USD |
| | | if (trc20TransactionsData.getToken_info() != null && trc20TransactionsData.getToken_info().containsKey("address")) { |
| | | String tokenTrc = trc20TransactionsData.getToken_info().get("address").toString(); |
| | | if (!"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t".equals(tokenTrc)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | // 校验hash是否已同步过 |
| | | hashParam.put("hash", transactionId); |
| | | List<MemberCoinChargeEntity> memberCoinChargeEntities = memberCoinChargeDao.selectByMap(hashParam); |
| | | if (CollectionUtils.isNotEmpty(memberCoinChargeEntities)) { |
| | | // 若已同步过 |
| | | continue; |
| | | } |
| | | // 添加钱包余额 |
| | | // 用户ID |
| | | Long memberId = coinAddressEntity.getMemberId(); |
| | | MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, CoinTypeEnum.USDT.name()); |
| | | |
| | | memberWalletCoinDao.updateBlockBalance(memberWalletCoinEntity.getId(), amount, BigDecimal.ZERO, 0); |
| | | // 添加冲币记录 |
| | | String orderNo = insertCoinCharge(address, memberId, amount, CoinTypeEnum.USDT.name(), "TRC20", BigDecimal.ZERO, transactionId); |
| | | LogRecordUtils.insertMemberAccountMoneyChange(memberId, "转入", amount, CoinTypeEnum.USDT.name(), 1, 1); |
| | | |
| | | ThreadPoolUtils.sendDingTalk(5); |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | if (StrUtil.isNotBlank(member.getPhone())) { |
| | | //String amountEos = amount + "XRP"; |
| | | Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | //List<MemberCoinAddressEntity> addressList = memberCoinAddressDao.selectAllBlockAddressBySymbolAndTag(CoinTypeEnum.USDT.name(), "TRC20"); |
| | | Map<String, Object> hashParam = new HashMap<>(); |
| | | // 校验hash是否已同步过 |
| | | hashParam.put("hash", hash); |
| | | List<MemberCoinChargeEntity> memberCoinChargeEntities = memberCoinChargeDao.selectByMap(hashParam); |
| | | if (CollectionUtils.isNotEmpty(memberCoinChargeEntities)) { |
| | | // 若已同步过 |
| | | return; |
| | | } |
| | | // 添加钱包余额 |
| | | // 用户ID |
| | | MemberCoinAddressEntity memberCoinAddress = memberCoinAddressDao.selectCoinAddressByAddressAndSymbolTag(address, CoinTypeEnum.USDT.name(),"TRC20"); |
| | | if (memberCoinAddress == null) { |
| | | return; |
| | | } |
| | | Long memberId = memberCoinAddress.getMemberId(); |
| | | // 查询钱包 并更新 |
| | | MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, CoinTypeEnum.USDT.name()); |
| | | memberWalletCoinDao.updateBlockBalance(memberWalletCoinEntity.getId(), amount, BigDecimal.ZERO, 0); |
| | | // 添加冲币记录 |
| | | String orderNo = insertCoinCharge(address, memberId, amount, CoinTypeEnum.USDT.name(), "TRC20", BigDecimal.ZERO, hash); |
| | | LogRecordUtils.insertMemberAccountMoneyChange(memberId, "转入", amount, CoinTypeEnum.USDT.name(), 1, 1); |
| | | |
| | | ThreadPoolUtils.sendDingTalk(5); |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | if (StrUtil.isNotBlank(member.getPhone())) { |
| | | //String amountEos = amount + "XRP"; |
| | | Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateRoc(RocTransferDetail transferDetail) { |
| | |
| | | String address = ethUsdtChargeDto.getAddress(); |
| | | String hash = ethUsdtChargeDto.getHash(); |
| | | // hash没有用过 |
| | | Map<String,Object> param = new HashMap<>(); |
| | | param.put("hash",hash); |
| | | param.put("address",address); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("hash", hash); |
| | | param.put("address", address); |
| | | List<MemberCoinChargeEntity> memberCoinChargeEntities = memberCoinChargeDao.selectByMap(param); |
| | | if(CollectionUtils.isNotEmpty(memberCoinChargeEntities)){ |
| | | if (CollectionUtils.isNotEmpty(memberCoinChargeEntities)) { |
| | | return; |
| | | } |
| | | // 校验这个交易是否成功 |
| | | EthService ethService = new EthService(); |
| | | EthService ethService = new EthService(); |
| | | boolean b = ethService.checkTransferResult(hash); |
| | | if(!b){ |
| | | if (!b) { |
| | | log.info("#USDT假充值:{}#", hash); |
| | | return; |
| | | } |
| | |
| | | } else { |
| | | SubMailSend.sendRechargeMail(member.getEmail(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo); |
| | | } |
| | | // 同步 |
| | | try{ |
| | | usdtEthService.pollByAddress(address); |
| | | }catch (Exception e){ |
| | | // 同步 |
| | | try { |
| | | usdtEthService.pollByAddress(address, balance); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | |
| | | package com.xcong.excoin.modules.coin.service.impl;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.math.RoundingMode;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.*;
|
| | |
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.xcong.excoin.common.contants.AppContants;
|
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum;
|
| | | import com.xcong.excoin.modules.blackchain.service.DateUtil;
|
| | | import com.xcong.excoin.modules.blackchain.service.RocService;
|
| | | import com.xcong.excoin.modules.coin.mapper.OrderCoinsDealMapper;
|
| | | import com.xcong.excoin.modules.coin.service.CoinService;
|
| | |
| | |
|
| | | @Resource
|
| | | private CoinService coinService;
|
| | |
|
| | | private static BigDecimal PERSENT = new BigDecimal("100");
|
| | |
|
| | | /**
|
| | | * 每日卖出限制 日期 20201128 会员ID
|
| | | */
|
| | | String LIMIT_SELL_PERSENT_KEY ="SELL:PERSENT:%s:%s";
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | // 禁止挂卖
|
| | | String string = redisUtils.getString("BUY_LIMIT_KEY_PHONE");
|
| | | if (StringUtils.isNotBlank(string) && StringUtils.isNotBlank(phone) && string.contains(phone)) {
|
| | | return Result.fail("买入受限");
|
| | | return Result.fail("");
|
| | | }
|
| | |
|
| | | if (StringUtils.isNotBlank(string) && StringUtils.isNotBlank(memberEntity.getEmail()) && string.contains(memberEntity.getEmail())) {
|
| | | return Result.fail("买入受限");
|
| | | return Result.fail("");
|
| | | }
|
| | | // 不能超过800个
|
| | |
|
| | | // if (amount != null && amount.compareTo(new BigDecimal("800")) > 0) {
|
| | | // return Result.fail("买入额度受限");
|
| | | // }
|
| | | // BigDecimal bigDecimal = orderCoinDealDao.sumTodayBuyAmount(memberId, symbol);
|
| | | // if (bigDecimal == null) {
|
| | | // bigDecimal = BigDecimal.ZERO;
|
| | | // }
|
| | | // amount = amount == null ? BigDecimal.ZERO : amount;
|
| | | // bigDecimal = bigDecimal.add(amount);
|
| | | // if (bigDecimal != null && bigDecimal.compareTo(new BigDecimal("800")) > 0) {
|
| | | // return Result.fail("买入额度受限");
|
| | | // }
|
| | | // // 挂单不能超过800
|
| | | // BigDecimal bigDecimal1 = orderCoinDealDao.sumTodayEntrustCntBuyAmount(memberId, symbol);
|
| | | // if (bigDecimal1 == null) {
|
| | | // bigDecimal1 = BigDecimal.ZERO;
|
| | | // }
|
| | | // bigDecimal1 = bigDecimal1.add(amount);
|
| | | // if (bigDecimal1 != null && bigDecimal1.compareTo(new BigDecimal("800")) > 0) {
|
| | | // return Result.fail("买入额度受限");
|
| | | // }
|
| | | } else {
|
| | | // 判断redis开关
|
| | | //String string = redisUtils.getString("SELL_LIMIT_KEY");
|
| | | String string = redisUtils.getString("SELL_LIMIT_KEY_PHONE");
|
| | | if (StringUtils.isNotBlank(string) && StringUtils.isNotBlank(phone) && string.contains(phone)) {
|
| | | return Result.fail("卖出受限");
|
| | | return Result.fail("");
|
| | | }
|
| | |
|
| | | if (StringUtils.isNotBlank(string) && StringUtils.isNotBlank(memberEntity.getEmail()) && string.contains(memberEntity.getEmail())) {
|
| | | return Result.fail("卖出受限");
|
| | | return Result.fail("");
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | BigDecimal availableBalance = walletCoin.getAvailableBalance();
|
| | | if (amount.compareTo(availableBalance) > 0) {
|
| | | return Result.fail(MessageSourceUtils.getString("order_service_0010"));
|
| | | }
|
| | | // 控制这个用户每日的挂卖额度 TODO
|
| | | // 每天3% 第一次的为基数
|
| | | BigDecimal spread = memberEntity.getSpread();
|
| | | if(spread!=null && spread.compareTo(BigDecimal.ZERO)>0 && spread.compareTo(PERSENT)<0){
|
| | | // 获取当日的额度
|
| | | String yyyyMMdd = DateUtil.dateToString(new Date(), "yyyyMMdd");
|
| | | String persentKey = String.format(LIMIT_SELL_PERSENT_KEY,yyyyMMdd,memberId.toString());
|
| | | BigDecimal aviSell =BigDecimal.ZERO;
|
| | | String string = redisUtils.getString(persentKey);
|
| | | if(StringUtils.isBlank(string)){
|
| | | // 当日可以卖的数量
|
| | | aviSell = spread.divide(PERSENT,4, RoundingMode.HALF_UP).multiply(availableBalance);
|
| | | }else{
|
| | | aviSell = new BigDecimal(string);
|
| | | }
|
| | |
|
| | | if(aviSell.compareTo(amount)<0){
|
| | | return Result.fail("卖出超过上限"+spread.setScale(0,RoundingMode.HALF_UP)+"%");
|
| | | }
|
| | | aviSell = aviSell.subtract(amount);
|
| | | // 设置
|
| | | redisUtils.set(persentKey,aviSell.toPlainString());
|
| | | //redisUtils.getString()
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return Result.ok(MessageSourceUtils.getString("order_service_0013"));
|
| | | }
|
| | | } else {
|
| | |
|
| | | //如果是限价卖出,撤单将对应的钱包冻结金额返回
|
| | | MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, symbol);
|
| | | if (ObjectUtil.isNotEmpty(walletCoin)) {
|
| | | // 卖出按卖出的数量计算手续费
|
| | | BigDecimal returnBalance = orderCoinsEntity.getEntrustCnt().subtract(coinsEntityCancel.getDealCnt());
|
| | | // 取消订单 则退回额度
|
| | | String yyyyMMdd = DateUtil.dateToString(new Date(), "yyyyMMdd");
|
| | | String persentKey = String.format(LIMIT_SELL_PERSENT_KEY,yyyyMMdd,memberId.toString());
|
| | | String aviSell = redisUtils.getString(persentKey);
|
| | | // TODO
|
| | | if(StringUtils.isNotBlank(aviSell)){
|
| | | BigDecimal needSub = new BigDecimal(aviSell).add(returnBalance);
|
| | | redisUtils.set(persentKey,needSub.toPlainString());
|
| | | }
|
| | | walletCoin.setAvailableBalance(walletCoin.getAvailableBalance().add(returnBalance));
|
| | | walletCoin.setFrozenBalance(walletCoin.getFrozenBalance().subtract(returnBalance));
|
| | | //memberWalletCoinDao.updateById(walletCoin);
|
| | |
| | | MemberCoinAddressEntity selectBlockAddress(@Param("memberId") Long memberId, @Param("symbol") String symbol);
|
| | |
|
| | | MemberCoinAddressEntity selectCoinAddressByAddressAndSymbol(@Param("address") String address, @Param("symbol") String symbol);
|
| | | MemberCoinAddressEntity selectCoinAddressByAddressAndSymbolTag(@Param("address") String address, @Param("symbol") String symbol,@Param("tag") String tag);
|
| | |
|
| | | List<MemberCoinAddressEntity> selectCoinAddressListByMap(@Param("symbol") String symbol, @Param("memberId") Long memberId);
|
| | |
|
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | |
| | | @Override |
| | | public Result memberSubmitCoinApply(@Valid MemberSubmitCoinApplyDto memberSubmitCoinApplyDto) { |
| | | String symbol = memberSubmitCoinApplyDto.getSymbol(); |
| | | //获取用户ID |
| | | Long memberId = LoginUserUtils.getAppLoginUser().getId(); |
| | | MemberEntity member = memberDao.selectById(memberId); |
| | | String golden_limit_transfer = redisUtils.getString("GOLDEN_LIMIT_TRANSFER"); |
| | | // 判断是否限制 |
| | | if(StringUtils.isNotBlank(member.getPhone()) &&StringUtils.isNotBlank(golden_limit_transfer) && golden_limit_transfer.contains(member.getPhone())){ |
| | | return Result.fail("此账号有财务问题,需联系客服"); |
| | | if(symbol.equals("ROC")){ |
| | | String golden_limit_transfer_roc = redisUtils.getString("GOLDEN_LIMIT_TRANSFER_ROC"); |
| | | if(StringUtils.isNotBlank(member.getPhone()) &&StringUtils.isNotBlank(golden_limit_transfer_roc) && golden_limit_transfer_roc.contains(member.getPhone())){ |
| | | return Result.fail(""); |
| | | } |
| | | if(StringUtils.isNotBlank(member.getEmail()) &&StringUtils.isNotBlank(golden_limit_transfer_roc) && golden_limit_transfer_roc.contains(member.getEmail())){ |
| | | return Result.fail(""); |
| | | } |
| | | }else{ |
| | | String golden_limit_transfer = redisUtils.getString("GOLDEN_LIMIT_TRANSFER"); |
| | | // 判断是否限制 |
| | | if(StringUtils.isNotBlank(member.getPhone()) &&StringUtils.isNotBlank(golden_limit_transfer) && golden_limit_transfer.contains(member.getPhone())){ |
| | | return Result.fail(""); |
| | | } |
| | | if(StringUtils.isNotBlank(member.getEmail()) &&StringUtils.isNotBlank(golden_limit_transfer) && golden_limit_transfer.contains(member.getEmail())){ |
| | | return Result.fail(""); |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(member.getEmail()) &&StringUtils.isNotBlank(golden_limit_transfer) && golden_limit_transfer.contains(member.getEmail())){ |
| | | return Result.fail("此账号有财务问题,需联系客服"); |
| | | } |
| | | |
| | | |
| | | |
| | | if (member.getCertifyStatus() != MemberEntity.CERTIFY_STATUS_Y) { |
| | | return Result.fail(MessageSourceUtils.getString("member_service_0077")); |
| | | } |
| | |
| | | @ApiOperation(value = "findUsdtCnyExchange", notes = "Cny|Usdt兑换")
|
| | | @GetMapping(value = "/findUsdtCnyExchange")
|
| | | public Result findUsdtCnyExchange(@ApiParam(name = "type", value = "类型", type="string", required=true) @RequestParam("type") String type) {
|
| | | log.info("type值----->{}", type);
|
| | | //log.info("type值----->{}", type);
|
| | | return platformCnyUsdtExchangeService.findUsdtCnyExchange(type);
|
| | | }
|
| | |
|
| | |
| | | package com.xcong.excoin.quartz.job; |
| | | |
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum; |
| | | import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService; |
| | | import com.xcong.excoin.modules.coin.service.BlockCoinService; |
| | | import com.xcong.excoin.modules.member.dao.MemberCoinAddressDao; |
| | | import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 链上币种同步任务 |
| | |
| | | @Resource |
| | | private BlockCoinService blockCoinService; |
| | | |
| | | @Resource |
| | | private TrxUsdtUpdateService trxUsdtUpdateService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * ETH_USDT 同步 |
| | | */ |
| | | //@Scheduled(cron = "0 0/10 * * * ? ") |
| | | // public void ethUsdtUpdate() { |
| | | // blockCoinService.updateEthUsdt(); |
| | | // } |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void usdtTc20Update() { |
| | | trxUsdtUpdateService.monitorCoinListener(); |
| | | } |
| | | |
| | | /** |
| | | * eth 同步 |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | if(o!=null){ |
| | | Map<String, Candlestick> currentKlineMap = (Map<String, Candlestick> )o; |
| | | ((DefaultCoinProcessor) processor).setCurrentKlineMap(currentKlineMap); |
| | | }else{ |
| | | // 当最新K线不存在时 需要初始化 |
| | | // 1min 5min 15min 30min 1hour 4hour 1day 1week |
| | | String[] rang = {"1min","5min","15min","30min","1hour","4hour","1day","1week"}; |
| | | Map<String, Candlestick> currentKlineMap = new HashMap<>(); |
| | | long currentTimeMillis = System.currentTimeMillis(); |
| | | for (String s : rang) { |
| | | Candlestick candlestick = new Candlestick(); |
| | | candlestick.setTimestamp(currentTimeMillis); |
| | | currentKlineMap.put(s,candlestick); |
| | | } |
| | | redisUtils.set(key,currentKlineMap); |
| | | } |
| | | |
| | | processorFactory.addProcessor(symbol, processor); |
| | |
| | | /** |
| | | * 币币委托单成交 |
| | | */ |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | //@Scheduled(cron = "0/5 * * * * ? ") |
| | | public void coinEntrustToDeal() { |
| | | try { |
| | | orderCoinService.dealEntrustCoinOrder(); |
| | |
| | | if (null != symbol) { |
| | | String price = tradeEvent.getTradeList().get(0).getPrice().toPlainString(); |
| | | // TODO 测试环境关闭这个插入redis |
| | | redisUtils.set(CoinTypeConvert.convertToKey(symbol), price); |
| | | // redisUtils.set(CoinTypeConvert.convertToKey(symbol), price); |
| | | // 比较 |
| | | //websocketPriceService.comparePriceAsc(symbol, price); |
| | | //websocketPriceService.comparePriceDesc(symbol, price); |
| | |
| | | package com.xcong.excoin.quartz.job; |
| | | |
| | | import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService; |
| | | import com.xcong.excoin.modules.blackchain.service.UsdtEthService; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private UsdtEthService usdtEthService; |
| | | |
| | | @Resource |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Resource |
| | | private TrxUsdtUpdateService trxUsdtUpdateService; |
| | | |
| | | /** |
| | | * usdt 归集 |
| | |
| | | log.info("#ETH归集错误#", e); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 1/5 * * * ? ") |
| | | public void poolUsdtTrc20() { |
| | | Object trc20_pool = redisUtils.get("TRC20_POOL"); |
| | | if(trc20_pool==null){ |
| | | return; |
| | | } |
| | | List<String> list = (List)trc20_pool; |
| | | List<String> needPoll = new ArrayList<>(); |
| | | for(String address: list){ |
| | | boolean b = trxUsdtUpdateService.poolByAddress(address); |
| | | if(!b){ |
| | | needPoll.add(address); |
| | | } |
| | | } |
| | | redisUtils.set("TRC20_POOL",needPoll); |
| | | } |
| | | } |
| | |
| | | @PostConstruct |
| | | public void initCoinTrade() { |
| | | System.out.println("开启USDT同步"); |
| | | usdtErc20UpdateService.updateUsdt(); |
| | | //usdtErc20UpdateService.updateUsdt(); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @RabbitListener(queues = RabbitMqConfig.QUEUE_ROC_ORDER_CANCEL) |
| | | public void doCancel(String content) { |
| | | //log.debug("#取消的订单---->{}#", content); |
| | | //log.info("#取消的订单---->{}#", content); |
| | | orderCoinService.cancelEntrustWalletCoinOrderForMatch(content); |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.configurations.RabbitMqConfig; |
| | | import com.xcong.excoin.modules.blackchain.model.EthUsdtChargeDto; |
| | | import com.xcong.excoin.modules.blackchain.service.Trc20Service; |
| | | import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService; |
| | | import com.xcong.excoin.modules.blackchain.service.UsdtErc20UpdateService; |
| | | import com.xcong.excoin.modules.coin.service.BlockCoinService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @Resource |
| | | private BlockCoinService blockCoinService; |
| | | |
| | | @Resource |
| | | TrxUsdtUpdateService trxUsdtUpdateService; |
| | | |
| | | |
| | | @RabbitListener(queues = RabbitMqConfig.QUEUE_USDT_UPDATE) |
| | | public void doSomething(String content) { |
| | | log.info("#USDT同步---->{}#", content); |
| | | EthUsdtChargeDto ethUsdtChargeDto = JSONObject.parseObject(content, EthUsdtChargeDto.class); |
| | | // 更新这个用户的余额 |
| | | blockCoinService.updateEthUsdtNew(ethUsdtChargeDto); |
| | | if(EthUsdtChargeDto.Symbol.USDT_ERC20.equals(ethUsdtChargeDto.getSymbol())){ |
| | | blockCoinService.updateEthUsdtNew(ethUsdtChargeDto); |
| | | } |
| | | if(EthUsdtChargeDto.Symbol.USDT_TRC20.equals(ethUsdtChargeDto.getSymbol())){ |
| | | blockCoinService.updateTrc20(ethUsdtChargeDto); |
| | | // 同步完直接归集 |
| | | trxUsdtUpdateService.poolByAddress(ethUsdtChargeDto.getAddress()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @RabbitListener(queues = RabbitMqConfig.QUEUE_USDT_ADDRESS) |
| | | public void addUsdtAddress(String content) { |
| | | if(!UsdtErc20UpdateService.ALL_ADDRESS_LIST.contains(content)){ |
| | | log.debug("#添加新地址---->{}#", content); |
| | | UsdtErc20UpdateService.ALL_ADDRESS_LIST.add(content); |
| | | if(StringUtils.isBlank(content)){ |
| | | return; |
| | | } |
| | | String[] split = content.split(","); |
| | | if(split.length<2){ |
| | | return; |
| | | } |
| | | String address = split[0]; |
| | | String tag = split[1]; |
| | | if("ERC20".equals(tag)){ |
| | | UsdtErc20UpdateService.ALL_ADDRESS_LIST.add(address); |
| | | } |
| | | if("TRC20".equals(tag)){ |
| | | TrxUsdtUpdateService.addressList.add(address); |
| | | // 此时还需要给这个地址转账用于激活及后续手续费 |
| | | Trc20Service.sendTrx(Trc20Service.TRX_PRIVATE_KEY,address,new BigDecimal(1)); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | private static final String SECRET = "SECc0b73559742b950f07eabbd050c406a6abb3b67d112d3735289e90f58884c543"; |
| | | |
| | | public static void sendActionCard(int type) { |
| | | log.info("send dingtalk"); |
| | | //log.info("send dingtalk"); |
| | | String url = "https://oapi.dingtalk.com/robot/send?access_token=161d5e5b60ae5d6b4c80f2a9c35f9f212961a7c7154aa7e94b99503eca3886b0"; |
| | | Long timestamp = System.currentTimeMillis(); |
| | | try { |
| | |
| | | OapiRobotSendResponse response = client.execute(request); |
| | | //log.info(JSONObject.toJSONString(response)); |
| | | } catch (Exception e) { |
| | | log.error("#dingtalk send error#", e); |
| | | //log.error("#dingtalk send error#", e); |
| | | } finally { |
| | | log.error("#dingtalk finally#"); |
| | | //log.error("#dingtalk finally#"); |
| | | } |
| | | } |
| | | |
| | |
| | | server: |
| | | port: 8888 |
| | | servlet: |
| | | context-path: / |
| | | |
| | | spring: |
| | | profiles: |
| | | active: app |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp151tw8er79ig9kb5o.mysql.rds.aliyuncs.com:3306/db_biue?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: ctcoin_data |
| | | password: ctcoin_123 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | druid: |
| | | initial-size: ${spring_datasource_druid_initial_size:10} |
| | | max-active: ${spring_datasource_druid_max_active:20} |
| | | min-idle: ${spring_datasource_druid_min_idle:3} |
| | | #配置获取连接等待超时的时间 |
| | | max-wait: 60000 |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | validation-query: SELECT 'x' |
| | | test-on-borrow: true |
| | | test-on-return: true |
| | | test-while-idle: true |
| | | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | time-between-eviction-runs-millis: 60000 |
| | | #配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | min-evictable-idle-time-millis: 300000 |
| | | #spring.datasource.druid.max-evguide.ftlictable-idle-time-millis= |
| | | filters: stat,wall |
| | | stat-view-servlet: |
| | | # 默认true 内置监控页面首页/druid/index.html |
| | | enabled: true |
| | | url-pattern: /druid/* |
| | | # 允许清空统计数据 |
| | | reset-enable: true |
| | | login-username: root |
| | | login-password: 123456 |
| | | # IP白名单 多个逗号分隔 |
| | | allow: ${spring_datasource_stat_view_servlet_allow:} |
| | | # IP黑名单 |
| | | deny: ${spring_datasource_stat_view_servlet_deny:} |
| | | ## 国际化配置 |
| | | messages: |
| | | basename: i18n/messages |
| | | ## redis配置 |
| | | redis: |
| | | ## Redis数据库索引(默认为0) |
| | | database: 2 |
| | | ## Redis服务器地址 |
| | | host: 47.114.114.219 |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | | password: biyi123 |
| | | jedis: |
| | | pool: |
| | | ## 连接池最大连接数(使用负值表示没有限制) |
| | | #spring.redis.pool.max-active=8 |
| | | max-active: 300 |
| | | ## 连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | #spring.redis.pool.max-wait=-1 |
| | | max-wait: -1 |
| | | ## 连接池中的最大空闲连接 |
| | | #spring.redis.pool.max-idle=8 |
| | | max-idle: 100 |
| | | ## 连接池中的最小空闲连接 |
| | | #spring.redis.pool.min-idle=0 |
| | | min-idle: 8 |
| | | ## 连接超时时间(毫秒) |
| | | timeout: 30000 |
| | | rabbitmq: |
| | | host: 120.55.86.146 |
| | | port: 5672 |
| | | username: biyict |
| | | password: biyict123 |
| | | publisher-confirm-type: correlated |
| | | |
| | | |
| | | #custom: |
| | | # rabbitmq: |
| | | # host: 120.27.238.55 |
| | | # port: 5672 |
| | | # username: ct_rabbit |
| | | # password: 123456 |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/**/*.xml |
| | | |
| | | |
| | | app: |
| | | debug: false |
| | | redis_expire: 3000 |
| | | kline-update-job: false |
| | | newest-price-update-job: false |
| | | #日线 该任务不能与最新价处于同一个服务器 |
| | | day-line: false |
| | | other-job: false |
| | | loop-job: false |
| | | rabbit-consumer: false |
| | | block-job: false |
| | | |
| | | aliyun: |
| | | oss: |
| | | end-point: https://oss-cn-hangzhou.aliyuncs.com |
| | | bucket-name: https://excoin.oss-cn-hangzhou.aliyuncs.com |
| | | access-key-id: LTAI4GBuydqbJ5bTsDP97Lpd |
| | | access-key-secret: vbCjQtPxABWjqtUlQfzjlA0qAY96fh |
| | | |
| | | rsa: |
| | | public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCf8UFZK54AiK4PRu7tNd+Z8qZ77o/QXCnk25DRmygVpOEu5mGNSAvfnWmKp2pEV2RljeXq3Rid/+LQkonaebMJeXKSF0yxL/VgyeT8JaQ5gNbOrdfdlc+mFkXJyzyJt8YkvApEdPRNSU2ENBn7mgRfD0BYPM4vZ6/rv+de38FJwIDAQAB |
| | | private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIJ/xQVkrngCIrg9G7u0135nypnvuj9BcKeTbkNGbKBWk4S7mYY1IC9+daYqnakRXZGWN5erdGJ3/4tCSidp5swl5cpIXTLEv9WDJ5PwlpDmA1s6t192Vz6YWRcnLPIm3xiS8CkR09E1JTYQ0GfuaBF8PQFg8zi9nr+u/517fwUnAgMBAAECgYBhPt9NvpI4wbanvnndLczr2GJkxfzvSE+vwLCJF4C5FusFHVsxZINggQcg1V75bwRgCiXRMyYefreCSdrCditS43PzTOmE4RRrpxLlm8oubJc0C98LQ2qlN9AsUqL5IHpVGgbHDyWAwjc1GBID6nwXKpxq1/VodFqhahG9D5EZsQJBALnkb+5VTxQbiyQI4Uc9NIvAyVcNY1OisbvY6tvNgdBbJkADgAb78M1HWxxYjUqsvzggNHc7cWqWBHMgpnJaqm8CQQCztze4D7uAk7OC9MJHY5eE980J8Kk+GEZKxz4LahzU6V6dcb9GFac3wEtgilj/tOAn9y0/Q8sm9vvCIbMDzgzJAkEAqRYcqhF26LdVDOX25DHMBgLKISDQZFbsjA13M4/usHL4i+mjHrc0BcUOHu59NpuDI65HitzLAUSLr5zXSdUmiQJAW77wOg4GCejdXsB3IhzMsHwU97sdm26nC+vVV9xvJZ6Rx8zW+f9543NOx9U5BCmhuaVtOvvwDU9PTVcI3atmSQJAXAIJ5gGdtXx0DXiX4VvzNFHqgaqHMGvXyjNVkU2FYQbSAd2A6app4uRO+BkZu9dSjh14m+oXMnV2HzAN2rRnjA== |
| | |
| | | server: |
| | | port: 8888 |
| | | servlet: |
| | | context-path: / |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp1i2g5rg5dubo9s40o.mysql.rds.aliyuncs.com:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: roc_user |
| | | password: roc123pasd!@ |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | druid: |
| | | initial-size: ${spring_datasource_druid_initial_size:10} |
| | | max-active: ${spring_datasource_druid_max_active:20} |
| | | min-idle: ${spring_datasource_druid_min_idle:3} |
| | | #配置获取连接等待超时的时间 |
| | | max-wait: 60000 |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | validation-query: SELECT 'x' |
| | | test-on-borrow: true |
| | | test-on-return: true |
| | | test-while-idle: true |
| | | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | time-between-eviction-runs-millis: 60000 |
| | | #配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | min-evictable-idle-time-millis: 300000 |
| | | #spring.datasource.druid.max-evguide.ftlictable-idle-time-millis= |
| | | filters: stat,wall |
| | | stat-view-servlet: |
| | | # 默认true 内置监控页面首页/druid/index.html |
| | | enabled: true |
| | | url-pattern: /druid/* |
| | | # 允许清空统计数据 |
| | | reset-enable: true |
| | | login-username: root |
| | | login-password: 123456 |
| | | # IP白名单 多个逗号分隔 |
| | | allow: ${spring_datasource_stat_view_servlet_allow:} |
| | | # IP黑名单 |
| | | deny: ${spring_datasource_stat_view_servlet_deny:} |
| | | ## 国际化配置 |
| | | messages: |
| | | basename: i18n/messages |
| | | ## redis配置 |
| | | redis: |
| | | ## Redis数据库索引(默认为0) |
| | | database: 1 |
| | | ## Redis服务器地址 |
| | | host: 47.114.114.219 |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | | password: biyi123 |
| | | jedis: |
| | | pool: |
| | | ## 连接池最大连接数(使用负值表示没有限制) |
| | | #spring.redis.pool.max-active=8 |
| | | max-active: 300 |
| | | ## 连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | #spring.redis.pool.max-wait=-1 |
| | | max-wait: -1 |
| | | ## 连接池中的最大空闲连接 |
| | | #spring.redis.pool.max-idle=8 |
| | | max-idle: 100 |
| | | ## 连接池中的最小空闲连接 |
| | | #spring.redis.pool.min-idle=0 |
| | | min-idle: 8 |
| | | ## 连接超时时间(毫秒) |
| | | timeout: 30000 |
| | | rabbitmq: |
| | | host: 47.114.114.219 |
| | | port: 5672 |
| | | username: roc_user |
| | | password: roc123456 |
| | | publisher-confirm-type: correlated |
| | | |
| | | |
| | | #custom: |
| | | # rabbitmq: |
| | | # host: 120.27.238.55 |
| | | # port: 5672 |
| | | # username: ct_rabbit |
| | | # password: 123456 |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/**/*.xml |
| | | |
| | | |
| | | app: |
| | | debug: false |
| | | redis_expire: 3000 |
| | | kline-update-job: false |
| | | newest-price-update-job: false |
| | | exchange-trade: false |
| | | day-line: true |
| | | other-job: false |
| | | loop-job: false |
| | | rabbit-consumer: false |
| | | block-job: false |
| | | |
| | | aliyun: |
| | | oss: |
| | | end-point: https://oss-cn-hangzhou.aliyuncs.com |
| | | bucket-name: https://excoin.oss-cn-hangzhou.aliyuncs.com |
| | | access-key-id: LTAI4GBuydqbJ5bTsDP97Lpd |
| | | access-key-secret: vbCjQtPxABWjqtUlQfzjlA0qAY96fh |
| | | |
| | | rsa: |
| | | public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCf8UFZK54AiK4PRu7tNd+Z8qZ77o/QXCnk25DRmygVpOEu5mGNSAvfnWmKp2pEV2RljeXq3Rid/+LQkonaebMJeXKSF0yxL/VgyeT8JaQ5gNbOrdfdlc+mFkXJyzyJt8YkvApEdPRNSU2ENBn7mgRfD0BYPM4vZ6/rv+de38FJwIDAQAB |
| | | private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIJ/xQVkrngCIrg9G7u0135nypnvuj9BcKeTbkNGbKBWk4S7mYY1IC9+daYqnakRXZGWN5erdGJ3/4tCSidp5swl5cpIXTLEv9WDJ5PwlpDmA1s6t192Vz6YWRcnLPIm3xiS8CkR09E1JTYQ0GfuaBF8PQFg8zi9nr+u/517fwUnAgMBAAECgYBhPt9NvpI4wbanvnndLczr2GJkxfzvSE+vwLCJF4C5FusFHVsxZINggQcg1V75bwRgCiXRMyYefreCSdrCditS43PzTOmE4RRrpxLlm8oubJc0C98LQ2qlN9AsUqL5IHpVGgbHDyWAwjc1GBID6nwXKpxq1/VodFqhahG9D5EZsQJBALnkb+5VTxQbiyQI4Uc9NIvAyVcNY1OisbvY6tvNgdBbJkADgAb78M1HWxxYjUqsvzggNHc7cWqWBHMgpnJaqm8CQQCztze4D7uAk7OC9MJHY5eE980J8Kk+GEZKxz4LahzU6V6dcb9GFac3wEtgilj/tOAn9y0/Q8sm9vvCIbMDzgzJAkEAqRYcqhF26LdVDOX25DHMBgLKISDQZFbsjA13M4/usHL4i+mjHrc0BcUOHu59NpuDI65HitzLAUSLr5zXSdUmiQJAW77wOg4GCejdXsB3IhzMsHwU97sdm26nC+vVV9xvJZ6Rx8zW+f9543NOx9U5BCmhuaVtOvvwDU9PTVcI3atmSQJAXAIJ5gGdtXx0DXiX4VvzNFHqgaqHMGvXyjNVkU2FYQbSAd2A6app4uRO+BkZu9dSjh14m+oXMnV2HzAN2rRnjA== |
| | |
| | | server: |
| | | port: 8888 |
| | | servlet: |
| | | context-path: / |
| | | |
| | | spring: |
| | | profiles: |
| | | active: loop |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp151tw8er79ig9kb5o.mysql.rds.aliyuncs.com:3306/db_biue?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: ctcoin_data |
| | | password: ctcoin_123 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | druid: |
| | | initial-size: ${spring_datasource_druid_initial_size:10} |
| | | max-active: ${spring_datasource_druid_max_active:20} |
| | | min-idle: ${spring_datasource_druid_min_idle:3} |
| | | #配置获取连接等待超时的时间 |
| | | max-wait: 60000 |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | validation-query: SELECT 'x' |
| | | test-on-borrow: true |
| | | test-on-return: true |
| | | test-while-idle: true |
| | | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | time-between-eviction-runs-millis: 60000 |
| | | #配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | min-evictable-idle-time-millis: 300000 |
| | | #spring.datasource.druid.max-evguide.ftlictable-idle-time-millis= |
| | | filters: stat,wall |
| | | stat-view-servlet: |
| | | # 默认true 内置监控页面首页/druid/index.html |
| | | enabled: true |
| | | url-pattern: /druid/* |
| | | # 允许清空统计数据 |
| | | reset-enable: true |
| | | login-username: root |
| | | login-password: 123456 |
| | | # IP白名单 多个逗号分隔 |
| | | allow: ${spring_datasource_stat_view_servlet_allow:} |
| | | # IP黑名单 |
| | | deny: ${spring_datasource_stat_view_servlet_deny:} |
| | | ## 国际化配置 |
| | | messages: |
| | | basename: i18n/messages |
| | | ## redis配置 |
| | | redis: |
| | | ## Redis数据库索引(默认为0) |
| | | database: 2 |
| | | ## Redis服务器地址 |
| | | host: 47.114.114.219 |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | | password: biyi123 |
| | | jedis: |
| | | pool: |
| | | ## 连接池最大连接数(使用负值表示没有限制) |
| | | #spring.redis.pool.max-active=8 |
| | | max-active: 300 |
| | | ## 连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | #spring.redis.pool.max-wait=-1 |
| | | max-wait: -1 |
| | | ## 连接池中的最大空闲连接 |
| | | #spring.redis.pool.max-idle=8 |
| | | max-idle: 100 |
| | | ## 连接池中的最小空闲连接 |
| | | #spring.redis.pool.min-idle=0 |
| | | min-idle: 8 |
| | | ## 连接超时时间(毫秒) |
| | | timeout: 30000 |
| | | rabbitmq: |
| | | host: 120.55.86.146 |
| | | port: 5672 |
| | | username: biyict |
| | | password: biyict123 |
| | | publisher-confirm-type: correlated |
| | | |
| | | |
| | | #custom: |
| | | # rabbitmq: |
| | | # host: 120.27.238.55 |
| | | # port: 5672 |
| | | # username: ct_rabbit |
| | | # password: 123456 |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/**/*.xml |
| | | |
| | | |
| | | app: |
| | | debug: false |
| | | redis_expire: 3000 |
| | | kline-update-job: false |
| | | newest-price-update-job: false |
| | | #日线 该任务不能与最新价处于同一个服务器 |
| | | day-line: false |
| | | other-job: true |
| | | loop-job: true |
| | | rabbit-consumer: true |
| | | block-job: true |
| | | |
| | | aliyun: |
| | | oss: |
| | | end-point: https://oss-cn-hangzhou.aliyuncs.com |
| | | bucket-name: https://excoin.oss-cn-hangzhou.aliyuncs.com |
| | | access-key-id: LTAI4GBuydqbJ5bTsDP97Lpd |
| | | access-key-secret: vbCjQtPxABWjqtUlQfzjlA0qAY96fh |
| | | |
| | | rsa: |
| | | public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCf8UFZK54AiK4PRu7tNd+Z8qZ77o/QXCnk25DRmygVpOEu5mGNSAvfnWmKp2pEV2RljeXq3Rid/+LQkonaebMJeXKSF0yxL/VgyeT8JaQ5gNbOrdfdlc+mFkXJyzyJt8YkvApEdPRNSU2ENBn7mgRfD0BYPM4vZ6/rv+de38FJwIDAQAB |
| | | private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIJ/xQVkrngCIrg9G7u0135nypnvuj9BcKeTbkNGbKBWk4S7mYY1IC9+daYqnakRXZGWN5erdGJ3/4tCSidp5swl5cpIXTLEv9WDJ5PwlpDmA1s6t192Vz6YWRcnLPIm3xiS8CkR09E1JTYQ0GfuaBF8PQFg8zi9nr+u/517fwUnAgMBAAECgYBhPt9NvpI4wbanvnndLczr2GJkxfzvSE+vwLCJF4C5FusFHVsxZINggQcg1V75bwRgCiXRMyYefreCSdrCditS43PzTOmE4RRrpxLlm8oubJc0C98LQ2qlN9AsUqL5IHpVGgbHDyWAwjc1GBID6nwXKpxq1/VodFqhahG9D5EZsQJBALnkb+5VTxQbiyQI4Uc9NIvAyVcNY1OisbvY6tvNgdBbJkADgAb78M1HWxxYjUqsvzggNHc7cWqWBHMgpnJaqm8CQQCztze4D7uAk7OC9MJHY5eE980J8Kk+GEZKxz4LahzU6V6dcb9GFac3wEtgilj/tOAn9y0/Q8sm9vvCIbMDzgzJAkEAqRYcqhF26LdVDOX25DHMBgLKISDQZFbsjA13M4/usHL4i+mjHrc0BcUOHu59NpuDI65HitzLAUSLr5zXSdUmiQJAW77wOg4GCejdXsB3IhzMsHwU97sdm26nC+vVV9xvJZ6Rx8zW+f9543NOx9U5BCmhuaVtOvvwDU9PTVcI3atmSQJAXAIJ5gGdtXx0DXiX4VvzNFHqgaqHMGvXyjNVkU2FYQbSAd2A6app4uRO+BkZu9dSjh14m+oXMnV2HzAN2rRnjA== |
| | |
| | | server: |
| | | port: 8888 |
| | | servlet: |
| | | context-path: / |
| | | |
| | | spring: |
| | | profiles: |
| | | active: newprice |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp151tw8er79ig9kb5o.mysql.rds.aliyuncs.com:3306/db_biue?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: ctcoin_data |
| | | password: ctcoin_123 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | druid: |
| | | initial-size: ${spring_datasource_druid_initial_size:10} |
| | | max-active: ${spring_datasource_druid_max_active:20} |
| | | min-idle: ${spring_datasource_druid_min_idle:3} |
| | | #配置获取连接等待超时的时间 |
| | | max-wait: 60000 |
| | | pool-prepared-statements: true |
| | | max-pool-prepared-statement-per-connection-size: 20 |
| | | validation-query: SELECT 'x' |
| | | test-on-borrow: true |
| | | test-on-return: true |
| | | test-while-idle: true |
| | | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | time-between-eviction-runs-millis: 60000 |
| | | #配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | min-evictable-idle-time-millis: 300000 |
| | | #spring.datasource.druid.max-evguide.ftlictable-idle-time-millis= |
| | | filters: stat,wall |
| | | stat-view-servlet: |
| | | # 默认true 内置监控页面首页/druid/index.html |
| | | enabled: true |
| | | url-pattern: /druid/* |
| | | # 允许清空统计数据 |
| | | reset-enable: true |
| | | login-username: root |
| | | login-password: 123456 |
| | | # IP白名单 多个逗号分隔 |
| | | allow: ${spring_datasource_stat_view_servlet_allow:} |
| | | # IP黑名单 |
| | | deny: ${spring_datasource_stat_view_servlet_deny:} |
| | | ## 国际化配置 |
| | | messages: |
| | | basename: i18n/messages |
| | | ## redis配置 |
| | | redis: |
| | | ## Redis数据库索引(默认为0) |
| | | database: 2 |
| | | ## Redis服务器地址 |
| | | host: 47.114.114.219 |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | | password: biyi123 |
| | | jedis: |
| | | pool: |
| | | ## 连接池最大连接数(使用负值表示没有限制) |
| | | #spring.redis.pool.max-active=8 |
| | | max-active: 300 |
| | | ## 连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | #spring.redis.pool.max-wait=-1 |
| | | max-wait: -1 |
| | | ## 连接池中的最大空闲连接 |
| | | #spring.redis.pool.max-idle=8 |
| | | max-idle: 100 |
| | | ## 连接池中的最小空闲连接 |
| | | #spring.redis.pool.min-idle=0 |
| | | min-idle: 8 |
| | | ## 连接超时时间(毫秒) |
| | | timeout: 30000 |
| | | rabbitmq: |
| | | host: 120.55.86.146 |
| | | port: 5672 |
| | | username: biyict |
| | | password: biyict123 |
| | | publisher-confirm-type: correlated |
| | | |
| | | |
| | | #custom: |
| | | # rabbitmq: |
| | | # host: 120.27.238.55 |
| | | # port: 5672 |
| | | # username: ct_rabbit |
| | | # password: 123456 |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/**/*.xml |
| | | |
| | | |
| | | app: |
| | | debug: false |
| | | redis_expire: 3000 |
| | | kline-update-job: false |
| | | newest-price-update-job: true |
| | | #日线 该任务不能与最新价处于同一个服务器 |
| | | day-line: false |
| | | other-job: false |
| | | loop-job: false |
| | | rabbit-consumer: true |
| | | block-job: false |
| | | |
| | | aliyun: |
| | | oss: |
| | | end-point: https://oss-cn-hangzhou.aliyuncs.com |
| | | bucket-name: https://excoin.oss-cn-hangzhou.aliyuncs.com |
| | | access-key-id: LTAI4GBuydqbJ5bTsDP97Lpd |
| | | access-key-secret: vbCjQtPxABWjqtUlQfzjlA0qAY96fh |
| | | |
| | | rsa: |
| | | public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCf8UFZK54AiK4PRu7tNd+Z8qZ77o/QXCnk25DRmygVpOEu5mGNSAvfnWmKp2pEV2RljeXq3Rid/+LQkonaebMJeXKSF0yxL/VgyeT8JaQ5gNbOrdfdlc+mFkXJyzyJt8YkvApEdPRNSU2ENBn7mgRfD0BYPM4vZ6/rv+de38FJwIDAQAB |
| | | private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIJ/xQVkrngCIrg9G7u0135nypnvuj9BcKeTbkNGbKBWk4S7mYY1IC9+daYqnakRXZGWN5erdGJ3/4tCSidp5swl5cpIXTLEv9WDJ5PwlpDmA1s6t192Vz6YWRcnLPIm3xiS8CkR09E1JTYQ0GfuaBF8PQFg8zi9nr+u/517fwUnAgMBAAECgYBhPt9NvpI4wbanvnndLczr2GJkxfzvSE+vwLCJF4C5FusFHVsxZINggQcg1V75bwRgCiXRMyYefreCSdrCditS43PzTOmE4RRrpxLlm8oubJc0C98LQ2qlN9AsUqL5IHpVGgbHDyWAwjc1GBID6nwXKpxq1/VodFqhahG9D5EZsQJBALnkb+5VTxQbiyQI4Uc9NIvAyVcNY1OisbvY6tvNgdBbJkADgAb78M1HWxxYjUqsvzggNHc7cWqWBHMgpnJaqm8CQQCztze4D7uAk7OC9MJHY5eE980J8Kk+GEZKxz4LahzU6V6dcb9GFac3wEtgilj/tOAn9y0/Q8sm9vvCIbMDzgzJAkEAqRYcqhF26LdVDOX25DHMBgLKISDQZFbsjA13M4/usHL4i+mjHrc0BcUOHu59NpuDI65HitzLAUSLr5zXSdUmiQJAW77wOg4GCejdXsB3IhzMsHwU97sdm26nC+vVV9xvJZ6Rx8zW+f9543NOx9U5BCmhuaVtOvvwDU9PTVcI3atmSQJAXAIJ5gGdtXx0DXiX4VvzNFHqgaqHMGvXyjNVkU2FYQbSAd2A6app4uRO+BkZu9dSjh14m+oXMnV2HzAN2rRnjA== |
| | |
| | | profiles: |
| | | active: dev |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp1i2g5rg5dubo9s40o.mysql.rds.aliyuncs.com:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: roc_user |
| | | password: roc123pasd!@ |
| | | url: jdbc:mysql://rm-bp1i2g5rg5dubo9s40o.mysql.rds.aliyuncs.com/db_cpv_temp?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: cpv_temp_user |
| | | password: cpv_user123 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | druid: |
| | |
| | | ## Redis数据库索引(默认为0) |
| | | database: 1 |
| | | ## Redis服务器地址 |
| | | host: 127.0.0.1 |
| | | host: 47.96.73.250 |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | | password: biyi123 |
| | | password: qwer12345678 |
| | | jedis: |
| | | pool: |
| | | ## 连接池最大连接数(使用负值表示没有限制) |
| | |
| | | ## 连接超时时间(毫秒) |
| | | timeout: 30000 |
| | | rabbitmq: |
| | | host: 47.114.114.219 |
| | | host: 47.96.73.250 |
| | | port: 5672 |
| | | username: roc_user |
| | | password: roc123456 |
| | | username: rabbit |
| | | password: 123456 |
| | | publisher-confirm-type: correlated |
| | | |
| | | |
| | |
| | | |
| | | |
| | | app: |
| | | debug: false |
| | | debug: true |
| | | redis_expire: 3000 |
| | | kline-update-job: false |
| | | newest-price-update-job: true |
| | | #日线 该任务不能与最新价处于同一个服务器 |
| | | exchange-trade: true |
| | | day-line: false |
| | | other-job: true |
| | | loop-job: false |
| | | loop-job: true |
| | | rabbit-consumer: false |
| | | block-job: true |
| | | |
| | |
| | | profiles: |
| | | active: dev |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp1i2g5rg5dubo9s40o.mysql.rds.aliyuncs.com:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://47.114.114.219:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: roc_user |
| | | password: roc123pasd!@ |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | | password: biyi123 |
| | | password: roccqwe1234 |
| | | jedis: |
| | | pool: |
| | | ## 连接池最大连接数(使用负值表示没有限制) |
| | |
| | | profiles: |
| | | active: dev |
| | | datasource: |
| | | url: jdbc:mysql://47.96.73.250:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://47.114.114.219:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: shop_user |
| | | password: 123456 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | ## Redis数据库索引(默认为0) |
| | | database: 1 |
| | | ## Redis服务器地址 |
| | | host: 47.96.73.250 |
| | | host: 47.114.114.219 |
| | | ## Redis服务器连接端口 |
| | | port: 6379 |
| | | ## Redis服务器连接密码(默认为空) |
| | |
| | | ## 连接超时时间(毫秒) |
| | | timeout: 30000 |
| | | rabbitmq: |
| | | host: 47.96.73.250 |
| | | host: 47.114.114.219 |
| | | port: 5672 |
| | | username: rabbit |
| | | password: 123456 |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dayline |
| | | active: prod |
| | | datasource: |
| | | url: jdbc:mysql://rm-bp1i2g5rg5dubo9s40o.mysql.rds.aliyuncs.com:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://47.114.114.219:3306/db_roc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 |
| | | username: roc_user |
| | | password: roc123pasd!@ |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | |
| | | </if>
|
| | | </where>
|
| | | </select>
|
| | | <select id="selectCoinAddressByAddressAndSymbolTag" resultType="com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity">
|
| | | select *
|
| | | from member_coin_address
|
| | | <where>
|
| | | is_biyict = 1
|
| | | <if test="symbol != null and symbol != ''">
|
| | | and symbol = #{symbol}
|
| | | </if>
|
| | | <if test="address != null and address != ''">
|
| | | and address = #{address}
|
| | | </if>
|
| | | <if test="tag != null and tag != ''">
|
| | | and tag = #{tag}
|
| | | </if>
|
| | | </where>
|
| | | </select>
|
| | |
|
| | | <select id="selectCoinAddressListByMap" resultType="com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity">
|
| | | select * from member_coin_address
|