Commit e7e3ddfa authored by zhangc's avatar zhangc

提交apigateway代码

parent 1fcaba78
...@@ -9,77 +9,110 @@ ...@@ -9,77 +9,110 @@
<artifactId>jz-dm-apigateway</artifactId> <artifactId>jz-dm-apigateway</artifactId>
<name>jz-dm-apigateway</name> <name>jz-dm-apigateway</name>
<description>jz-dm-apigateway</description> <description>jz-dm-apigateway</description>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>spring-boot-autoconfigure</artifactId> <artifactId>httpclient</artifactId>
<version>1.5.2.RELEASE</version> <version>4.5.6</version>
<scope>compile</scope>
</dependency> </dependency>
<!--<dependency> <dependency>
<groupId>org.springframework.session</groupId> <groupId>org.springframework.session</groupId>
<artifactId>spring-session</artifactId> <artifactId>spring-session</artifactId>
<version>1.3.0.RELEASE</version> <version>1.3.0.RELEASE</version>
<scope>compile</scope> <scope>compile</scope>
</dependency>-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency> </dependency>
<!-- spring-boot 相关依赖 -->
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>mybatis</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
<version>3.2.7</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-jdbc</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
<version>4.3.2.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>1.5.2.RELEASE</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-freemarker</artifactId>
</dependency> </dependency>
<!--Redis集中存储Session-->
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.springframework.session</groupId>
<artifactId>httpcore</artifactId> <artifactId>spring-session-data-redis</artifactId>
<version>4.4.10</version>
</dependency> </dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<!-- spring boot 和mybatis -->
<!--<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>-->
<!-- mybatis plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!--mybatis分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
</dependency>
<!-- druid数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<!-- mysql连接 -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
</dependency> </dependency>
<!-- lombok -->
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>org.projectlombok</groupId>
<artifactId>HikariCP</artifactId> <artifactId>lombok</artifactId>
<version>3.1.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>httpclient</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>4.5.6</version> <scope>test</scope>
</dependency>
<!-- swagger2接口文档 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
</dependency>
<!--工具类-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jz.common</groupId> <groupId>com.jz.common</groupId>
<artifactId>jz-dm-common</artifactId> <artifactId>jz-dm-common</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -2,14 +2,16 @@ package com.jz.dm.gateway; ...@@ -2,14 +2,16 @@ package com.jz.dm.gateway;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
/** /**
* @author key * @author key
*/ */
@SpringBootApplication @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
//@ComponentScan(basePackages = {"com.jz.dm"}) @ComponentScan(basePackages = {"com.jz.dm"})
@MapperScan("com.jz.dm.gateway.mapper") @MapperScan("com.jz.dm.gateway.mapper")
public class ApiGatewayApplication { public class ApiGatewayApplication {
......
...@@ -3,6 +3,8 @@ package com.jz.dm.gateway.mapper; ...@@ -3,6 +3,8 @@ package com.jz.dm.gateway.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.DataGoodsApi; import com.jz.common.entity.DataGoodsApi;
import java.util.List;
/** /**
* api商品(TDataGoodsApi)表数据库访问层 * api商品(TDataGoodsApi)表数据库访问层
* *
...@@ -11,6 +13,6 @@ import com.jz.common.entity.DataGoodsApi; ...@@ -11,6 +13,6 @@ import com.jz.common.entity.DataGoodsApi;
*/ */
public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> { public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> {
List<DataGoodsApi> findAll();
} }
\ No newline at end of file
# 测试环境配置 #开发环境配置
server:
port: 8088
#contextPath: /resource
management:
port: 54001
health:
mail:
enabled: false
spring: spring:
profiles: test #缓存会话
redis:
#database: 0
#host: 119.23.13.83
#port: 8007
#timeout: 5000
cluster:
nodes:
- 192.168.31.167:6379
- 192.168.31.167:6380
- 192.168.31.167:6381
- 192.168.31.167:6382
- 192.168.31.167:6383
- 192.168.31.167:6384
session:
store-type: none
#数据库
datasource: datasource:
url: jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project?characterEncoding=utf8&useSSL=false url: jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project?characterEncoding=utf8&useSSL=false
driverClassName: com.mysql.jdbc.Driver driverClassName: com.mysql.jdbc.Driver
...@@ -38,48 +44,14 @@ spring: ...@@ -38,48 +44,14 @@ spring:
poolPreparedStatements: false poolPreparedStatements: false
maxPoolPreparedStatementPerConnectionSize: 20 maxPoolPreparedStatementPerConnectionSize: 20
cache:
type: CAFFEINE
caffeine:
spec: maximumSize=1000,expireAfterWrite=30s
public-key: rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
redis:
#database: 0
#host: 119.23.13.83
#port: 8007
#timeout: 5000
cluster:
nodes:
- 192.168.31.167:6379
- 192.168.31.167:6380
- 192.168.31.167:6381
- 192.168.31.167:6382
- 192.168.31.167:6383
- 192.168.31.167:6384
#使用redis管理session设置为redis,否则none
session:
store-type: none
#mybatis的配置
mybatis:
#配置mapper.xml文件所在路径
mapper-locations: classpath:mapper.*/*.xml
#配置映射类所在的包名
type-aliases-package: com.jz.manage.moduls.entity
logging:
level:
com.jz.manage: debug
# 跳过签名 # 跳过签名
api: api:
skipFilter: false #是否跳过拦截器 skipFilter: false
skipIpLimit: true #是否为ip列表 skipIpLimit: true
maxPostSize: 1048576 #最大支持上传文件数 maxPostSize: 1048576
supplierId: 200314008093 #供应商ID supplierId: 200314008093
# 代发三要素校验定时任务 # 代发三要素校验定时任务
validCron: 0/1 * * * * * validCron: 0/1 * * * * *
......
# 系统信息 #服务端口和项目名称
info: server:
app: port: 8088
name: "@project.name@" servlet:
description: "@project.description@" context-path: /
version: "@project.version@"
spring-boot-version: "@project.parent.version@" #Djasypt.encryptor.password
jasypt:
encryptor:
password: btcpay.com
#日志打印
logging:
level:
com.netflix.discovery: 'OFF'
org.springframework.cloud: 'DEBUG'
#SPRING配置文件
spring: spring:
application:
name: 九章数据平台
aop:
proxy-target-class: true
profiles: profiles:
active: test active: dev #默认使用的配置文件
sysProperties: http:
session-timeout: 3600 encoding:
developerList: charset: UTF-8
- name: 九章 jackson:
value: time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
default-property-inclusion: NON_NULL
#MyBatis
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
typeAliasesPackage: com.jz.common.entity
#type-handlers-package: com.btcpay.commons.typehandler
global-config:
id-type: 1
field-strategy: 2
db-column-underline: true
refresh-mapper: true
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
<?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.jz.dm.gateway.mapper.DataGoodsApiDao">
<resultMap type="com.jz.common.entity.DataGoodsApi" id="TDataGoodsApiMap">
<result property="goodsApi" column="goods_api" jdbcType="INTEGER"/>
<result property="dataGoodsId" column="data_goods_id" jdbcType="INTEGER"/>
<result property="apiName" column="api_name" jdbcType="VARCHAR"/>
<result property="requestType" column="request_type" jdbcType="VARCHAR"/>
<result property="apiUrl" column="api_url" jdbcType="VARCHAR"/>
<result property="apiMethod" column="api_method" jdbcType="VARCHAR"/>
<result property="apiProtocl" column="api_protocl" jdbcType="VARCHAR"/>
<result property="returnDataExample" column="return_data_example" jdbcType="VARCHAR"/>
<result property="requestExample" column="request_example" jdbcType="VARCHAR"/>
<result property="returnType" column="return_type" jdbcType="VARCHAR"/>
<result property="apiKey" column="api_key" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>
<result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
</mapper>
\ No newline at end of file
<?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.jz.dm.gateway.mapper.DataGoodsApiParamsDao">
<resultMap type="com.jz.common.entity.DataGoodsApiParams" id="TDataGoodsApiParamsMap">
<result property="apiParamsId" column="api_params_id" jdbcType="INTEGER"/>
<result property="goodsApi" column="goods_api" jdbcType="INTEGER"/>
<result property="paramsDiff" column="params_diff" jdbcType="VARCHAR"/>
<result property="paramsName" column="params_name" jdbcType="VARCHAR"/>
<result property="paramsType" column="params_type" jdbcType="VARCHAR"/>
<result property="paramsDesc" column="params_desc" jdbcType="VARCHAR"/>
<result property="defaultValue" column="default_value" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="ifRequird" column="if_requird" jdbcType="VARCHAR"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
</resultMap>
</mapper>
\ No newline at end of file
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