Commit c270cc31 by 杨林龙

格式化 yangll

1 parent ad1dbf1e
Showing 40 changed files with 266 additions and 273 deletions
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.openplatform</groupId>
<artifactId>rpc-openplatform-api</artifactId>
<version>1.0-SNAPSHOT</version>
<name>rpc-openplatform-api</name>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>framework-rpc-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>cn.com.glsx.openplatform</groupId>
<artifactId>rpc-openplatform-api</artifactId>
<version>1.0-SNAPSHOT</version>
<name>rpc-openplatform-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.openplatform.remote</deploy.scanPackage>
</properties>
......@@ -61,18 +62,18 @@
</dependency>
</dependencies>
<build>
<build>
<plugins>
<plugin>
<groupId>cn.com.glsx.framework</groupId>
<artifactId>rpc-api-deploy-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>cn.com.glsx.openplatform</groupId>
<artifactId>rpc-openplatform-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>cn.com.glsx.openplatform</groupId>
<artifactId>rpc-openplatform-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
......
......@@ -11,7 +11,8 @@ public class BusinessException extends RuntimeException {
private Integer code;
private String message;
public BusinessException() {}
public BusinessException() {
}
public BusinessException(Integer code, String message) {
this.code = code;
......@@ -26,12 +27,12 @@ public class BusinessException extends RuntimeException {
this.code = code;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
}
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.model;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.vo;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.vo;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
package cn.com.glsx.openplatform.vo;
import cn.com.glsx.openplatform.enums.ResultCodeEnum;
import java.util.HashMap;
import java.util.Map;
import cn.com.glsx.openplatform.enums.ResultCodeEnum;
/**
* 返回数据
*/
......@@ -96,22 +96,22 @@ public class R extends HashMap<String, Object> {
return this;
}
public void setMessage(String formatMessage) {
this.put(MSG_KEY, formatMessage);
}
public String getMessage() {
return (String) this.get(MSG_KEY);
}
public void setCode(int code) {
this.put(CODE_KEY, code);
public void setMessage(String formatMessage) {
this.put(MSG_KEY, formatMessage);
}
public int getCode() {
return (int) this.get(CODE_KEY);
}
public void setCode(int code) {
this.put(CODE_KEY, code);
}
public Object getData() {
return this.get(DATA_KEY);
}
......
package cn.com.glsx.openplatform.vo;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
......
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
......
......@@ -6,26 +6,24 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
/**
* @author deployer name
* @version V1.0
* @Title: Main.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@SpringBootApplication
@ServletComponentScan
public class Main extends AbsOreBootStarter {
@Override
public void run(String[] args)
{
SpringApplication.run(Main.class, args);
}
public static void main(String[] args)
{
Main main = new Main();
public static void main(String[] args) {
Main main = new Main();
main.run(args);
}
@Override
public void run(String[] args) {
SpringApplication.run(Main.class, args);
}
}
......@@ -2,31 +2,30 @@ package cn.com.glsx.openplatform.config;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author deployer name
* @version V1.0
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
/**
* 注册远程服务(示例)
* RpcRemote为需要调用的远程服务
* @return
*/
@Autowired
private ReferenceBuilderFactory factory;
/**
* 注册远程服务(示例)
* RpcRemote为需要调用的远程服务
* @return
*/
/*@Bean
public RpcRemote rpcApiMethodRemote(){
return factory.builder(RpcRemote.class).check(false).timeout(30000).build();
}*/
}
......@@ -28,7 +28,7 @@ public class RedisCacheConfig {
//定义value的序列化方式
template.setKeySerializer(redisSerializer);
// template.setValueSerializer(redisSerializer);
// template.setValueSerializer(redisSerializer);
template.afterPropertiesSet();
return template;
}
......
......@@ -4,26 +4,26 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* @author deployer name
* @version V1.0
* @Title: SystemProperty.java
* @Description:
* @author deployer name
* @version V1.0
* @Description:
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Configuration
@ConfigurationProperties("system")
public class SystemProperty {
// 对应配置项:system.name
private String name;
public String getName() {
return name;
}
// 对应配置项:system.name
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
}
......@@ -64,6 +64,19 @@ public class TaskExecutorPool {
return new SalesAsyncExceptionHandler();
}
private RejectedExecutionHandler initExecutionHandler(String executionHandler) {
if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_AP)) {
return new ThreadPoolExecutor.AbortPolicy();
} else if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_CRP)) {
return new ThreadPoolExecutor.CallerRunsPolicy();
} else if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_DOP)) {
return new ThreadPoolExecutor.DiscardOldestPolicy();
} else if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_DP)) {
return new ThreadPoolExecutor.DiscardPolicy();
}
return null;
}
class SalesAsyncExceptionHandler implements AsyncUncaughtExceptionHandler {
@Override
public void handleUncaughtException(Throwable throwable, Method method, Object... objects) {
......@@ -72,7 +85,7 @@ public class TaskExecutorPool {
excpBuffer.append(throwable.getMessage());
excpBuffer.append(" [Method name] - ");
excpBuffer.append(method.getName());
if (objects!=null && objects.length>0) {
if (objects != null && objects.length > 0) {
for (Object param : objects) {
excpBuffer.append(" [Parameter value] - ");
excpBuffer.append(param);
......@@ -82,17 +95,4 @@ public class TaskExecutorPool {
}
}
private RejectedExecutionHandler initExecutionHandler(String executionHandler) {
if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_AP)) {
return new ThreadPoolExecutor.AbortPolicy();
} else if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_CRP)) {
return new ThreadPoolExecutor.CallerRunsPolicy();
} else if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_DOP)) {
return new ThreadPoolExecutor.DiscardOldestPolicy();
} else if (executionHandler.equals(Constants.ThreadPoolPolicy.EXECUTION_HANDLER_DP)) {
return new ThreadPoolExecutor.DiscardPolicy();
}
return null;
}
}
\ No newline at end of file
......@@ -6,14 +6,14 @@ import cn.com.glsx.openplatform.vo.ApiCallVo;
import org.mapstruct.Mapper;
/**
* @author deployer name
* @version V1.0
* @Title: DemoConverter.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Mapper(componentModel = "spring")
public abstract class DemoConverter extends RpcBaseConverter<PlatformAd, ApiCallVo>{
public abstract class DemoConverter extends RpcBaseConverter<PlatformAd, ApiCallVo> {
}
......@@ -6,7 +6,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
......
......@@ -6,10 +6,10 @@ import cn.com.glsx.openplatform.vo.ApiCallVo;
import cn.com.glsx.openplatform.vo.R;
import cn.hutool.core.date.DateUtil;
import cn.hutool.db.Page;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
import java.util.Date;
......
......@@ -4,10 +4,10 @@ import cn.com.glsx.openplatform.mapper.PlatformApiMapper;
import cn.com.glsx.openplatform.model.PlatformApi;
import cn.com.glsx.openplatform.vo.R;
import cn.hutool.db.Page;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
import java.util.List;
......
package cn.com.glsx.openplatform.service;
import cn.com.glsx.openplatform.mapper.PlatformAppDownloadMapper;
import com.alibaba.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
......
......@@ -4,11 +4,11 @@ import cn.com.glsx.openplatform.mapper.PlatformCustomerMapper;
import cn.com.glsx.openplatform.model.PlatformCustomer;
import cn.com.glsx.openplatform.vo.R;
import cn.hutool.db.Page;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import net.dreamlu.mica.core.utils.RsaUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
import java.security.PrivateKey;
......
......@@ -7,10 +7,10 @@ import cn.com.glsx.openplatform.vo.DeviceVo;
import cn.com.glsx.openplatform.vo.R;
import cn.hutool.core.date.DateUtil;
import cn.hutool.db.Page;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
import java.util.Date;
......
package cn.com.glsx.openplatform.service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.com.glsx.openplatform.mapper.PlatformAppDownloadMapper;
import cn.com.glsx.openplatform.mapper.PlatformDeviceMapper;
import cn.com.glsx.openplatform.mapper.PlatformUserMapper;
......@@ -13,6 +8,12 @@ import com.alibaba.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>Description: 总览业务
* <p>Project: open-platform-admin
......
......@@ -6,10 +6,10 @@ import cn.com.glsx.openplatform.model.PlatformUser;
import cn.com.glsx.openplatform.vo.R;
import cn.com.glsx.openplatform.vo.UserVo;
import cn.hutool.db.Page;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
import java.util.List;
......
package cn.com.glsx.openplatform.util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.HashMap;
import java.util.Map;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.*;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.HashMap;
import java.util.Map;
/**
* RSA算法,实现数据的加密解密。
......
......@@ -23,12 +23,12 @@
<select id="getApiCallMgrList" parameterType="cn.com.glsx.openplatform.vo.ApiCallVo"
resultMap="BaseResultMap">
select a.id,
b.customer_name,
c.api_name,
a.call_result,
a.create_time,
a.create_by,
a.remark
b.customer_name,
c.api_name,
a.call_result,
a.create_time,
a.create_by,
a.remark
from t_platform_api_call a
left join t_platform_customer b on a.customer_id = b.id
left join t_platform_api c on a.api_id = c.id
......
......@@ -30,18 +30,18 @@
<select id="getAppDownloadStatistic" resultType="map">
select *
from (
select date_format(pad.create_time, '%Y-%m-%d') `time`,
count(pad.create_time) `count`
from t_platform_app_download pad
left join t_platform_customer pc on pc.id = pad.customer_id
<where>
pad.create_time >= #{startTime,jdbcType=TIMESTAMP}
and pad.create_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
select date_format(pad.create_time, '%Y-%m-%d') `time`,
count(pad.create_time) `count`
from t_platform_app_download pad
left join t_platform_customer pc on pc.id = pad.customer_id
<where>
pad.create_time >= #{startTime,jdbcType=TIMESTAMP}
and pad.create_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
order by a.time
</select>
</mapper>
......@@ -27,16 +27,16 @@
<select id="getDeviceMgrList" parameterType="cn.com.glsx.openplatform.vo.DeviceVo"
resultMap="BaseResultMap">
select a.id,
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_device a
left join t_platform_customer b on a.customer_id = b.id
where 1 = 1
......@@ -97,18 +97,18 @@
<select id="getDeviceActivationStatistic" resultType="map">
select *
from (
select date_format(pd.activat_time, '%Y-%m-%d') `time`,
count(pd.activat_time) `count`
from t_platform_device pd
left join t_platform_customer pc on pc.id = pd.customer_id
<where>
pd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and pd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
select date_format(pd.activat_time, '%Y-%m-%d') `time`,
count(pd.activat_time) `count`
from t_platform_device pd
left join t_platform_customer pc on pc.id = pd.customer_id
<where>
pd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and pd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
order by a.time
</select>
......
......@@ -32,21 +32,21 @@
<select id="getUserMgrList" parameterType="cn.com.glsx.openplatform.vo.UserVo"
resultMap="BaseResultMap">
select a.id,
a.nickname,
a.contact_number,
a.wechat_id,
a.province,
c.area_name as provinceName,
a.city,
d.area_name as cityName,
b.customer_name,
a.last_login_time,
a.app_account_id,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
a.nickname,
a.contact_number,
a.wechat_id,
a.province,
c.area_name as provinceName,
a.city,
d.area_name as cityName,
b.customer_name,
a.last_login_time,
a.app_account_id,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_user a
left join t_platform_customer b on a.customer_id = b.id
left join t_sys_area c on a.province = c.id
......@@ -81,18 +81,18 @@
<select id="getUserActivityStatistic" resultType="map">
select * from (
select date_format(pu.last_login_time, '%Y-%m-%d') `time`,
count(pu.last_login_time) `count`
from t_platform_user pu
left join t_platform_customer pc on pc.id = pu.customer_id
<where>
pu.last_login_time >= #{startTime,jdbcType=TIMESTAMP}
and pu.last_login_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
select date_format(pu.last_login_time, '%Y-%m-%d') `time`,
count(pu.last_login_time) `count`
from t_platform_user pu
left join t_platform_customer pc on pc.id = pu.customer_id
<where>
pu.last_login_time >= #{startTime,jdbcType=TIMESTAMP}
and pu.last_login_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time) a
order by a.time
</select>
......
......@@ -2,14 +2,11 @@ server.port=8240
server.display-name=rpc-openplatform-container
server.servlet.context-path=/rpc-openplatform-container
server.servlet.application-display-name=rpc-openplatform-container
logging.config=classpath:logback.xml
logging.path=/data/java_log/jetty/rpc-openplatform-container/rpc-openplatform-container.log
#logging.level.root=INFO
logging.level.root=debug
ore.starter.class-name=Main
# diamond config
ore.diamond.group=open-platform
ore.diamond.dataId=rpc-openplatform
......
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<property resource="config/application.properties" />
<property name="APP_NAME" value="${server.display-name}" />
<property name="LOG_PATH" value="${logging.path}" />
<property name="LOG_LEVEL" value="${logging.level}" />
<property resource="config/application.properties"/>
<property name="APP_NAME" value="${server.display-name}"/>
<property name="LOG_PATH" value="${logging.path}"/>
<property name="LOG_LEVEL" value="${logging.level}"/>
<contextName>${APP_NAME}</contextName>
<turboFilter class="org.oreframework.boot.logging.logback.OreBootTurboFilter">
<Marker>oreframework</Marker>
</turboFilter>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="org.oreframework.commons.log.OrePatternLayout">
<pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method
%line] - %msg%n
</pattern>
</pattern>
</layout>
</appender>
......@@ -25,13 +27,15 @@
<!-- <Encoding>UTF-8</Encoding> -->
<File>${LOG_PATH}</File>
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<FileNamePattern>${LOG_PATH}.%d{yyyy-MM-dd}.%i</FileNamePattern>
<MaxHistory>15</MaxHistory>
<maxFileSize>200MB</maxFileSize>
<maxFileSize>200MB</maxFileSize>
</rollingPolicy>
<layout class="org.oreframework.commons.log.OrePatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line] - %msg%n</pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [${APP_NAME}] [%traceid] [%thread] %-5level [%logger{36}.%method %line]
- %msg%n
</pattern>
</layout>
<!-- 根据文件大小滚动,不支持 SizeBasedTriggeringPolicy 这种配置-->
<!-- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
......@@ -68,9 +72,9 @@
</filter>
</appender>
<root level="${LOG_LEVEL}">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
<appender-ref ref="DruidFILE" />
<root level="${LOG_LEVEL}">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
<appender-ref ref="DruidFILE"/>
</root>
</configuration>
\ No newline at end of file
package cn.com.glsx.openplatform.remote;
import cn.com.glsx.openplatform.Main;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.openplatform.Main;
/**
* @author deployer name
* @version V1.0
* @Title: BaseRemoteTest.java
* @Description:
* @author deployer name
* @date 2018年1月6日 下午3:58:33
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseRemoteTest {
}
package cn.com.glsx.openplatform.remote;
import org.junit.Assert;
import org.junit.Test;
import com.alibaba.dubbo.config.annotation.Reference;
/**
* @author deployer name
* @version V1.0
* @Title: DemoRemoteTest.java
* @Description:
* @author deployer name
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
public class DemoRemoteTest extends BaseRemoteTest{
public class DemoRemoteTest extends BaseRemoteTest {
// @Reference
// private DemoRemote demoRemote;
//
......
package cn.com.glsx.openplatform.service;
import cn.com.glsx.openplatform.Main;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.com.glsx.openplatform.Main;
/**
* @author deployer name
* @version V1.0
* @Title: BaseServiceTest.java
* @Description:
* @author deployer name
* @date 2018年1月6日 下午1:23:03
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseServiceTest {
}
package cn.com.glsx.openplatform.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.junit.Assert;
import org.junit.Test;
/**
* @Title: DemoServiceTest.java
* @Description:
* @author deployer name
* @version V1.0
* @Title: DemoServiceTest.java
* @Description:
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
public class DemoServiceTest extends BaseServiceTest{
public class DemoServiceTest extends BaseServiceTest {
// @Autowired
// private DemoService demoService;
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<!-- 确保已安装mybatis generator eclipse插件 -->
<generatorConfiguration>
<context id="DB2Tables" targetRuntime="MyBatis3">
<property name="javaFileEncoding" value="UTF-8"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<context id="DB2Tables" targetRuntime="MyBatis3">
<property name="javaFileEncoding" value="UTF-8"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="org.oreframework.datasource.mybatis.mapper.OreMapper"/>
<property name="caseSensitive" value="true"/>
<property name="useActualColumnNames" value="true" />
<property name="useActualColumnNames" value="true"/>
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
</plugin>
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.3.227:3306/数据库名?characterEncoding=utf8" userId="dev_admin" password="1f7e1ed2" />
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<javaModelGenerator targetPackage="cn.com.glsx.openplatform.model" targetProject="../rpc-openplatform-container-api/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="META-INF/orm" targetProject="src/main/resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<javaClientGenerator targetPackage="cn.com.glsx.openplatform.mapper" targetProject="MAVEN" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 可配置多个 -->
<table tableName="数据库表名" domainObjectName="Java数据模型名" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.3.227:3306/数据库名?characterEncoding=utf8" userId="dev_admin"
password="1f7e1ed2"/>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<javaModelGenerator targetPackage="cn.com.glsx.openplatform.model"
targetProject="../rpc-openplatform-container-api/src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="META-INF/orm" targetProject="src/main/resources">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<javaClientGenerator targetPackage="cn.com.glsx.openplatform.mapper" targetProject="MAVEN" type="XMLMAPPER">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 可配置多个 -->
<table tableName="数据库表名" domainObjectName="Java数据模型名" enableSelectByExample="false" enableCountByExample="false"
enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</context>
</generatorConfiguration>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!