Commit 0dc8fa56 by yinyong

Amazon广告费

parent d1caf948
<?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>data-base</artifactId>
<groupId>com.bailuntec</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>base_sync_finance_amazon</artifactId>
<name>base_sync_finance_amazon</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.bailuntec</groupId>
<artifactId>data-common</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
package com.bailuntec;
import com.alibaba.druid.pool.DruidDataSource;
import com.bailuntec.job.AmazonFinanceSyncJob;
import com.bailuntec.utils.PropertiesUtil;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
import com.dangdang.ddframe.job.event.JobEventConfiguration;
import com.dangdang.ddframe.job.event.rdb.JobEventRdbConfiguration;
import com.dangdang.ddframe.job.lite.api.JobScheduler;
import com.dangdang.ddframe.job.lite.config.LiteJobConfiguration;
import com.dangdang.ddframe.job.reg.base.CoordinatorRegistryCenter;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import lombok.extern.slf4j.Slf4j;
import javax.sql.DataSource;
@Slf4j
public class Application {
private static PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("job");
private static final String EVENT_RDB_STORAGE_DRIVER = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_DRIVER");
private static final String EVENT_RDB_STORAGE_URL = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_URL");
private static final String EVENT_RDB_STORAGE_USERNAME = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_USERNAME");
private static final String EVENT_RDB_STORAGE_PASSWORD = propertiesUtil.getPropertyAsString("EVENT_RDB_STORAGE_PASSWORD");
public static void main(String[] args) {
new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init();
}
private static CoordinatorRegistryCenter createRegistryCenter() {
CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(propertiesUtil.getPropertyAsString("ZOOKEEPER_SERVER"), propertiesUtil.getPropertyAsString("NAME_SPACE")));
regCenter.init();
return regCenter;
}
private static LiteJobConfiguration createJobConfiguration1() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_NAME"), propertiesUtil.getPropertyAsString("JOB_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, AmazonFinanceSyncJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static JobEventConfiguration createJobEventConfiguration() {
JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource());
return jobEventRdbConfig;
}
private static DataSource setUpEventTraceDataSource() {
DruidDataSource result = new DruidDataSource();
result.setDriverClassName(EVENT_RDB_STORAGE_DRIVER);
result.setUrl(EVENT_RDB_STORAGE_URL);
result.setUsername(EVENT_RDB_STORAGE_USERNAME);
result.setPassword(EVENT_RDB_STORAGE_PASSWORD);
return result;
}
}
package com.bailuntec.domain;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.List;
@Data
public class AdvertResultData {
@JSONField(name = "task_id")
private Integer taskId;
private Boolean success;
private List<String> data;
}
package com.bailuntec.domain;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.List;
@Data
public class AdvertResultInfo {
private Integer code;
private String msg;
private List<AdvertResultData> results;
@JSONField(name= "task_ids")
private String taskIds;
}
package com.bailuntec.domain;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class AmazonAdvert {
private Integer id;
private String campaignName;
private String campaignId;
private String campaignStatus;
private Integer campaignBudget;
@JSONField(name = "attributedConversions1d")
private Integer attributedConversionsOneday;
@JSONField(name = "attributedUnitsOrdered1d")
private Integer attributedUnitsOrderedOneday;
@JSONField(name = "attributedSales1d")
private Integer attributedSalesOneday;
@JSONField(name = "attributedUnitsOrdered7d")
private Integer attributedUnitsOrderedSevenday;
private Integer impressions;
private Integer clicks;
private BigDecimal cost;
@JSONField(name = "attributedConversions30d")
private Integer attributedConversionsThirtyday;
@JSONField(name = "attributedConversions14d")
private Integer attributedConversionsFourteenday;
@JSONField(name = "attributedConversions7d")
private Integer attributedConversionsSevenday;
@JSONField(name = "attributedSales30d")
private Integer attributedSalesThirtyday;
@JSONField(name = "attributedSales14d")
private Integer attributedSalesFourteenday;
@JSONField(name = "attributedSales7d")
private Integer attributedSalesSevenday;
private String currency;
private Integer accountId;
private Integer companyId;
}
package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.bailuntec.domain.AdvertResultData;
import com.bailuntec.domain.AdvertResultInfo;
import com.bailuntec.domain.AmazonAdvert;
import com.bailuntec.domain.entity.JobAccountLog;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.enumerate.AccountPlatformType;
import com.bailuntec.domain.example.DcBaseCompanyAccountExample;
import com.bailuntec.domain.example.JobAccountLogExample;
import com.bailuntec.mapper.DcAmazonAdvertMapper;
import com.bailuntec.mapper.DcBaseCompanyAccountMapper;
import com.bailuntec.mapper.JobAccountLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.beanutils.BeanUtils;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Slf4j
public class AmazonFinanceSyncJob extends PointJob {
private PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("const");
private OkHttpClient client = OkHttpUtil.getInstance();
@Override
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
int totalPage = getCount(jobPointLog);//分片即将处理的账号总数
try {
JobAccountLogMapper jobAccountLogMapper = SessionUtil.getSession().getMapper(JobAccountLogMapper.class);
int pageSize = totalPage % shardingContext.getShardingTotalCount() == 0 ? totalPage / shardingContext.getShardingTotalCount() : totalPage / shardingContext.getShardingTotalCount() + 1;
List<JobAccountLog> listByPage = jobAccountLogMapper.getListByPage(AccountPlatformType.Amazon.code(), pageSize * shardingContext.getShardingItem(), pageSize);
if (listByPage != null && listByPage.size() > 0) {
for (JobAccountLog jobAccountLog : listByPage) {
log.warn("分片: " + shardingContext.getShardingItem() + " 账号: " + jobAccountLog);
if (jobAccountLog.getId() == null) { //在任务表无记录
BeanUtils.copyProperties(jobAccountLog, jobPointLog);
jobAccountLog.setId(null);
}
callAddTask(jobAccountLog);
if (jobAccountLog.getId() == null) { //在任务表无记录
jobAccountLogMapper.insertSelective(jobAccountLog);
} else {
jobAccountLog.setBjModified(LocalDateTime.now());
jobAccountLogMapper.updateByExampleSelective(jobAccountLog, JobAccountLogExample.newAndCreateCriteria().andAccountIdEqualTo(jobAccountLog.getAccountId()).andJobNameEqualTo(jobAccountLog.getJobName()).example());
}
}
}
} catch (Exception e) {
e.printStackTrace();
log.warn("Amazon广告费定时同步费用接口错误", e);
} finally {
SessionUtil.closeSession();
}
}
private int getCount(JobPointLog jobPointLog) {
int i = 0;
try {
DcBaseCompanyAccountMapper accountMapper = SessionUtil.getSession().getMapper(DcBaseCompanyAccountMapper.class);
i = (int) accountMapper.countByExample(DcBaseCompanyAccountExample.newAndCreateCriteria().andPlatformIdEqualTo(AccountPlatformType.Amazon.code()).example());
} catch (Exception e) {
e.printStackTrace();
} finally {
SessionUtil.closeSession();
}
return i;
}
public void callAddTask(JobAccountLog job) {
LocalDateTime localDateTime = job.getStartTime();
String resultStr = "";
String str = "[\"campaignName\", \"campaignId\", \"campaignStatus\", \"campaignBudget\", \"attributedConversions1d\", \"attributedUnitsOrdered1d\", \"attributedSales1d\", \"attributedUnitsOrdered7d\", \"attributedSales1d\", \"impressions\", \"clicks\", \"cost\", \"attributedConversions30d\", \"attributedConversions14d\", \"attributedConversions7d\", \"attributedSales30d\", \"attributedSales14d\", \"attributedSales7d\"]";
HashMap<String, Object> map = new HashMap<>();
List listTasks = new ArrayList();
HashMap<String, Object> mapTasks = new HashMap<>();
HashMap<String, Object> mapTaskInfo = new HashMap<>();
List listMetrics = JSON.parseObject(str, List.class);
mapTaskInfo.put("type", "sp");
mapTaskInfo.put("record_type", "campaigns");
mapTaskInfo.put("segment", null);
mapTaskInfo.put("metrics", listMetrics);
mapTasks.put("account_id", job.getAccountId());
mapTasks.put("task_type", "amazon:advertising:report");
mapTasks.put("task_info", mapTaskInfo);
map.put("app_id", 1);
listTasks.add(mapTasks);
map.put("tasks", listTasks);
MediaType mediaType = MediaType.parse("application/json");
Response response = null;
List<List<Integer>> taskIdsLists = new ArrayList<>();
try {
do {
mapTaskInfo.put("report_date", localDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")));
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
Request request = new Request.Builder()
.url(propertiesUtil.getPropertyAsString("ADDTASK_FINANCE_URL"))
.post(body)
.addHeader("Content-Type", "application/json")
.build();
response = client.newCall(request).execute();
AdvertResultInfo advertResult = JSON.parseObject(response.body().string(), AdvertResultInfo.class);
if (advertResult != null && advertResult.getCode() == 0) {
resultStr = advertResult.getTaskIds();
List<Integer> idsLists = JSON.parseArray(resultStr, Integer.class);
taskIdsLists.add(idsLists);
}
localDateTime = localDateTime.plusDays(1L);
} while (localDateTime.compareTo(job.getEndTime()) <= 0);
for (List<Integer> taskIdsList : taskIdsLists) {
callSaasApi(job, taskIdsList);
}
job.setStartTime(job.getEndTime());
job.setEndTime(job.getStartTime().plusDays(job.getIntervalTime()).isAfter(LocalDateTime.now()) ? LocalDateTime.now() : job.getEndTime().plusDays(job.getIntervalTime()));
job.setMessage("执行成功");
} catch (Exception e) {
job.setMessage(e.getMessage());
} finally {
if (response != null) {
response.close();
}
}
}
;
public void callSaasApi(JobAccountLog job, List<Integer> ids) {
HashMap<String, Object> map = new HashMap<>(2);
map.put("app_id", 1);
map.put("task_ids", ids);
MediaType mediaType = MediaType.parse("application/json");
Response response = null;
try {
DcAmazonAdvertMapper dcAmazonAdvertMapper = SessionUtil.getSession().getMapper(DcAmazonAdvertMapper.class);
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
Request request = new Request.Builder()
.url(propertiesUtil.getPropertyAsString("GETRESULT_FINANCE_URL"))
.post(body)
.addHeader("Content-Type", "application/json")
.build();
response = client.newCall(request).execute();
if (response.isSuccessful()) {
AdvertResultInfo advertResult = JSON.parseObject(response.body().string(), AdvertResultInfo.class);
if (advertResult != null && advertResult.getCode() == 0) {
List<AdvertResultData> accountEntries = advertResult.getResults();
if (accountEntries != null && accountEntries.size() > 0) {
List<AmazonAdvert> advertList = JSON.parseArray(accountEntries.get(0).getData().get(0), AmazonAdvert.class);
for (AmazonAdvert amazonAdvert : advertList) {
amazonAdvert.setAccountId(job.getAccountId());
amazonAdvert.setCompanyId(job.getCompanyId());
dcAmazonAdvertMapper.upsertSelective(amazonAdvert);
}
}
} else {
throw new RuntimeException("授权错误");
}
} else {
throw new RuntimeException("接口调用失败");
}
} catch (Exception e) {
job.setMessage(e.getMessage());
} finally {
if (response != null) {
response.close();
}
}
}
}
package com.bailuntec.mapper;
import com.bailuntec.domain.AmazonAdvert;
import com.bailuntec.domain.entity.DcAmazonAdvert;
import com.bailuntec.domain.example.DcAmazonAdvertExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DcAmazonAdvertMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
long countByExample(DcAmazonAdvertExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int deleteByExample(DcAmazonAdvertExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int insert(DcAmazonAdvert record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int insertSelective(DcAmazonAdvert record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcAmazonAdvert selectOneByExample(DcAmazonAdvertExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
List<DcAmazonAdvert> selectByExample(DcAmazonAdvertExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
DcAmazonAdvert selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcAmazonAdvert record, @Param("example") DcAmazonAdvertExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcAmazonAdvert record, @Param("example") DcAmazonAdvertExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcAmazonAdvert record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
*/
int updateByPrimaryKey(DcAmazonAdvert record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcAmazonAdvert record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_amazon_advert
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(AmazonAdvert record);
}
\ No newline at end of file
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcBaseCompanyAccount;
import com.bailuntec.domain.example.DcBaseCompanyAccountExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DcBaseCompanyAccountMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
long countByExample(DcBaseCompanyAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int deleteByExample(DcBaseCompanyAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int insert(DcBaseCompanyAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int insertSelective(DcBaseCompanyAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcBaseCompanyAccount selectOneByExample(DcBaseCompanyAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
List<DcBaseCompanyAccount> selectByExample(DcBaseCompanyAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
DcBaseCompanyAccount selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcBaseCompanyAccount record, @Param("example") DcBaseCompanyAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcBaseCompanyAccount record, @Param("example") DcBaseCompanyAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcBaseCompanyAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
*/
int updateByPrimaryKey(DcBaseCompanyAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcBaseCompanyAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_company_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcBaseCompanyAccount record);
}
\ No newline at end of file
#ADDTASK_FINANCE_URL=http://111.230.84.223:18321/outer/addtask
#GETRESULT_FINANCE_URL=http://111.230.84.223:18321/outer/getresult
ADDTASK_FINANCE_URL=http://10.0.3.5:18321/outer/addtask
GETRESULT_FINANCE_URL=http://10.0.3.5:18321/outer/getresult
#EVENT_RDB_STORAGE_DRIVER=com.mysql.jdbc.Driver
#EVENT_RDB_STORAGE_URL=jdbc:mysql://127.0.0.1:3306/bailun_datacenter?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=GMT&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true
#EVENT_RDB_STORAGE_USERNAME=root
#EVENT_RDB_STORAGE_PASSWORD=root
#ZOOKEEPER_SERVER=94.191.111.219:2181
EVENT_RDB_STORAGE_DRIVER=com.mysql.jdbc.Driver
EVENT_RDB_STORAGE_URL=jdbc:mysql://10.0.8.15:3306/bailun_datacenter?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
EVENT_RDB_STORAGE_USERNAME=root
EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE=data-center
JOB_NAME=base-sync-finance-amazon
JOB_CRON=0/2 * * * * ? *
SHARDING_TOTAL_COUNT=3
\ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<module>base-sync-company</module> <module>base-sync-company</module>
<module>base-sync-finance-ebay</module> <module>base-sync-finance-ebay</module>
<module>base-sync-paypal</module> <module>base-sync-paypal</module>
<module>base_sync_finance_amazon</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>
......
package com.bailuntec.domain.enumerate;
public enum AccountPlatformType {
Amazon(15,"AMAZON"),
Wish(8, "WISH"),
Cdiscount(10, "CDISCOUNT"),
Ebay(12, "EBAY"),
Shopee(69, "SHOPEE"),
Browze(103, "BROWZE"),
Bonanza(104, "BONANZA"),
Ebid(105, "EBID"),
Eiigoo(106, "EIIGOO"),
Stardaymart(107, "STARDAYMART"),
Walmart(62, "WALMART"),
Aliexpress(4, "ALIEXPRESS");
private final int code;
private final String value;
AccountPlatformType(int code, String value) {
this.code = code;
this.value = value;
}
public String value() {
return value;
}
public int code() {
return code;
}
}
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/bailun_datacenter?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=GMT&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true
username=root
password=root
\ 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