[新增功能](master): 初始化工程

对整个工程模块进行了搭建和区分;
master
土豆兄弟 3 years ago
commit 8c761b4e94

46
.gitignore vendored

@ -0,0 +1,46 @@
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen

@ -0,0 +1,21 @@
<h1><div style="text-align: center; color: cornflowerblue">百业广告平台业务系统 v0.0.1</div></h1>
## 0. 主要功能设计
ad-platform-callback
设计回调处理,对头条广告投放平台,百度广告投放平台,广点通投放平台的广告点击进行检测
ad-platform-service
对进行整理后的点击数据对外提供查询接口服务
ad-platform-common
通用的工具及pojo包
## 1. 核心链路
配置回调地址及参数 -> 检测回调结果进行入库 -> 提供接口进行查询 -> 导出查询后的结果
## 2. 涉及核心技术及框架
储存中间件 分表分库(ShardingJDBC)
框架技术选型 : SpringBoot , JPA
数据存储选型 : Mysql , ES
中间件: RocketMQ, 缓存, Canal

@ -0,0 +1,46 @@
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen

@ -0,0 +1,39 @@
<?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>ad-platform</artifactId>
<groupId>com.baiye</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ad-platform-callback</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- springboot 相关的 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- 工具相关的 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,15 @@
package com.baiye;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author q
*/
@SpringBootApplication
public class AdPlatformCallbackApplication {
public static void main(String[] args) {
SpringApplication.run(AdPlatformCallbackApplication.class, args);
}
}

@ -0,0 +1,4 @@
package com.baiye.api;
public class JuLiangOpenAPi {
}

@ -0,0 +1,17 @@
package com.baiye.constant;
/**
*
*
* @author q
*/
public class CallBackCommonTags {
public static String HOSTNAME_TAG = "^[hostname]";
public static String M_PLAT_TAG = "^[m_plat]";
public static String PRO_TYPE_TAG = "^[pro_type]";
public static String level = "^[level]";
}

@ -0,0 +1,21 @@
package com.baiye.constant;
/**
*
*
* @author q
*/
public class CallbackAddressConstant {
public static String TOUTIAO_ADD_ADDRESSS = "https://"
+CallBackCommonTags.HOSTNAME_TAG
+"/callbacks/oceanCallback?aid=__AID__&aid_name=__AID_NAME__&cid=__CID__&cid" +
"_name=__CID_NAME__&campaign_id=__CAMPAIGN_ID__&campaign_name=__CAMPAIGN_NAME__&c" +
"type=__CTYPE__&csite=__CSITE__&convert_id=__CONVERT_ID__&request_id=__REQUEST_ID__&sl=__SL" +
"__&imei=__IMEI__&idfa=__IDFA__&androidid=__ANDROIDID__&oaid=__OAID__&oaid_md5=__OAID_M" +
"D5__&os=__OS__&mac=__MAC__&mac1=__MAC1__&ip=__IP__&ua=__UA__&geo=__GEO__&TIMESTAMP" +
"=__TS__&callback=__CALLBACK_URL__&model=__MODEL__&union_site=__UNION_SITE__&caid1=__CAI\n" +
"D1__&m_plat=toutiao&pro_type=⼴告类型标识&level=⼴告点击层级";
}

@ -0,0 +1,46 @@
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen

@ -0,0 +1,31 @@
<?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>ad-platform</artifactId>
<groupId>com.baiye</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ad-platform-common</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,117 @@
package com.baiye.http;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* "" NULL json
* @param <T>
*/
@JsonSerialize
@Getter
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@NoArgsConstructor
public class CommonResponse<T> implements Serializable {
/**
* 0, 1,
*/
private int status;
/**
*
*/
private String msg;
/**
*
*/
private T data;
/*
*/
private CommonResponse(int status) {
this.status = status;
}
private CommonResponse(int status, T data) { // ps: 当调用T为String类型时候,会默认调用下面的ServerResponse(int status, String msg)类型的构造器
this.status = status;
this.data = data;
}
private CommonResponse(int status, String msg, T data) {
this.status = status;
this.msg = msg;
this.data = data;
}
private CommonResponse(int status, String msg) {
this.status = status;
this.msg = msg;
}
/*
,,
*/
/**
*
*/
public static <T> CommonResponse<T> createBySuccess() {
return new CommonResponse<T>(ResponseCode.SUCCESS.getCode(),ResponseCode.SUCCESS.getDesc());
}
/**
*
*/
public static <T> CommonResponse<T> createBySuccessMessage(String msg) {
return new CommonResponse<T>(ResponseCode.SUCCESS.getCode(), msg);
}
/**
*
*/
public static <T> CommonResponse<T> createBySuccess(T data) {
return new CommonResponse<T>(ResponseCode.SUCCESS.getCode(), data);
}
/**
*
*/
public static <T> CommonResponse<T> createBySuccess(String msg, T data) {
return new CommonResponse<T>(ResponseCode.SUCCESS.getCode(), msg, data);
}
/*
,,
*/
/**
*
*/
public static <T> CommonResponse<T> createByError(){
return new CommonResponse<T>(ResponseCode.ERROR.getCode(),ResponseCode.ERROR.getDesc());
}
/**
* ()
*/
public static <T> CommonResponse<T> createByErrorMessage(String errorMessage){
return new CommonResponse<T>(ResponseCode.ERROR.getCode(),errorMessage);
}
/**
* ()()
*/
public static <T> CommonResponse<T> createByErrorCodeMessage(int errorCode,String errorMessage){
return new CommonResponse<T>(errorCode,errorMessage);
}
}

@ -0,0 +1,54 @@
package com.baiye.http;
/**
* FileName: ResponseCode
* Date: 2019/12/11 20:30
* Description: Response ->
* History:
* <author> <time> <version> <desc>
* x 2019/12/11 v 1.0
* @author q
*/
public enum ResponseCode {
/**
*
*/
SUCCESS(0,"SUCCESS"),
/**
*
*/
ERROR(1,"ERROR"),
/**
*
*/
ILLEGAL_ARGUMENT(1,"请求参数格式错误"),
/**
*
*/
EMPTY_ARGUMENT(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,46 @@
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen

@ -0,0 +1,46 @@
<?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>ad-platform</artifactId>
<groupId>com.baiye</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ad-platform-service</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- 通用依赖 -->
<dependency>
<groupId>com.baiye</groupId>
<artifactId>ad-platform-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- springboot 相关的 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- 工具相关的 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,15 @@
package com.baiye;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author q
*/
@SpringBootApplication
public class AdPlatformServiceApplication {
public static void main(String[] args) {
SpringApplication.run(AdPlatformServiceApplication.class, args);
}
}

@ -0,0 +1,12 @@
package com.baiye.api;
import org.springframework.web.bind.annotation.RestController;
/**
* @author q
*/
@RestController
public class AdPlatformAddressController {
}

@ -0,0 +1,46 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baiye</groupId>
<artifactId>ad-platform</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>ad-platform-callback</module>
<module>ad-platform-service</module>
<module>ad-platform-common</module>
</modules>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring.boot.version>2.3.2.RELEASE</spring.boot.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- springboot dependencies 用于管理版本-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 引入工具类 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.13</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Loading…
Cancel
Save