记得上下班打卡 | git大法好,push需谨慎

Commit 759f7ec0 authored by jiangxiulong's avatar jiangxiulong

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

parents 4910e235 9c126631
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-api</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-dragon-api</artifactId>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-dragon-do</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
package com.liquidnet.service.dragon.constant;
public class DragonConstant {
}
package com.liquidnet.service.dragon.service;
public interface IDragonOrderRefundsService {
}
package com.liquidnet.service.dragon.service;
public interface IDragonOrdersService {
}
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<modules> <modules>
<module>liquidnet-service-adam-api</module> <module>liquidnet-service-adam-api</module>
<module>liquidnet-service-kylin-api</module> <module>liquidnet-service-kylin-api</module>
<module>liquidnet-bus-dragon-api</module>
</modules> </modules>
<dependencies> <dependencies>
<dependency> <dependency>
......
liquidnet:
system:
updating:
switch: false
info:
port: 9007
context:
# context: /service-consumer
name: liquidnet-service-consumer-dragon
logfile:
path: /data/logs
name: service-consumer-dragon
config: classpath:logback-spring.xml
file-max-size: 200MB
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level-root: debug
rabbitmq:
connection-timeout: 5000
mysql:
database-name: dev_ln_scene
mongodb:
sslEnabled: false
database: dev_ln_scene
#以下为spring各环境个性配置
\ No newline at end of file
liquidnet:
system:
updating:
switch: false
info:
port: 9007
context:
# context: /service-consumer
name: liquidnet-service-consumer-dragon
logfile:
path: /data/logs
name: service-consumer-dragon
config: classpath:logback-spring.xml
file-max-size: 200MB
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level-root: debug
rabbitmq:
connection-timeout: 3000
mysql:
database-name: test_ln_scene
mongodb:
sslEnabled: false
database: test_ln_scene
#以下为spring各环境个性配置
server:
port: ${liquidnet.info.port}
tomcat:
uri-encoding: UTF-8
servlet:
context-path: ${liquidnet.info.context}
# -----------------------------------------------------------
knife4j:
production: ${liquidnet.knife4j.disable}
basic:
enable: true
username: ${liquidnet.security.username}
password: ${liquidnet.security.password}
# -----------------------------------------------------------
logging:
# config: ${liquidnet.logfile.config}
file:
name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
max-size: 200MB
pattern:
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{26}:%line] - %msg%n'
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{26}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level:
root: info
#以下是为指定包设置日志级别
com:
liquidnet: ${liquidnet.logfile.level-root}
# -----------------------------------------------------------
eureka:
# client:
# register-with-eureka: true
# fetch-registry: true
# serviceUrl:
# defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
instance:
hostname: ${spring.cloud.client.ip-address}
lease-expiration-duration-in-seconds: 15 #服务过期时间配置,超过这个时间没有接收到心跳EurekaServer就会将这个实例剔除
lease-renewal-interval-in-seconds: 5 #服务刷新时间配置,每隔这个时间会主动心跳一次
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}}
# -----------------------------------------------------------
#actuator/info
info:
app:
name: ${liquidnet.info.name}
company:
name: lightnet.io
build:
groupId: '@project.groupId@'
artifactId: '@project.artifactId@'
version: '@project.version@'
# -----------------------------------------------------------
spring:
application:
name: ${liquidnet.info.name}
profiles:
include: common-service #这里加载management相关公共配置
rabbitmq:
addresses: ${liquidnet.rabbitmq.host}
port: ${liquidnet.rabbitmq.port}
username: ${liquidnet.rabbitmq.username}
password: ${liquidnet.rabbitmq.password}
virtual-host: ${liquidnet.rabbitmq.virtual-host}
connection-timeout: ${liquidnet.rabbitmq.connection-timeout}
publisher-confirms: true
publisher-returns: true
listener:
simple:
acknowledge-mode: manual
redis:
database: 15
port: ${liquidnet.redis.port}
host: ${liquidnet.redis.host}
password: ${liquidnet.redis.password}
lettuce:
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
redisson:
singleServerConfig:
address: redis://${liquidnet.redis.host}:${liquidnet.redis.port}
password: ${liquidnet.redis.password}
clientName: null
database: 7 #选择使用哪个数据库0~15
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
subscriptionsPerConnection: 5
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
connectionMinimumIdleSize: 32
connectionPoolSize: 64
dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
codec:
class: "org.redisson.codec.JsonJacksonCodec"
transportMode: "NIO"
data:
mongodb:
uri: mongodb://${liquidnet.mongodb.user}:${liquidnet.mongodb.pwd}@${liquidnet.mongodb.host}/?authSource=admin&maxPoolSize=2000&waitQueueMultiple=100
sslEnabled: ${liquidnet.mongodb.sslEnabled}
database: ${liquidnet.mongodb.database}
datasource:
name: ${liquidnet.mysql.database-name}
url: jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false
username: ${liquidnet.mysql.username}
password: ${liquidnet.mysql.password}
# type: org.apache.tomcat.jdbc.pool.DataSource
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
maximum-pool-size: 45
minimum-idle: 10
connection-test-query: SELECT 1
# -----------------------------------------------------------
# -----------------------------------------------------------
liquidnet:
system:
updating:
switch: false
info:
port: 9006
context: /dragon
name: liquidnet-service-dragon
logfile:
path: /data/logs
name: service-dragon
config: classpath:logback-spring.xml
file-max-size: 200MB
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: debug
rabbitmq:
connection-timeout: 5000
mysql:
database-name: dev_ln_scene
mongodb:
sslEnabled: false
database: dev_ln_scene
liquidnet:
system:
updating:
switch: false
info:
port: 9006
context: /dragon
name: liquidnet-service-dragon
logfile:
path: /data/logs
name: service-dragon
config: classpath:logback-spring.xml
file-max-size: 200MB
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: debug
rabbitmq:
connection-timeout: 5000
mysql:
database-name: test_ln_scene
mongodb:
sslEnabled: false
database: test_ln_scene
server:
port: ${liquidnet.info.port}
tomcat:
uri-encoding: UTF-8
maxThreads: 2000 #默认200
minSpareThreads: 2000 #默认10
maxConnections: 20000 #默认10000
acceptCount: 5000 #默认100
processorCache: -1 #默认200
servlet:
context-path: ${liquidnet.info.context}
# -----------------------------------------------------------
knife4j:
enable: true
production: ${liquidnet.knife4j.disable}
basic:
enable: false
username: ${liquidnet.security.username}
password: ${liquidnet.security.password}
# -----------------------------------------------------------
logging:
# config: ${liquidnet.logfile.config}
file:
name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}.log
max-size: ${liquidnet.logfile.file-max-size}
pattern:
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %X{lnsTranceId} [%logger{96}:%line] - %msg%n'
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %X{lnsTranceId} [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level:
root: info
#以下是为指定包设置日志级别
com:
liquidnet: ${liquidnet.logfile.level}
# -----------------------------------------------------------
eureka:
# client:
# register-with-eureka: true
# fetch-registry: true
# serviceUrl:
# defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
instance:
hostname: ${spring.cloud.client.ip-address}
lease-expiration-duration-in-seconds: 15 #服务过期时间配置,超过这个时间没有接收到心跳EurekaServer就会将这个实例剔除
lease-renewal-interval-in-seconds: 5 #服务刷新时间配置,每隔这个时间会主动心跳一次
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}}
# -----------------------------------------------------------
#actuator/info
info:
app:
name: ${liquidnet.info.name}
company:
name: lightnet.io
build:
groupId: '@project.groupId@'
artifactId: '@project.artifactId@'
version: '@project.version@'
# -----------------------------------------------------------
mybatis-plus:
mapper-locations: classpath:com.liquidnet.service.kylin.mapper/*Mapper.xml
# -----------------------------------------------------------
spring:
application:
name: ${liquidnet.info.name}
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
profiles:
include: common-service #这里加载management相关公共配置
rabbitmq:
addresses: ${liquidnet.rabbitmq.host}
port: ${liquidnet.rabbitmq.port}
username: ${liquidnet.rabbitmq.username}
password: ${liquidnet.rabbitmq.password}
virtual-host: ${liquidnet.rabbitmq.virtual-host}
connection-timeout: ${liquidnet.rabbitmq.connection-timeout}
redis:
database: 15
port: ${liquidnet.redis.port}
host: ${liquidnet.redis.host}
password: ${liquidnet.redis.password}
lettuce:
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
redisson:
singleServerConfig:
address: redis://${liquidnet.redis.host}:${liquidnet.redis.port}
password: ${liquidnet.redis.password}
clientName: null
database: 7 #选择使用哪个数据库0~15
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
subscriptionsPerConnection: 5
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
connectionMinimumIdleSize: 32
connectionPoolSize: 64
dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
codec:
class: "org.redisson.codec.JsonJacksonCodec"
transportMode: "NIO"
data:
mongodb:
uri: mongodb://${liquidnet.mongodb.user}:${liquidnet.mongodb.pwd}@${liquidnet.mongodb.host}/?authSource=admin&maxPoolSize=2000&waitQueueMultiple=100
sslEnabled: ${liquidnet.mongodb.sslEnabled}
database: ${liquidnet.mongodb.database}
datasource:
name: ${liquidnet.mysql.database-name}
url: jdbc:mysql://${liquidnet.mysql.urlHostAndPort}/${liquidnet.mysql.database-name}?serverTimezone=Asia/Shanghai&characterEncoding=utf-8&useSSL=false
username: ${liquidnet.mysql.username}
password: ${liquidnet.mysql.password}
# type: org.apache.tomcat.jdbc.pool.DataSource
driver-class-name: com.mysql.cj.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
# -----------------------------------------------------------
# -----------------------------------------------------------
global-auth:
exclude-url-pattern:
- ${liquidnet.info.context}/doc.html
- ${liquidnet.info.context}/webjars/**
- ${liquidnet.info.context}/swagger-resources/**
- ${liquidnet.info.context}/v2/api-docs*
- ${liquidnet.info.context}/station/login
- ${liquidnet.info.context}/station/login/sms
# -
- ${liquidnet.info.context}/partner/buyNotice/**
- ${liquidnet.info.context}/partner/checkUser/**
- ${liquidnet.info.context}/partner/checkUser/performance/**
- ${liquidnet.info.context}/partner/ticket/**
- ${liquidnet.info.context}/partner/times/**
- ${liquidnet.info.context}/partner/performance/**
# banner
- ${liquidnet.info.context}/banners/**
- ${liquidnet.info.context}/order/checkOrderTime
- ${liquidnet.info.context}/order/syncOrder
# 退款回掉
- ${liquidnet.info.context}/refund/callback
# 演出
- ${liquidnet.info.context}/performance/localList
- ${liquidnet.info.context}/performance/noticeList
- ${liquidnet.info.context}/performance/roadList/**
- ${liquidnet.info.context}/performance/recommendList
- ${liquidnet.info.context}/performance/exclusiveList
- ${liquidnet.info.context}/performance/search
- ${liquidnet.info.context}/performance/list
- ${liquidnet.info.context}/performance/calendar
- ${liquidnet.info.context}/performance/calendarPerformances
- ${liquidnet.info.context}/performance/*
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
liquidnet:
al-oss:
imgUrl: "https://img.zhengzai.tv/"
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-do</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-dragon-do</artifactId>
</project>
package com.liquidnet.service.dragon;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
public class MybatisPlusCodeGenerator {
/**
* @param moduleRootPath 项目模块根路径 到 /src 之前 ex:E:\projects\trlabs-bus-v1\trlabs-bus-service\trlabs-common\trlabs-mybatis
* @param dsc 数据源
* @param parentName 相当于业务模块名 com.liquidnet.service.adam 全限定类名
* @param tableNames 表名
*/
public static void doGenerator(String moduleRootPath,
DataSourceConfig dsc,
String parentName,
String[] tableNames) {
AutoGenerator mpg = new AutoGenerator();
// 全局配置BankMybatisPlusCodeGenerator
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(moduleRootPath + "/src/main/java");
gc.setAuthor("liquidnet");
gc.setOpen(false);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg.setGlobalConfig(gc);
// 数据源配置
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(parentName);
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return moduleRootPath + "/src/main/resources/com/liquidnet/service/adam/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
// 配置模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
strategy.setInclude(tableNames);
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
public static void main(String[] args) {
DataSourceConfig dsc = new DataSourceConfig();
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUrl("jdbc:mysql://39.106.122.201:3308/test_ln_scene?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=CST");
dsc.setUsername("testmall");
dsc.setPassword("zhengzai!mYT");
String resourcePath = "/Users/zhanggb/Downloads/tmp";
String directory = "com.liquidnet.service.dragon";
String[] dbTableArray = new String[]{"dragon_orders", "dragon_order_logs", "dragon_order_refunds", "dragon_order_refund_logs"};
doGenerator(resourcePath, dsc, directory, dbTableArray);
}
}
package com.liquidnet.service.dragon.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
public class DragonOrderLogs implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* order_id
*/
private String orderId;
/**
* payment_type
*/
private String paymentType;
/**
* content
*/
private String content;
/**
* created_at
*/
private LocalDateTime createdAt;
/**
* updated_at
*/
private LocalDateTime updatedAt;
}
package com.liquidnet.service.dragon.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
public class DragonOrderRefundLogs implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* order_id
*/
private String orderId;
/**
* order_refund_id
*/
private String orderRefundId;
/**
* refund_type
*/
private String refundType;
/**
* content
*/
private String content;
/**
* created_at
*/
private LocalDateTime createdAt;
/**
* updated_at
*/
private LocalDateTime updatedAt;
}
package com.liquidnet.service.dragon.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
public class DragonOrderRefunds implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* order_id
*/
private String orderId;
/**
* status
*/
private Integer status;
/**
* code
*/
private String code;
/**
* orderRefundCode
*/
private String order_refund_code;
/**
* price
*/
private BigDecimal price;
/**
* reason
*/
private String reason;
/**
* notify_url
*/
private String notifyUrl;
/**
* refund_type
*/
private String refundType;
/**
* refund_id
*/
private String refundId;
/**
* refund_error
*/
private String refundError;
/**
* refund_at
*/
private LocalDateTime refundAt;
/**
* finished_at
*/
private LocalDateTime finishedAt;
/**
* created_at
*/
private LocalDateTime createdAt;
/**
* updated_at
*/
private LocalDateTime updatedAt;
}
package com.liquidnet.service.dragon.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
public class DragonOrders implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* status
*/
private Integer status;
/**
* code
*/
private String code;
/**
* type
*/
private String type;
/**
* price
*/
private BigDecimal price;
/**
* name
*/
private String name;
/**
* detail
*/
private String detail;
/**
* order_code
*/
private String orderCode;
/**
* client_ip
*/
private String clientIp;
/**
* notify_url
*/
private String notifyUrl;
/**
* payment_type
*/
private String paymentType;
/**
* payment_id
*/
private String paymentId;
/**
* payment_at
*/
private LocalDateTime paymentAt;
/**
* finished_at
*/
private LocalDateTime finishedAt;
/**
* created_at
*/
private LocalDateTime createdAt;
/**
* updated_at
*/
private LocalDateTime updatedAt;
}
package com.liquidnet.service.dragon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.dragon.entity.DragonOrderLogs;
import com.liquidnet.service.dragon.entity.DragonOrders;
public interface DragonOrderLogsMapper extends BaseMapper<DragonOrderLogs> {
}
package com.liquidnet.service.dragon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.dragon.entity.DragonOrderRefundLogs;
import com.liquidnet.service.dragon.entity.DragonOrders;
public interface DragonOrderRefundLogsMapper extends BaseMapper<DragonOrderRefundLogs> {
}
package com.liquidnet.service.dragon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.dragon.entity.DragonOrderRefunds;
import com.liquidnet.service.dragon.entity.DragonOrders;
public interface DragonOrderRefundsMapper extends BaseMapper<DragonOrderRefunds> {
}
package com.liquidnet.service.dragon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.dragon.entity.DragonOrders;
public interface DragonOrdersMapper extends BaseMapper<DragonOrders> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.dragon.mapper.DragonOrderLogsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.dragon.mapper.DragonOrderRefundLogsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.dragon.mapper.DragonOrderRefundsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.dragon.mapper.DragonOrdersMapper">
</mapper>
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<modules> <modules>
<module>liquidnet-service-kylin-do</module> <module>liquidnet-service-kylin-do</module>
<module>liquidnet-service-adam-do</module> <module>liquidnet-service-adam-do</module>
<module>liquidnet-service-dragon-do</module>
</modules> </modules>
<dependencies> <dependencies>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>liquidnet-bus-service</artifactId> <artifactId>liquidnet-service-consumer-all</artifactId>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
......
package com.liquidnet.service; package com.liquidnet.service.consumer.adam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package com.liquidnet.service.consumer.service.impl; package com.liquidnet.service.consumer.adam.service.impl;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.consumer.service.IBaseDao; import com.liquidnet.service.consumer.adam.service.IBaseDao;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
......
package com.liquidnet.service.consumer.service.processor; package com.liquidnet.service.consumer.adam.service.processor;
import com.liquidnet.common.mq.constant.MQConst; import com.liquidnet.common.mq.constant.MQConst;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.consumer.service.IBaseDao; import com.liquidnet.service.consumer.adam.service.IBaseDao;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-service-consumer-all</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-consumer-dragon</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-mq</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-web</artifactId>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-cache-redisson</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
package com.liquidnet.service.consumer.dragon;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.util.Arrays;
@Slf4j
@SpringBootApplication(scanBasePackages = {"com.liquidnet"})
public class ServiceConsumerDragonApplication implements CommandLineRunner {
@Autowired
private Environment environment;
public static void main(String[] args) {
SpringApplication.run(ServiceConsumerDragonApplication.class, args);
}
@Override
public void run(String... strings) {
try {
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}{}/doc.html\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
environment.getProperty("spring.application.name"),
environment.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(),
environment.getProperty("server.port"),
environment.getProperty("server.servlet.context-path"),
Arrays.toString(environment.getActiveProfiles()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.liquidnet.service.consumer.dragon.service;
import java.util.LinkedList;
public interface IBaseDao {
/**
* 批量执行sql
*
* @param sql
* @param values
* @return
*/
Boolean batchSql(String sql, LinkedList<Object[]> values);
/**
* 批量执行不定量sql
*
* @param sql
* @param values
* @return
*/
Boolean batchSqls(LinkedList<String> sql, LinkedList<Object[]>... values);
/**
* 执行sql语句 无 参数
*
* @param sql
* @return
*/
Boolean batchSqlNoArgs(LinkedList<String> sql);
/**
* xs 新增一条记录且返回主键Id
*
* @param sql 新增待执行sql
* @param param 参数
* @return 主键ID
*/
int insertSqlAndReturnKeyId(final String sql, final Object[] param);
}
package com.liquidnet.service.consumer.dragon.service.impl;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.consumer.dragon.service.IBaseDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.Resource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.LinkedList;
@Service
public class BaseDao implements IBaseDao {
private static final Logger log = LoggerFactory.getLogger(BaseDao.class);
@Resource
public JdbcTemplate jdbcTemplate;
@Resource(name = "transactionManager")
public DataSourceTransactionManager transactionManager;
@Override
public Boolean batchSql(final String sql, final LinkedList<Object[]> values) {
TransactionCallback<Boolean> callback = new TransactionCallback<Boolean>() {
@Override
public Boolean doInTransaction(final TransactionStatus transactionStatus) {
if (values.size() > 0) {
int[] ints = jdbcTemplate.batchUpdate(sql, values);
}
return true;
}
};
try {
TransactionTemplate tt = new TransactionTemplate(transactionManager);
return tt.execute(callback);
} catch (Exception ex) {
log.error("###\nSQL.Preparing:{}\nParameters:{}", JsonUtils.toJson(sql), JsonUtils.toJson(values), ex);
return false;
}
}
@Override
public Boolean batchSqls(final LinkedList<String> sql,
final LinkedList<Object[]>... values) {
try {
TransactionCallback<Boolean> callback = new TransactionCallback<Boolean>() {
@Override
public Boolean doInTransaction(final TransactionStatus transactionStatus) {
int i = 0;
for (LinkedList<Object[]> o : values) {
if (sql.size() < i + 1) {
break;
}
if (!o.isEmpty()) {
jdbcTemplate.batchUpdate(sql.get(i), o);
}
i++;
}
return true;
}
};
TransactionTemplate tt = new TransactionTemplate(transactionManager);
return tt.execute(callback);
} catch (Exception ex) {
// if (ex instanceof LiquidnetServiceException) {
// log.error("###Error.Code:{} - {}", ((LiquidnetServiceException) ex).getCode(), ex.getMessage());
// } else {
log.error("###Error.Sqls:{}\nParameters:{},Ex:{}", JsonUtils.toJson(sql), JsonUtils.toJson(values), ex.getMessage());
// }
return false;
}
}
@Override
public Boolean batchSqlNoArgs(final LinkedList<String> sql) {
try {
TransactionCallback<Boolean> callback = new TransactionCallback<Boolean>() {
@Override
public Boolean doInTransaction(final TransactionStatus transactionStatus) {
for (String o : sql) {
jdbcTemplate.execute(o);
}
return true;
}
};
TransactionTemplate tt = new TransactionTemplate(transactionManager);
return tt.execute(callback);
} catch (Exception ex) {
log.error("###Error.Sqls:{}\nParameters:{},Ex:{}", sql);
return false;
}
}
/**
* xs 新增一条记录且返回主键Id
*
* @param sql 新增待执行sql
* @param param 参数
* @return 主键ID
*/
public int insertSqlAndReturnKeyId(final String sql, final Object[] param) {
final String innersql = sql;
final Object[] innerO = param;
KeyHolder keyHolder = new GeneratedKeyHolder();
try {
jdbcTemplate.update(new PreparedStatementCreator() {
@Override
public PreparedStatement createPreparedStatement(final Connection con)
throws SQLException {
PreparedStatement ps = con.prepareStatement(innersql,
Statement.RETURN_GENERATED_KEYS);
for (int i = 0; i < innerO.length; i++) {
ps.setObject(i + 1, innerO[i]);
}
return ps;
}
}, keyHolder);
} catch (Exception e) {
log.error("###\nSQL.Preparing:{}\nParameters:{}", sql, JsonUtils.toJson(param), e);
}
return keyHolder.getKey().intValue();
}
}
package com.liquidnet.service.consumer.dragon.service.processor;
import com.liquidnet.common.mq.constant.MQConst;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.consumer.dragon.service.IBaseDao;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.IOException;
/**
* ConsumerAdamProcessor.class
*
* @author zhanggb
* Created by IntelliJ IDEA at 2021/4/29
*/
@Slf4j
@Component
public class ConsumerAdamUCenterProcessor {
@Resource
IBaseDao baseDao;
// @RabbitListener(bindings = @QueueBinding(
// exchange = @Exchange(MQConst.EXCHANGES_LIQUIDNET_SQL), key = MQConst.ROUTING_KEY_SQL,
// value = @Queue(MQConst.QUEUES_SQL_MAIN)
// ))
//// @RabbitListener(queues = MQConst.QUEUES_SQL_MAIN)
// public void consumerSql(Message msg, Channel channel) {
// SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(new String(msg.getBody()), SqlMapping.SqlMessage.class);
// log.debug("CONSUMER SQL ==> Preparing:{}", JsonUtils.toJson(sqlMessage.getSqls()));
// log.debug("CONSUMER SQL ==> Parameters:{}", JsonUtils.toJson(sqlMessage.getArgs()));
//
// try {
// Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
// log.debug("CONSUMER SQL result of execution:{}", rstBatchSqls);
// if (rstBatchSqls) {
// channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);
// } else {
// channel.basicReject(msg.getMessageProperties().getDeliveryTag(), true);
// }
// } catch (Exception e) {
// log.error("error:CONSUMER SQL:{}", JsonUtils.toJson(sqlMessage), e);
// try {
// channel.basicReject(msg.getMessageProperties().getDeliveryTag(), true);
// } catch (IOException ioException) {
// log.error("error:CONSUMER SQL:basicReject.msg.tag:{}", msg.getMessageProperties().getDeliveryTag(), ioException);
// }
// }
// }
private void consumerSqlDaoHandler(Message msg, Channel channel) {
MessageProperties properties = msg.getMessageProperties();
String consumerQueue = properties.getConsumerQueue();
long deliveryTag = properties.getDeliveryTag();
log.info("CONSUMER SQL ==> [consumerQueue:{},deliveryTag:{}]", consumerQueue, deliveryTag);
SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(new String(msg.getBody()), SqlMapping.SqlMessage.class);
log.debug("CONSUMER SQL ==> Preparing:{}", JsonUtils.toJson(sqlMessage.getSqls()));
log.debug("CONSUMER SQL ==> Parameters:{}", JsonUtils.toJson(sqlMessage.getArgs()));
try {
Boolean rstBatchSqls = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
log.debug("CONSUMER SQL result of execution:{}", rstBatchSqls);
if (rstBatchSqls) {
channel.basicAck(deliveryTag, false);
} else {
log.warn("###CONSUMER SQL[consumerQueue:{},deliveryTag={},sqlMessage:{}]", consumerQueue, deliveryTag, JsonUtils.toJson(sqlMessage));
channel.basicAck(deliveryTag, false);
}
} catch (IOException e) {
log.error("CONSUMER SQL[consumerQueue:{},deliveryTag:{},sqlMessage:{}]", consumerQueue, deliveryTag, JsonUtils.toJson(sqlMessage), e);
}
}
/* ================================================================== | 用户注册 */
@RabbitListener(
bindings = @QueueBinding(
exchange = @Exchange(MQConst.EX_LNS_SQL_UCENTER),
key = MQConst.RK_SQL_UREGISTER,
value = @Queue(MQConst.QUEUES_SQL_UREGISTER)
),
concurrency = "5"
)
public void consumerSqlForURegister(Message msg, Channel channel) {
this.consumerSqlDaoHandler(msg, channel);
}
/* ================================================================== | 用户信息 */
@RabbitListener(
bindings = @QueueBinding(
exchange = @Exchange(MQConst.EX_LNS_SQL_UCENTER),
key = MQConst.RK_SQL_UCENTER,
value = @Queue(MQConst.QUEUES_SQL_UCENTER)
),
concurrency = "5"
)
public void consumerSqlForUCenter(Message msg, Channel channel) {
this.consumerSqlDaoHandler(msg, channel);
}
/* ================================================================== | 会员购买 */
@RabbitListener(
bindings = @QueueBinding(
exchange = @Exchange(MQConst.EX_LNS_SQL_UCENTER),
key = MQConst.RK_SQL_UMEMBER,
value = @Queue(MQConst.QUEUES_SQL_UMEMBER)
),
concurrency = "5"
)
public void consumerSqlForUMember(Message msg, Channel channel) {
this.consumerSqlDaoHandler(msg, channel);
}
/* ================================================================== | */
}
# begin-dev-这里是配置信息基本值
liquidnet:
cloudConfig:
profile: dev
security:
username: user
password: user123
eureka:
host: 127.0.0.1:7001
# end-dev-这里是配置信息基本值
spring:
profiles:
include: service-consumer-dragon
# begin-prod-这里是配置信息基本值
liquidnet:
cloudConfig:
profile: prod
security:
username: user
password: user123
eureka:
host: 172.17.207.189:7001
# end-prod-这里是配置信息基本值
spring:
profiles:
include: service-consumer-dragon
\ No newline at end of file
# begin-test-这里是配置信息基本值
liquidnet:
cloudConfig:
profile: test
security:
username: user
password: user123
eureka:
host: 172.17.207.177:7001
# end-test-这里是配置信息基本值
spring:
profiles:
include: service-consumer-dragon
\ No newline at end of file
spring:
application:
name: liquidnet-service-consumer-dragon
profiles:
active: dev
\ No newline at end of file
package com.liquidnet.service.consumer.service.processor;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class ConsumerDragonUCenterProcessorTest {
@Autowired
ConsumerDragonUCenterProcessorTest consumerAdamUCenterProcessor;
@Test
public void test() {
String msg = "{\"sqls\":[\"INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,number,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\",\"INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?)\",\"INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id,ticket_id ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?)\",\"INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\"],\"args\":[[[\"73901653639766016\",\"73459712083042304\",\"\",\"15001268203\",\"0607演出0607\",\"T7390165363976516260\",\"\",\"\",\"\",1,0.01,0.01,0.01,0.0,0.01,0.00,0.0,0,\"alipay\",null,null,\"\",\"\",\"\",\"no\",\"electronic\",\"\",5,null,\"2021-06-07T22:18:47.264\",null]],[[\"73901653694291968\",\"73901653639766016\",2,0,0,0,0,\"2021-06-07T22:18:47.267\",null]],[[\"73901653694291969\",\"73901653639766016\",\"\",\"\",\"0\",0,\"73776030099382272\",\"73776073304907776\",\"73776225042243584\",\"2021-06-07T22:18:47.267\",null]],[[\"73901653694291970\",\"73901653639766016\",\"73776225042243584\",\"73459712083042304\",\"73776073304907776\",\"73776030099382272\",0,\"\",\"\",\"\",0,0,\"\",0,\"\",\"2021-06-07T22:18:47.267\",null]]]}";
// consumerAdamProcessor.consumerSqlForUCenterA(null, null);
}
}
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>liquidnet-bus-service</artifactId> <artifactId>liquidnet-service-consumer-all</artifactId>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>liquidnet-service-consumer</artifactId> <artifactId>liquidnet-service-consumer-kylin</artifactId>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
......
package com.liquidnet.service; package com.liquidnet.service.consumer.kylin;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -21,12 +21,12 @@ import java.util.Arrays; ...@@ -21,12 +21,12 @@ import java.util.Arrays;
@Slf4j @Slf4j
@SpringBootApplication(scanBasePackages = {"com.liquidnet"}) @SpringBootApplication(scanBasePackages = {"com.liquidnet"})
public class ServiceConsumerApplication implements CommandLineRunner { public class ServiceConsumerKylinApplication implements CommandLineRunner {
@Autowired @Autowired
private Environment environment; private Environment environment;
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ServiceConsumerApplication.class, args); SpringApplication.run(ServiceConsumerKylinApplication.class, args);
} }
@Override @Override
......
package com.liquidnet.service.consumer.service.Utils; package com.liquidnet.service.consumer.kylin.service.Utils;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.kylin.constant.KylinRedisConst; import com.liquidnet.service.kylin.constant.KylinRedisConst;
......
package com.liquidnet.service.consumer.service.impl; package com.liquidnet.service.consumer.kylin.service.impl;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.consumer.service.IBaseDao; import com.liquidnet.service.consumer.service.IBaseDao;
......
package com.liquidnet.service.consumer.service.processor; package com.liquidnet.service.consumer.kylin.service.processor;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.common.mq.constant.MQConst; import com.liquidnet.common.mq.constant.MQConst;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.OrderCloseMapping; import com.liquidnet.service.base.OrderCloseMapping;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.consumer.kylin.service.Utils.KylinUtils;
import com.liquidnet.service.consumer.service.IBaseDao; import com.liquidnet.service.consumer.service.IBaseDao;
import com.liquidnet.service.consumer.service.Utils.KylinUtils;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo; import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo; import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
......
#eurekaServer配置
eureka:
client:
register-with-eureka: true
fetch-registry: true
serviceUrl:
defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
#configServer配置
spring:
cloud:
config:
# uri: http://39.106.122.201:7002/support-config
profile: ${liquidnet.cloudConfig.profile}
name: ${spring.application.name} #默认为spring.application.name
discovery:
enabled: true
service-id: liquidnet-support-config
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liquidnet-bus-service</artifactId>
<groupId>com.liquidnet</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-consumer-all</artifactId>
<packaging>pom</packaging>
<modules>
<module>liquidnet-service-consumer-kylin</module>
<module>liquidnet-service-consumer-adam</module>
<module>liquidnet-service-consumer-dragon</module>
</modules>
<dependencies>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-web</artifactId>
</dependency>
</dependencies>
</project>
...@@ -6,7 +6,7 @@ use ln_scene; ...@@ -6,7 +6,7 @@ use ln_scene;
drop TABLE if exists `dragon_orders`; drop TABLE if exists `dragon_orders`;
CREATE TABLE `dragon_orders` CREATE TABLE `dragon_orders`
( (
`id` bigint unsigned NOT NULL AUTO_INCREMENT, `mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`status` tinyint NOT NULL DEFAULT '0' COMMENT '订单状态', `status` tinyint NOT NULL DEFAULT '0' COMMENT '订单状态',
`code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '订单支付编号', `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '订单支付编号',
`type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '订单类型', `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '订单类型',
...@@ -23,7 +23,7 @@ CREATE TABLE `dragon_orders` ...@@ -23,7 +23,7 @@ CREATE TABLE `dragon_orders`
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间', `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`), PRIMARY KEY (`mid`),
UNIQUE KEY `orders_code_unique` (`code`), UNIQUE KEY `orders_code_unique` (`code`),
UNIQUE KEY `orders_payment_id_unique` (`payment_id`), UNIQUE KEY `orders_payment_id_unique` (`payment_id`),
KEY `orders_payment_type_index` (`payment_type`), KEY `orders_payment_type_index` (`payment_type`),
...@@ -38,14 +38,14 @@ CREATE TABLE `dragon_orders` ...@@ -38,14 +38,14 @@ CREATE TABLE `dragon_orders`
drop TABLE if exists `dragon_order_logs`; drop TABLE if exists `dragon_order_logs`;
CREATE TABLE `dragon_order_logs` CREATE TABLE `dragon_order_logs`
( (
`id` bigint unsigned NOT NULL AUTO_INCREMENT, `mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`order_id` bigint NOT NULL COMMENT '订单id', `order_id` bigint NOT NULL COMMENT '订单id',
`payment_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '支付类型', `payment_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '支付类型',
`content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '支付通知内容', `content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '支付通知内容',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间', `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`), PRIMARY KEY (`mid`),
KEY `order_logs_order_id_index` (`order_id`) KEY `order_logs_order_id_index` (`order_id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8 DEFAULT CHARSET = utf8
...@@ -56,7 +56,7 @@ CREATE TABLE `dragon_order_logs` ...@@ -56,7 +56,7 @@ CREATE TABLE `dragon_order_logs`
drop TABLE if exists `dragon_order_refunds`; drop TABLE if exists `dragon_order_refunds`;
CREATE TABLE `dragon_order_refunds` CREATE TABLE `dragon_order_refunds`
( (
`id` bigint unsigned NOT NULL AUTO_INCREMENT, `mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`order_id` bigint NOT NULL COMMENT '订单id', `order_id` bigint NOT NULL COMMENT '订单id',
`status` tinyint NOT NULL DEFAULT '0' COMMENT '订单退款状态', `status` tinyint NOT NULL DEFAULT '0' COMMENT '订单退款状态',
`code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '订单退款编号', `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '订单退款编号',
...@@ -72,7 +72,7 @@ CREATE TABLE `dragon_order_refunds` ...@@ -72,7 +72,7 @@ CREATE TABLE `dragon_order_refunds`
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间', `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`), PRIMARY KEY (`mid`),
UNIQUE KEY `order_refunds_code_unique` (`code`), UNIQUE KEY `order_refunds_code_unique` (`code`),
UNIQUE KEY `order_refunds_order_id_order_refund_code_unique` (`order_id`, `order_refund_code`), UNIQUE KEY `order_refunds_order_id_order_refund_code_unique` (`order_id`, `order_refund_code`),
KEY `order_refunds_order_id_index` (`order_id`) KEY `order_refunds_order_id_index` (`order_id`)
...@@ -85,7 +85,7 @@ CREATE TABLE `dragon_order_refunds` ...@@ -85,7 +85,7 @@ CREATE TABLE `dragon_order_refunds`
drop TABLE if exists `dragon_order_refund_logs`; drop TABLE if exists `dragon_order_refund_logs`;
CREATE TABLE `dragon_order_refund_logs` CREATE TABLE `dragon_order_refund_logs`
( (
`id` bigint unsigned NOT NULL AUTO_INCREMENT, `mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`order_id` bigint NOT NULL COMMENT '订单id', `order_id` bigint NOT NULL COMMENT '订单id',
`order_refund_id` bigint NOT NULL COMMENT '退款订单id', `order_refund_id` bigint NOT NULL COMMENT '退款订单id',
`refund_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '退款类型', `refund_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '退款类型',
...@@ -93,7 +93,7 @@ CREATE TABLE `dragon_order_refund_logs` ...@@ -93,7 +93,7 @@ CREATE TABLE `dragon_order_refund_logs`
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间', `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`), PRIMARY KEY (`mid`),
KEY `order_refund_logs_order_id_index` (`order_id`), KEY `order_refund_logs_order_id_index` (`order_id`),
KEY `order_refund_logs_order_refund_id_index` (`order_refund_id`) KEY `order_refund_logs_order_refund_id_index` (`order_refund_id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
......
...@@ -11,5 +11,34 @@ ...@@ -11,5 +11,34 @@
<artifactId>liquidnet-service-dragon-impl</artifactId> <artifactId>liquidnet-service-dragon-impl</artifactId>
<dependencies>
<!-- common -->
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-cache-redis</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-cache-redisson</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- other -->
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-dragon-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> </project>
package com.liquidnet.service.dragon.controller; package com.liquidnet.service.dragon.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("pay")
public class PayController { public class PayController {
} }
package com.liquidnet.service.dragon.controller; package com.liquidnet.service.dragon.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("refund")
public class RefundController { public class RefundController {
} }
package com.liquidnet.service.dragon.service.impl;
import com.liquidnet.service.dragon.service.IDragonOrderRefundsService;
public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService {
}
package com.liquidnet.service.dragon.service.impl;
import com.liquidnet.service.dragon.service.IDragonOrdersService;
public class DragonOrdersServiceImpl implements IDragonOrdersService {
}
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
<module>liquidnet-service-kylin</module> <module>liquidnet-service-kylin</module>
<module>liquidnet-service-order</module> <module>liquidnet-service-order</module>
<module>liquidnet-service-platform</module> <module>liquidnet-service-platform</module>
<module>liquidnet-service-consumer</module> <module>liquidnet-service-dragon</module>
<module>liquidnet-service-executor-all</module> <module>liquidnet-service-executor-all</module>
<module>liquidnet-service-consumer-adam</module> <module>liquidnet-service-consumer-all</module>
<!-- <module>liquidnet-service-example</module>--> <!-- <module>liquidnet-service-example</module>-->
<!-- <module>liquidnet-service-sequence</module>--> <!-- <module>liquidnet-service-sequence</module>-->
<!-- <module>liquidnet-service-account</module>--> <!-- <module>liquidnet-service-account</module>-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment