commit
1adf59bd4d
@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JpaPluginProjectSettings">
|
||||
<option name="entityNameTemplate" value="${className}" />
|
||||
<option name="generateJpaOnGetter" value="true" />
|
||||
<option name="generateSerialVersionUID" value="true" />
|
||||
<option name="isLombokGetterAndSetter" value="true" />
|
||||
<option name="isLombokToString" value="true" />
|
||||
<option name="isLombokOnlyExplicitlyIncluded" value="true" />
|
||||
<option name="isLombokRequiredArgsConstructor" value="true" />
|
||||
<option name="scaffoldingLanguage" />
|
||||
<option name="lastSelectedLanguage" value="Java" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,4 @@
|
||||
## 百度广告投放平台检测 - 百度营销
|
||||
https://dev2.baidu.com/content?sceneType=0&pageId=101214&nodeId=662&subhead=
|
||||
## 广电通 - 腾讯广告
|
||||
https://developers.e.qq.com/docs/guide/conversion/new_version/dianjijiance
|
@ -0,0 +1,87 @@
|
||||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.2.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.baiyee</groupId>
|
||||
<artifactId>ad-callback</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>ad-callback</name>
|
||||
<description>ad-callback</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
<maven.test.failure.ignore>true</maven.test.failure.ignore>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.16</version>
|
||||
</dependency>
|
||||
|
||||
<!-- druid数据源驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.1.22</version>
|
||||
</dependency>
|
||||
|
||||
<!--Mysql依赖包-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>5.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<!-- 配置跳过测试 -->
|
||||
<configuration>
|
||||
<skip>${maven.test.skip}</skip>
|
||||
<testFailureIgnore>${maven.test.failure.ignore}</testFailureIgnore>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,23 @@
|
||||
package com.baiyee.adcallback;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 广告回调程序
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
@SpringBootApplication
|
||||
// 开启定时任务功能
|
||||
@EnableScheduling
|
||||
public class AdCallbackApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdCallbackApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.baiyee.adcallback.api.common;
|
||||
|
||||
/**
|
||||
* Description: 自定义Response响应返回体 -> 这边采用的是
|
||||
* @author q
|
||||
*/
|
||||
public enum ResponseCode {
|
||||
|
||||
/**
|
||||
* 成功
|
||||
*/
|
||||
SUCCESS(0,"SUCCESS"),
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
ERROR(1,"ERROR"),
|
||||
|
||||
|
||||
/*
|
||||
* 请求参数校验
|
||||
*/
|
||||
ILLEGAL_ARGUMENT(1,"请求参数格式错误"),
|
||||
EMPTY_ARGUMENT(1,"请求参数为空"),
|
||||
|
||||
/*
|
||||
* 请求结果性的错误
|
||||
*/
|
||||
NO_REASON_ERROR(1,"未知异常错误发生"),
|
||||
SYSTEM_ERROR(1,"系统异常"),
|
||||
DECRYPT_ERROR(1,"解密错误,请联系相关人员");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
ResponseCode(int code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.baiyee.adcallback.api.constants;
|
||||
|
||||
/**
|
||||
* 详细的请求参数验证 - 错误信息
|
||||
*/
|
||||
public class RequestDetailConstant {
|
||||
|
||||
public static final String REQUEST_ADDR_EMPTY = "请求的地址为空";
|
||||
|
||||
public static final String REQUEST_PARAMS_EMPTY = "请求参数为空";
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.baiyee.adcallback.api.constants;
|
||||
|
||||
/**
|
||||
* 请求信息常量类
|
||||
*/
|
||||
public class RequestInfoConstant {
|
||||
|
||||
/**
|
||||
* 客户端请求地址标识名称
|
||||
*/
|
||||
public static final String CUSTOMER_IP_ADDR_KEY = "customer_ip_addr_key";
|
||||
|
||||
/**
|
||||
* 正式环境对应服务器绑定的域名
|
||||
*/
|
||||
public static final String PROD_SERVER_HOST = "http://bc.tuoz.net/";
|
||||
|
||||
/**
|
||||
* 本地开发路径 - 应用于本地服务器
|
||||
*/
|
||||
public static final String DEV_SERVER_HOST = "http://localhost:6666/";
|
||||
|
||||
/**
|
||||
* Http请求调用失败 重试次数
|
||||
*/
|
||||
public static final int RETRY_COUNT = 3;
|
||||
|
||||
/**
|
||||
* 默认的超时时长 默认是2000ms
|
||||
*/
|
||||
public static final int DEFAULT_TIMEOUT_NUMBER = 20000;
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.baiyee.adcallback.api.controller;
|
||||
|
||||
import com.baiyee.adcallback.api.common.CommonResponse;
|
||||
|
||||
/**
|
||||
* 广告创意管理控制器
|
||||
*
|
||||
* API doc
|
||||
* @see <a href="https://open.oceanengine.com/doc/index.html?key=ad&type=solution&id=1697474988931072#item-link-%E7%9B%91%E6%B5%8B%E9%93%BE%E6%8E%A5">创意Api</a>
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
public class AdOriginalityManageController {
|
||||
|
||||
|
||||
/**
|
||||
* 获取的创意列表
|
||||
*
|
||||
* @see <a href="https://open.oceanengine.com/doc/index.html?key=ad&type=api&id=1696710540735500#item-link-%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80"></a>
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
public CommonResponse getListOfOriginality(){
|
||||
return CommonResponse.createBySuccess();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建广告创意
|
||||
*
|
||||
* @see <a href="https://open.oceanengine.com/doc/index.html?key=ad&type=api&id=1696710541275148#item-link-%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80"></a>
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
public CommonResponse createOriginality(){
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创意的细节
|
||||
*
|
||||
* @see <a href="https://open.oceanengine.com/doc/index.html?key=ad&type=api&id=1696710541985792#item-link-%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80"></a>
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
public CommonResponse detailsOfOriginality(){
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑创意
|
||||
*
|
||||
* @see <a href="https://open.oceanengine.com/doc/index.html?key=ad&type=api&id=1696710542519311#item-link-%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80"></a>
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
public CommonResponse editOriginality(){
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新创意状态
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
public CommonResponse updateOriginalityState(){
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.baiyee.adcallback.api.controller;
|
||||
|
||||
/**
|
||||
* 基本控制器
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
public class BaseController {
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.baiyee.adcallback.api.controller;
|
||||
|
||||
|
||||
import com.baiyee.adcallback.api.common.CommonResponse;
|
||||
|
||||
/**
|
||||
* 飞鱼 源管理控制器
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
public class FeiyuSourceManageController {
|
||||
|
||||
/**
|
||||
* 得到飞鱼线索列表
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
public CommonResponse getListOfFeiyuSource(){
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.baiyee.adcallback.api.controller;
|
||||
|
||||
import com.baiyee.adcallback.api.common.CommonResponse;
|
||||
import com.baiyee.adcallback.service.JuliangMobileMonitorService;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* juliang移动监控控制器
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jl")
|
||||
public class JuliangMobileMonitorController {
|
||||
|
||||
|
||||
private final JuliangMobileMonitorService juliangMobileMonitorService;
|
||||
|
||||
public JuliangMobileMonitorController(JuliangMobileMonitorService juliangMobileMonitorService) {
|
||||
this.juliangMobileMonitorService = juliangMobileMonitorService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 得到形式db imei列表
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
@GetMapping("/getimei")
|
||||
public CommonResponse getImeiListFormDB() {
|
||||
|
||||
List<String> result = juliangMobileMonitorService.queryByImeiAdvancedMode();
|
||||
|
||||
return CommonResponse.createBySuccess(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* imei下载到文件
|
||||
*
|
||||
* @param date 日期 格式 yyyy-MM-dd
|
||||
* @param response 响应
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public void downloadImeiToFile(@RequestParam(value = "startDate") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date startDate,
|
||||
@RequestParam(value = "endDate") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date endDate,
|
||||
HttpServletResponse response){
|
||||
|
||||
juliangMobileMonitorService.downloadImeiFile(response, startDate, endDate);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.baiyee.adcallback.api.controller;
|
||||
|
||||
import com.baiyee.adcallback.api.common.CommonResponse;
|
||||
import com.baiyee.adcallback.service.TokenManageService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 令牌管理控制器
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
@RestController(value = "/token")
|
||||
public class TokenManageController {
|
||||
|
||||
private final TokenManageService tokenManageService;
|
||||
|
||||
public TokenManageController(TokenManageService tokenManageService) {
|
||||
this.tokenManageService = tokenManageService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访问令牌 - 这里
|
||||
*
|
||||
* @see <a href="https://open.oceanengine.com/doc/index.html?key=ad&type=api&id=1696710505596940"></a>
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
@PostMapping(value = "/get")
|
||||
public CommonResponse getAccessToken(){
|
||||
tokenManageService.getAccessToken();
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新令牌 - 类似于手动刷新接口 - 配合后台的过期时间内的规定频率的刷新
|
||||
*
|
||||
* @return {@link CommonResponse}
|
||||
*/
|
||||
@PostMapping(value = "/refresh")
|
||||
public CommonResponse refreshToken(){
|
||||
tokenManageService.refreshToken();
|
||||
return CommonResponse.createBySuccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.baiyee.adcallback.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* juliang移动监控调请求 vo
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/07
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JuliangMobileMonitorCallbackRequestVO implements Serializable {
|
||||
|
||||
|
||||
private String aid;
|
||||
private String aidName;
|
||||
private String advertiserId;
|
||||
private Long cid;
|
||||
private Integer ctype;
|
||||
private Integer csite;
|
||||
private String imei;
|
||||
private String idfa;
|
||||
private String oaid;
|
||||
private Integer os;
|
||||
private String mac;
|
||||
private String mac1;
|
||||
private String ip;
|
||||
private String geo;
|
||||
private Long ts;
|
||||
private String callbackUrl;
|
||||
private String model;
|
||||
private String caid12;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.baiyee.adcallback.common.constant;
|
||||
|
||||
/**
|
||||
* juliang常数
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
public class JuliangConstant {
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
public static final String BACK_URL = "http://cb.tuoz.net";
|
||||
|
||||
|
||||
/**
|
||||
* 获取Access Token 的 url
|
||||
*/
|
||||
public static final String GET_ACCESS_TOKEN_URL = "https://ad.oceanengine.com/open_api/oauth2/access_token/";
|
||||
|
||||
/**
|
||||
* 刷新Access Token 的 url
|
||||
*/
|
||||
public static final String REFRESH_ACCESS_TOKEN_URL = "https://ad.oceanengine.com/open_api/oauth2/refresh_token/";
|
||||
|
||||
/**
|
||||
* 获取已授权账户 - 这个接口的详细信息关联与 Token 表的 advertiser_ids 字段
|
||||
*/
|
||||
public static final String ADVERTISER_LIST_URL = "https://ad.oceanengine.com/open_api/oauth2/advertiser/get/";
|
||||
|
||||
public static final String IMEI_TAG = "__IMEI__";
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.baiyee.adcallback.common.pojo;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baiyee.adcallback.api.vo.JuliangMobileMonitorCallbackRequestVO;
|
||||
import com.baiyee.adcallback.repository.entity.TbJlBackdataEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JlBackdataDTO implements Serializable {
|
||||
|
||||
private String aid;
|
||||
private String aidName;
|
||||
private String advertiserId;
|
||||
private Long cid;
|
||||
private Integer ctype;
|
||||
private Integer csite;
|
||||
private String imei;
|
||||
private String idfa;
|
||||
private String oaid;
|
||||
private Integer os;
|
||||
private String mac;
|
||||
private String mac1;
|
||||
private String ip;
|
||||
private String geo;
|
||||
private Long ts;
|
||||
private String callbackUrl;
|
||||
private String model;
|
||||
private String caid12;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.baiyee.adcallback.common.pojo.convert;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiyee.adcallback.api.vo.JuliangMobileMonitorCallbackRequestVO;
|
||||
import com.baiyee.adcallback.common.pojo.JlBackdataDTO;
|
||||
import com.baiyee.adcallback.repository.entity.TbJlBackdataEntity;
|
||||
|
||||
public class JlBackdataConvert {
|
||||
|
||||
/**
|
||||
* 私有化构造
|
||||
*/
|
||||
private JlBackdataConvert(){}
|
||||
|
||||
private static final ThreadLocal<JlBackdataDTO> context = new ThreadLocal<>();
|
||||
|
||||
/**
|
||||
* vo 转换为 dto -> 存放在当前线程上下文中
|
||||
*
|
||||
* @param vo 对象
|
||||
*/
|
||||
public static void voCovertToDTO(JuliangMobileMonitorCallbackRequestVO vo, JlBackdataDTO dto) {
|
||||
BeanUtil.copyProperties(vo, dto, true);
|
||||
context.set(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为实体
|
||||
*
|
||||
* @return {@link TbJlBackdataEntity}
|
||||
*/
|
||||
public static TbJlBackdataEntity covertToEntity(TbJlBackdataEntity entity) {
|
||||
JlBackdataDTO jlBackdataDTO = context.get();
|
||||
if (ObjectUtil.isNotNull(jlBackdataDTO)){
|
||||
BeanUtil.copyProperties(jlBackdataDTO, entity, true);
|
||||
}
|
||||
context.remove();
|
||||
return entity;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.baiyee.adcallback.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.domain.AuditorAware;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||
|
||||
@Configuration
|
||||
@EnableJpaAuditing
|
||||
public class AuditingConfig {
|
||||
@Bean
|
||||
public AuditorAware<String> auditorProvider() {
|
||||
return new DefaultAuditorAwareImpl();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.baiyee.adcallback.config;
|
||||
|
||||
import org.springframework.data.domain.AuditorAware;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class DefaultAuditorAwareImpl implements AuditorAware<String> {
|
||||
@Override
|
||||
public Optional<String> getCurrentAuditor() {
|
||||
|
||||
String testName = "test123";
|
||||
|
||||
return Optional.of(testName);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.baiyee.adcallback.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
|
||||
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Collections;
|
||||
|
||||
@Component
|
||||
public class SpringMVCConfiguration {
|
||||
|
||||
|
||||
@Bean
|
||||
public ConversionService conversionService() {
|
||||
FormattingConversionServiceFactoryBean factory = new FormattingConversionServiceFactoryBean();
|
||||
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
|
||||
registrar.setDateFormatter(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
factory.setFormatterRegistrars(Collections.singleton(registrar));
|
||||
factory.afterPropertiesSet();
|
||||
return factory.getObject();
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.baiyee.adcallback.repository;
|
||||
|
||||
import com.baiyee.adcallback.repository.entity.TbJlBackdataEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface TbJlBackdataEntityRepository extends JpaRepository<TbJlBackdataEntity, Long> {
|
||||
|
||||
|
||||
@Query(value = "SELECT imei FROM tb_jl_backdata WHERE imei != '' AND imei != '__IMEI__'", nativeQuery = true)
|
||||
List<String> queryAllImei();
|
||||
|
||||
@Query(value = "SELECT imei FROM tb_jl_backdata WHERE imei != '' AND imei != '__IMEI__' AND gmt_create > :startDate AND gmt_create < :endDate", nativeQuery = true)
|
||||
List<String> queryAllImeiByDate(Date startDate, Date endDate);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.baiyee.adcallback.repository;
|
||||
|
||||
import com.baiyee.adcallback.repository.entity.TbJlTokenEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TbJlTokenEntityRepository extends JpaRepository<TbJlTokenEntity, Long> {
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.baiyee.adcallback.repository.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedBy;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 结核病jl backdata实体
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/07
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tb_jl_backdata", schema = "db_ad", catalog = "")
|
||||
@Data
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class TbJlBackdataEntity {
|
||||
|
||||
|
||||
@Id
|
||||
@Column(name = "id", nullable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long id;
|
||||
|
||||
@CreatedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "gmt_create", nullable = false)
|
||||
private Date gmtCreate;
|
||||
|
||||
@LastModifiedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Column(name = "gmt_modify", nullable = false)
|
||||
private Date gmtModify;
|
||||
|
||||
@LastModifiedBy
|
||||
@Column(name = "operator", nullable = false, length = 255)
|
||||
private String operator;
|
||||
@Basic
|
||||
@Column(name = "aid", nullable = false, length = 255)
|
||||
private String aid;
|
||||
@Basic
|
||||
@Column(name = "aid_name", nullable = false, length = 255)
|
||||
private String aidName;
|
||||
@Basic
|
||||
@Column(name = "advertiser_id", nullable = false, length = 255)
|
||||
private String advertiserId;
|
||||
@Basic
|
||||
@Column(name = "cid", nullable = false)
|
||||
private long cid;
|
||||
@Basic
|
||||
@Column(name = "ctype", nullable = false)
|
||||
private byte ctype;
|
||||
@Basic
|
||||
@Column(name = "csite", nullable = false)
|
||||
private int csite;
|
||||
@Basic
|
||||
@Column(name = "imei", nullable = false, length = 255)
|
||||
private String imei;
|
||||
@Basic
|
||||
@Column(name = "idfa", nullable = false, length = 255)
|
||||
private String idfa;
|
||||
@Basic
|
||||
@Column(name = "oaid", nullable = false, length = 255)
|
||||
private String oaid;
|
||||
@Basic
|
||||
@Column(name = "os", nullable = false)
|
||||
private byte os;
|
||||
@Basic
|
||||
@Column(name = "mac", nullable = false, length = 255)
|
||||
private String mac;
|
||||
@Basic
|
||||
@Column(name = "mac1", nullable = false, length = 255)
|
||||
private String mac1;
|
||||
@Basic
|
||||
@Column(name = "ip", nullable = false, length = 255)
|
||||
private String ip;
|
||||
@Basic
|
||||
@Column(name = "geo", nullable = false, length = 255)
|
||||
private String geo;
|
||||
@Basic
|
||||
@Column(name = "ts", nullable = false)
|
||||
private long ts;
|
||||
@Basic
|
||||
@Column(name = "callback_url", nullable = false, length = 255)
|
||||
private String callbackUrl;
|
||||
@Basic
|
||||
@Column(name = "model", nullable = false, length = 255)
|
||||
private String model;
|
||||
@Basic
|
||||
@Column(name = "caid12", nullable = false, length = 255)
|
||||
private String caid12;
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.baiyee.adcallback.repository.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedBy;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@Table(name = "tb_jl_token", schema = "db_ad", catalog = "")
|
||||
@Data
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class TbJlTokenEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long id;
|
||||
@Column(name = "gmt_create")
|
||||
@CreatedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date gmtCreate;
|
||||
@LastModifiedDate
|
||||
@Column(name = "gmt_modify")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date gmtModify;
|
||||
@Basic
|
||||
@LastModifiedBy
|
||||
@Column(name = "operator")
|
||||
private String operator;
|
||||
@Basic
|
||||
@Column(name = "access_token")
|
||||
private String accessToken;
|
||||
@Basic
|
||||
@Column(name = "expires_in")
|
||||
private int expiresIn;
|
||||
@Basic
|
||||
@Column(name = "refresh_token")
|
||||
private String refreshToken;
|
||||
@Basic
|
||||
@Column(name = "refresh_token_expires_in")
|
||||
private int refreshTokenExpiresIn;
|
||||
@Basic
|
||||
@Column(name = "advertiser_ids")
|
||||
private String advertiserIds;
|
||||
@Basic
|
||||
@Column(name = "auth_code")
|
||||
private String authCode;
|
||||
@Basic
|
||||
@Column(name = "state")
|
||||
private String state;
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.baiyee.adcallback.service;
|
||||
|
||||
/**
|
||||
* 广告创意管理服务
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/07
|
||||
*/
|
||||
public interface AdOriginalityManageService {
|
||||
/**
|
||||
* 处理监测数据然后保存回调
|
||||
*/
|
||||
void handleMonitorUrlCallbackDataThenSave();
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.baiyee.adcallback.service;
|
||||
|
||||
public interface FeiyuSourceManageService {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.baiyee.adcallback.service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface JuliangMobileMonitorService {
|
||||
|
||||
List<String> queryByImeiAdvancedMode();
|
||||
|
||||
void downloadImeiFile(HttpServletResponse response, Date startDate, Date endDate);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.baiyee.adcallback.service;
|
||||
|
||||
import com.baiyee.adcallback.repository.entity.TbJlTokenEntity;
|
||||
|
||||
/**
|
||||
* 令牌管理服务
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/05
|
||||
*/
|
||||
public interface TokenManageService {
|
||||
|
||||
/**
|
||||
* 保存回调参数
|
||||
*
|
||||
*/
|
||||
void saveCallbackParam();
|
||||
|
||||
|
||||
/**
|
||||
* 查询回调参数
|
||||
*
|
||||
* @return {@link TbJlTokenEntity}
|
||||
*/
|
||||
TbJlTokenEntity queryCallbackParam();
|
||||
|
||||
/**
|
||||
* 获取访问令牌
|
||||
*/
|
||||
void getAccessToken();
|
||||
|
||||
/**
|
||||
* 刷新令牌
|
||||
*/
|
||||
void refreshToken();
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.baiyee.adcallback.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiyee.adcallback.common.pojo.convert.JlBackdataConvert;
|
||||
import com.baiyee.adcallback.repository.TbJlBackdataEntityRepository;
|
||||
import com.baiyee.adcallback.repository.entity.TbJlBackdataEntity;
|
||||
import com.baiyee.adcallback.service.AdOriginalityManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 广告创意管理服务impl
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/07
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AdOriginalityManageServiceImpl implements AdOriginalityManageService {
|
||||
|
||||
private final TbJlBackdataEntityRepository repository;
|
||||
|
||||
public AdOriginalityManageServiceImpl(TbJlBackdataEntityRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMonitorUrlCallbackDataThenSave() {
|
||||
|
||||
TbJlBackdataEntity entity = new TbJlBackdataEntity();
|
||||
TbJlBackdataEntity backEntity = JlBackdataConvert.covertToEntity(entity);
|
||||
|
||||
TbJlBackdataEntity save = repository.save(backEntity);
|
||||
if (ObjectUtil.isNull(save)){
|
||||
log.error("============================= [save a data fail save is {} ] =============================", save);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.baiyee.adcallback.service.impl;
|
||||
|
||||
import com.baiyee.adcallback.service.FeiyuSourceManageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class FeiyuSourceManageServiceImpl implements FeiyuSourceManageService {
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.baiyee.adcallback.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baiyee.adcallback.common.util.FileUtil;
|
||||
import com.baiyee.adcallback.repository.TbJlBackdataEntityRepository;
|
||||
import com.baiyee.adcallback.service.JuliangMobileMonitorService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* impl juliang移动监控服务
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/10
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class JuliangMobileMonitorServiceImpl implements JuliangMobileMonitorService {
|
||||
|
||||
|
||||
private final TbJlBackdataEntityRepository tbJlBackdataEntityRepository;
|
||||
|
||||
public JuliangMobileMonitorServiceImpl(TbJlBackdataEntityRepository tbJlBackdataEntityRepository) {
|
||||
this.tbJlBackdataEntityRepository = tbJlBackdataEntityRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询imei先进模式
|
||||
*
|
||||
* @return {@link List}<{@link String}>
|
||||
*/
|
||||
@Override
|
||||
public List<String> queryByImeiAdvancedMode() {
|
||||
|
||||
List<String> entities = tbJlBackdataEntityRepository.queryAllImei();
|
||||
|
||||
|
||||
List<String> results = new ArrayList<>(1000);
|
||||
|
||||
Map<String, Integer> resultByCountMap = CollectionUtil.countMap(entities);
|
||||
|
||||
resultByCountMap.forEach((k, v) -> {
|
||||
results.add(k + "," + v);
|
||||
});
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadImeiFile(HttpServletResponse response,
|
||||
@RequestParam(value = "startDate") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")Date startDate,
|
||||
@RequestParam(value = "endDate")@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endDate) {
|
||||
|
||||
|
||||
List<String> entities = tbJlBackdataEntityRepository.queryAllImeiByDate(startDate, endDate);
|
||||
|
||||
Map<String, Integer> resultByCountMap = CollectionUtil.countMap(entities);
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
|
||||
resultByCountMap.forEach(
|
||||
(k, v) -> {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("imei", k);
|
||||
map.put("weight", v);
|
||||
list.add(map);
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
FileUtil.downloadExcel(list, response);
|
||||
} catch (IOException e) {
|
||||
log.error("============================================== [downloadExcel error!] ==============================================");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.baiyee.adcallback.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.baiyee.adcallback.api.constants.RequestInfoConstant;
|
||||
import com.baiyee.adcallback.common.constant.JuliangConstant;
|
||||
import com.baiyee.adcallback.common.request.JuliangRequestParam;
|
||||
import com.baiyee.adcallback.repository.entity.TbJlTokenEntity;
|
||||
import com.baiyee.adcallback.service.TokenManageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* 巨量引擎 - 固定的时间自动刷新令牌任务
|
||||
*
|
||||
* @author q
|
||||
* @date 2022/01/06
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FixedTimeAutoRefreshJuliangTokenTask {
|
||||
|
||||
private final TokenManageService tokenManageService;
|
||||
|
||||
public FixedTimeAutoRefreshJuliangTokenTask(TokenManageService tokenManageService) {
|
||||
this.tokenManageService = tokenManageService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定时任务驱动的执行规则
|
||||
*/
|
||||
@Scheduled(cron = "0 0 23 1/1 * ?")
|
||||
public void scheduledRule() {
|
||||
log.info(" =============================== [定时刷新Token任务已经执行, 执行时间为 {} ] ===============================", DateUtil.date());
|
||||
execute();
|
||||
log.info(" =============================== [定时刷新Token任务执行完成, 执行时间为 {} ] ===============================", DateUtil.date());
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行
|
||||
*/
|
||||
public void execute() {
|
||||
tokenManageService.refreshToken();
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
x-debug:
|
||||
mode: '1'
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/db_ad?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 10
|
||||
# 最大连接数
|
||||
max-active: 20
|
||||
# 获取连接超时时间
|
||||
max-wait: 5000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
# # 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
@ -0,0 +1,45 @@
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp1693kl5d490o5cn.mysql.rds.aliyuncs.com:3306/db_ad?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
|
||||
username: prod
|
||||
password: yuyou@RDS9495
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 10
|
||||
# 最大连接数
|
||||
max-active: 20
|
||||
# 获取连接超时时间
|
||||
max-wait: 5000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
@ -0,0 +1,45 @@
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/db_ad?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: Yuyou@2020
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 10
|
||||
# 最大连接数
|
||||
max-active: 20
|
||||
# 获取连接超时时间
|
||||
max-wait: 5000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
@ -0,0 +1,55 @@
|
||||
server:
|
||||
port: 9191
|
||||
spring:
|
||||
application:
|
||||
name: ad-callback
|
||||
profiles:
|
||||
active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
serialization:
|
||||
#格式化输出
|
||||
indent_output: true
|
||||
#忽略无法转换的对象
|
||||
fail_on_empty_beans: false
|
||||
#设置空如何序列化
|
||||
defaultPropertyInclusion: NON_EMPTY
|
||||
deserialization:
|
||||
#允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
parser:
|
||||
#允许出现特殊字符和转义符
|
||||
allow_unquoted_control_chars: true
|
||||
#允许出现单引号
|
||||
allow_single_quotes: true
|
||||
|
||||
# 配置 Jpa
|
||||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
ddl-auto: none
|
||||
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
open-in-view: true
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 5000
|
||||
|
||||
# 配置日志
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
|
||||
# 线程池配置
|
||||
short:
|
||||
chain:
|
||||
task:
|
||||
corePoolSize: 4
|
||||
maxPoolSize: 32
|
||||
queueCapacity: 100
|
||||
ThreadNamePrefix: 'XXX-'
|
@ -0,0 +1,13 @@
|
||||
package com.baiyee.adcallback;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class AdCallbackApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue