Authored by liangyi.chen@yoho.cn

ADD file

Showing 24 changed files with 589 additions and 112 deletions
package com.yoho.datasync.consumer.dal.base;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.sql.Timestamp;
@Data
@MappedSuperclass
@EntityListeners({AuditingEntityListener.class})
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false, unique = true)
protected Long id;
protected Integer id;
@CreatedDate
@Column(name = "create_date")
@Transient
protected Timestamp createDate;
@LastModifiedDate
@Column(name = "update_date")
@Transient
protected Timestamp updateDate;
}
... ...
package com.yoho.datasync.consumer.dal.entity;
import com.yoho.datasync.consumer.dal.base.BaseEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@Data
@Entity
@Table(name = "public_article")
public class PublicArticle extends BaseEntity implements Serializable {
@Column(name = "article_title")
private String articleTitle;
@Column(name = "cover_img")
private String coverImg;
@Column(name = "article_type")
private Integer articleType;
@Column(name = "relate_id")
private Integer relateId;
@Column(name = "min_relate_id")
private Integer minRelateId;
@Column(name = "author_uid")
private Integer authorUid;
@Column(name = "author_type")
private Integer authorType;
@Column(name = "praise_num")
private Integer praiseNum;
@Column(name = "favorite_num")
private Integer favoriteNum;
@Column(name = "virtual_praise_num")
private Integer virtualPraiseNum;
@Column(name = "virtual_favorite_num")
private Integer virtualFavoriteNum;
private Double longitude;
private Double latitude;
private Integer status;
@Column(name = "audit_status")
private Integer auditStatus;
@Column(name = "publish_time")
private Long publishTime;
}
package com.yoho.datasync.consumer.dal.entity;
import com.yoho.datasync.consumer.dal.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@Data
@Entity
@Table(name = "public_user_praise")
@EqualsAndHashCode(callSuper = true)
public class PublicUserPraise extends BaseEntity implements Serializable {
@Column(name = "target_id")
private Integer targetId;
private Integer uid;
@Column(name = "praise_type")
private Integer praiseType;
private Integer status;
@Column(name = "src_channel")
private Integer srcChannel;
@Column(name = "create_time")
private Long createTime;
@Column(name = "update_time")
private Long updateTime;
}
... ...
package com.yoho.datasync.consumer.dal.entity;
import com.yoho.datasync.consumer.dal.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@Data
@Entity
@Table(name = "public_user_share")
@EqualsAndHashCode(callSuper = true)
public class PublicUserShare extends BaseEntity implements Serializable {
private Integer uid;
@Column(name = "target_id")
private Integer targetId;
@Column(name = "share_type")
private Integer shareType;
private Integer status;
@Column(name = "src_channel")
private Integer srcChannel;
@Column(name = "create_time")
private Long createTime;
@Column(name = "update_time")
private Long updateTime;
}
... ...
package com.yoho.datasync.consumer.dal.repository;
import com.yoho.datasync.consumer.dal.entity.PublicArticle;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface PublicArticleRepository extends JpaRepository<PublicArticle, Integer>{}
package com.yoho.datasync.consumer.dal.repository;
import com.yoho.datasync.consumer.dal.entity.PublicUserPraise;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface PublicUserPraiseRepository extends JpaRepository<PublicUserPraise, Integer>{
PublicUserPraise findByUidAndPraiseTypeAndTargetId(Integer uid , Integer praiseType , Integer targetId);
}
... ...
package com.yoho.datasync.consumer.dal.repository;
import com.yoho.datasync.consumer.dal.entity.PublicUserShare;
import org.springframework.data.jpa.repository.JpaRepository;
public interface PublicUserShareRepository extends JpaRepository<PublicUserShare, Integer>{}
... ...
package com.yoho.datasync.consumer.dal.service;
import com.yoho.datasync.consumer.dal.entity.PublicUserPraise;
import com.yoho.datasync.consumer.dal.repository.PublicUserPraiseRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class PublicUserPraiseService {
@Resource
private PublicUserPraiseRepository repository;
private static final Logger logger = LoggerFactory.getLogger(PublicUserPraiseService.class);
public void saveOrUpdatePublicUserPraise(PublicUserPraise publicUserPraise) {
PublicUserPraise publicUserPraiseFromDB = getPublicUserPraiseByUniqueKey(publicUserPraise);
if (publicUserPraiseFromDB != null) { //更新
publicUserPraise.setId(publicUserPraiseFromDB.getId());
}
repository.save(publicUserPraise);
}
public void deletePublicUserPraise(PublicUserPraise publicUserPraise) {
PublicUserPraise publicUserPraiseFromDB = getPublicUserPraiseByUniqueKey(publicUserPraise);
if (publicUserPraiseFromDB != null) { //更新
repository.deleteById(publicUserPraiseFromDB.getId());
}else{
logger.error("数据不存在praiseType={},uid={},targetId={}", publicUserPraise.getPraiseType(),
publicUserPraise.getUid(),publicUserPraise.getTargetId());
}
}
private PublicUserPraise getPublicUserPraiseByUniqueKey(PublicUserPraise publicUserPraise){
//点赞类型,点赞对象,和点赞者id确定唯一一条记录
Integer praiseType = publicUserPraise.getPraiseType();
Integer uid = publicUserPraise.getUid();
Integer targetId = publicUserPraise.getTargetId();
if(praiseType == null || uid == null || targetId == null){
logger.error("参数不合法praiseType={},uid={},targetId={}", praiseType , uid , targetId);
return null;
}
return repository.findByUidAndPraiseTypeAndTargetId(uid , praiseType , targetId);
}
}
... ...
package com.yoho.datasync.consumer.dal.service;
import com.yoho.datasync.consumer.dal.repository.PublicArticleRepository;
import com.yoho.datasync.consumer.dal.repository.PublicUserShareRepository;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class PublicArticleService {
public class PublicUserShareService {
@Resource
private PublicArticleRepository rep;
private PublicUserShareRepository repository;
}
... ...
... ... @@ -39,6 +39,11 @@
<artifactId>yoho-datasync-consumer-common</artifactId>
</dependency>
<dependency>
<groupId>com.yoho.datasync.consumer</groupId>
<artifactId>yoho-datasync-consumer-dal</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
... ...
... ... @@ -9,7 +9,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface FieldTransfer {
public Class<?> targetClass();
public Class<?> targetClass() default ClassTransfer.class;
public String targetFieldName() default "";
... ...
... ... @@ -22,6 +22,11 @@ public class MqMessageEntity {
private Map<String, Object> data;
public MqMessageEntity() {
}
public MqMessageEntity(String action, String dbName, String tableName, long version, Map<String, Object> data) {
this.action = action;
this.dbName = dbName;
... ...
package com.yoho.datasync.consumer.handler.helper;
import org.springframework.stereotype.Component;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Component
public class AnnotationClassFactory {
private Map<Class<? extends Annotation>,List<Class<?>>> annotationClassFactoryMap = new ConcurrentHashMap<>();
public List<Class<?>> getList(Class<? extends Annotation> annotation){
return annotationClassFactoryMap.getOrDefault(annotation,new ArrayList<>());
}
public void regsiter(Class<? extends Annotation> annotation,Class<?> tragetClass){
List<Class<?>> annotationedClassList = annotationClassFactoryMap.computeIfAbsent(annotation,a->new ArrayList<>());
annotationedClassList.add(tragetClass);
}
}
... ...
package com.yoho.datasync.consumer.handler.helper;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
@Target(value = ElementType.TYPE)
@Retention(value = RetentionPolicy.RUNTIME)
@Import(AnnotationClassScannerRegistar.class)
public @interface AnnotationClassScanner {
Class<? extends Annotation>[] annotions();
String[] path();
}
... ...
package com.yoho.datasync.consumer.handler.helper;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import java.lang.annotation.Annotation;
import java.util.Map;
import java.util.Set;
public class AnnotationClassScannerRegistar implements ImportBeanDefinitionRegistrar, ApplicationContextAware {
private String[] scanPaths;
private Class<? extends Annotation>[] annotations;
public AnnotationClassScannerRegistar() {
}
public AnnotationClassScannerRegistar(String[] scanPaths, Class<? extends Annotation>[] annotationClasses) {
this.scanPaths = scanPaths;
this.annotations = annotationClasses;
}
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
//1、注解参数检测
Map<String, Object> propetitys = importingClassMetadata.getAnnotationAttributes(AnnotationClassScanner.class.getName());
if (propetitys == null || propetitys.isEmpty()) {
return;
}
//2、注册自己
String[] path = (String[]) propetitys.get("path");
Class<? extends Annotation>[] annotionClasses = (Class<? extends Annotation>[]) propetitys.get("annotions");
BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(AnnotationClassScannerRegistar.class);
beanDefinitionBuilder.addConstructorArgValue(path);
beanDefinitionBuilder.addConstructorArgValue(annotionClasses);
registry.registerBeanDefinition("annotationClassScannerRegistar", beanDefinitionBuilder.getBeanDefinition());
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//1、获取AnnotationClassFactory
AnnotationClassFactory annotationClassFactory = applicationContext.getBean(AnnotationClassFactory.class);
if (annotationClassFactory == null) {
return;
}
//2、执行包+注解路径扫描
for (Class<? extends Annotation> annotion : annotations) {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
provider.addIncludeFilter(new AnnotationTypeFilter(annotion));
//3、执行扫描
for (String scanPath : scanPaths) {
Set<BeanDefinition> beanDefinitionSet = provider.findCandidateComponents(scanPath);
for (BeanDefinition beanDefinition : beanDefinitionSet) {
try {
annotationClassFactory.regsiter(annotion, Class.forName(beanDefinition.getBeanClassName()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
}
... ...
package com.yoho.datasync.consumer.handler.helper;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages = "com.yoho.datasync.consumer.handler.helper")
public class AnnotionConfig {
}
... ...
package com.yoho.datasync.consumer.handler.helper;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class AnnotionTestMain {
public static void main(String[] args) throws ClassNotFoundException {
AnnotationConfigApplicationContext aac = new AnnotationConfigApplicationContext(AnnotionConfig.class);
ClassTransferScanner classTransferScanner = aac.getBean(ClassTransferScanner.class);
}
}
... ...
... ... @@ -5,12 +5,14 @@ import com.yoho.datasync.consumer.handler.annotation.FieldTransfer;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Component
public class ClassTargetFactory {
private static final Logger logger = LoggerFactory.getLogger(ClassTargetFactory.class);
... ... @@ -46,25 +48,23 @@ public class ClassTargetFactory {
targetInfoFactory.put(clazz, targetInfo);
//2、解析ClassTransfer
Class<?> defaultTargetClass = null;
ClassTransfer classTransfer = clazz.getAnnotation(ClassTransfer.class);
if (classTransfer != null) {
defaultTargetClass = classTransfer.targetClass();
if (classTransfer == null) {
return new HashMap<>();
}
Class<?> targetClass = classTransfer.targetClass();
//3、解析FieldTransfer
for (Field field : clazz.getDeclaredFields()) {
Class<?> targetClass = null;
String targetFieldName = null;
FieldTransfer fieldTransfer = field.getAnnotation(FieldTransfer.class);
if (fieldTransfer != null) {
targetClass = fieldTransfer.targetClass();
if(!fieldTransfer.targetClass().isAssignableFrom(ClassTransfer.class) ){
targetClass = fieldTransfer.targetClass();
}
targetFieldName = StringUtils.isBlank(fieldTransfer.targetFieldName()) ? field.getName() : fieldTransfer.targetFieldName();
} else if (defaultTargetClass != null) {
targetClass = defaultTargetClass;
targetFieldName = field.getName();
}
if (targetClass != null && targetFieldName != null) {
if (targetFieldName != null) {
Field targetField = getField(targetClass, targetFieldName);
if (targetField != null) {
targetInfo.put(field, targetField);
... ...
package com.yoho.datasync.consumer.handler.helper;
import com.yoho.datasync.consumer.handler.annotation.ClassTransfer;
import com.yoho.datasync.consumer.handler.annotation.FieldTransfer;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.lang.reflect.Field;
import java.util.*;
@Component
public class ClassTransferScanner {
private ClassPathScanningCandidateComponentProvider provider;
private static final Logger logger = LoggerFactory.getLogger(ClassTransferScanner.class);
public static final Map<Class, Map<Class,Object>> targetInfoMap = new HashMap<>();
public static final Map<Class, Map<Field,Field>> targetFieldMap = new HashMap<>();
private final static String path = "com.yoho.datasync.consumer.handler.model";
public ClassTransferScanner() {
provider = new ClassPathScanningCandidateComponentProvider(false);
provider.addIncludeFilter(new AnnotationTypeFilter(ClassTransfer.class));
}
@PostConstruct
void scan() throws Exception{
List<Class<?>> results = doScan();
for (Class<?> clazz: results) {
targetInfoMap.put(clazz,getTargetObjects(clazz));
}
}
private <T> T newInstance(Class<T> clazz) {
try {
return clazz.newInstance();
} catch (Exception e) {
logger.error(e.getMessage(), e);
return null;
}
}
public Map<Class, Object> getTargetObjects(Class clazz) throws Exception {
//1、获取每个field对应的目标信息
Map<Field, Field> targetClassInfo = getTargetInfoFactory(clazz);
//2、初始化实例
Map<Class, Object> instanceMap = new HashMap<>();
for (Map.Entry<Field, Field> entry : targetClassInfo.entrySet()) {
Field field = entry.getKey();
Field targetField = entry.getValue();
Object traget = instanceMap.computeIfAbsent(targetField.getDeclaringClass(), a -> newInstance(a));
if (traget != null) {
field.setAccessible(true);
targetField.setAccessible(true);
targetField.set(traget, field.get(newInstance(clazz)));
}
}
return instanceMap;
}
private Map<Field, Field> getTargetInfoFactory(Class<?> clazz) {
//1、从缓存中获取
Map<Field, Field> targetInfo = targetFieldMap.get(clazz);
if (targetInfo != null) {
return targetInfo;
}
targetInfo = new HashMap<>();
targetFieldMap.put(clazz, targetInfo);
//2、解析ClassTransfer
ClassTransfer classTransfer = clazz.getAnnotation(ClassTransfer.class);
if (classTransfer == null) {
return new HashMap<>();
}
Class<?> targetClass = classTransfer.targetClass();
//3、解析FieldTransfer
for (Field field : clazz.getDeclaredFields()) {
String targetFieldName = null;
FieldTransfer fieldTransfer = field.getAnnotation(FieldTransfer.class);
if (fieldTransfer != null) {
if(!fieldTransfer.targetClass().isAssignableFrom(ClassTransfer.class) ){
targetClass = fieldTransfer.targetClass();
}
targetFieldName = StringUtils.isBlank(fieldTransfer.targetFieldName()) ? field.getName() : fieldTransfer.targetFieldName();
}
if (targetFieldName != null) {
Field targetField = getField(targetClass, targetFieldName);
if (targetField != null) {
targetInfo.put(field, targetField);
}
}
}
//4、返回解析结果
return targetInfo;
}
private Field getField(Class<?> clazz, String fieldName) {
try {
return clazz.getDeclaredField(fieldName);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return null;
}
}
private List<Class<?>> doScan() {
Set<BeanDefinition> beanDefinitionSet = provider.findCandidateComponents(path);
List<Class<?>> results = new ArrayList<>();
for (BeanDefinition beanDefinition : beanDefinitionSet) {
try {
results.add(Class.forName(beanDefinition.getBeanClassName()));
} catch (Exception e) {
e.printStackTrace();
}
}
return results;
}
}
... ...
... ... @@ -13,20 +13,20 @@ public class Object1 {
private String field2 = "field2";
@FieldTransfer(targetClass = Object2.class, targetFieldName = "field3")
@FieldTransfer
private String field3 = "field3";
@FieldTransfer(targetClass = Object2.class, targetFieldName = "field2")
private String field4 = "field4";
@FieldTransfer(targetClass = Object3.class, targetFieldName = "field1")
/*@FieldTransfer(targetClass = Object3.class, targetFieldName = "field1")
private String field5 = "field5";
@FieldTransfer(targetClass = Object3.class, targetFieldName = "field2")
*/
/*@FieldTransfer(targetClass = Object3.class, targetFieldName = "field2")
private String field6 = "field6";
@FieldTransfer(targetClass = Object3.class, targetFieldName = "field3")
private String field7 = "field7";
private String field7 = "field7";*/
public Date getField1() {
return field1;
... ... @@ -60,7 +60,7 @@ public class Object1 {
this.field4 = field4;
}
public String getField5() {
/* public String getField5() {
return field5;
}
... ... @@ -82,5 +82,5 @@ public class Object1 {
public void setField7(String field7) {
this.field7 = field7;
}
}*/
}
... ...
package com.yoho.datasync.consumer.handler.listener;
import com.yoho.datasync.consumer.common.EventEnum;
import com.yoho.datasync.consumer.dal.entity.PublicUserPraise;
import com.yoho.datasync.consumer.dal.service.PublicUserPraiseService;
import com.yoho.datasync.consumer.handler.annotation.MqConsumerListerner;
import com.yoho.datasync.consumer.handler.helper.ClassTransferScanner;
import com.yoho.datasync.consumer.handler.model.GrassArticlePraise;
import com.yoho.datasync.consumer.handler.mqcomponent.AbstractMqListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
@MqConsumerListerner(dbName = "yh_grass",tableName = "grass_article_praise")
public class GrassArticlePraiseListener extends AbstractMqListener<GrassArticlePraise> {
@Resource
PublicUserPraiseService praiseService;
private static final Logger logger = LoggerFactory.getLogger(GrassArticlePraiseListener.class);
@Override
protected void deleteData(GrassArticlePraise sourceObject) throws Exception {
if(sourceObject == null){
return;
}
PublicUserPraise publicUserPraise = convertToPublicUserPraise(sourceObject);
if(publicUserPraise == null){
logger.error("updateData failed , publicUserPraise is null");
return;
}
praiseService.saveOrUpdatePublicUserPraise(publicUserPraise);
}
@Override
protected void updateData(GrassArticlePraise sourceObject) throws Exception {
if(sourceObject == null){
return;
}
PublicUserPraise publicUserPraise = convertToPublicUserPraise(sourceObject);
if(publicUserPraise == null){
logger.error("updateData failed , publicUserPraise is null");
return;
}
praiseService.saveOrUpdatePublicUserPraise(publicUserPraise);
}
private PublicUserPraise convertToPublicUserPraise(GrassArticlePraise sourceObject) throws Exception{
if(sourceObject == null){
return null;
}
Object targetObject = ClassTransferScanner.targetInfoMap.get(PublicUserPraise.class);
if(targetObject == null){
return null;
}
return (PublicUserPraise)targetObject;
}
@Override
protected EventEnum getEventReportEnum() {
return null;
}
}
... ...
package com.yoho.datasync.consumer.handler.model;
import com.yoho.datasync.consumer.dal.entity.PublicUserPraise;
import com.yoho.datasync.consumer.handler.annotation.ClassTransfer;
import com.yoho.datasync.consumer.handler.annotation.FieldTransfer;
@ClassTransfer(targetClass = PublicUserPraise.class)
public class GrassArticlePraise {
private Integer id;
@FieldTransfer(targetFieldName = "targetId")
private Integer articleId;
@FieldTransfer
private Integer uid;
@FieldTransfer
private Integer createTime;
@FieldTransfer
private Integer status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getArticleId() {
return articleId;
}
public void setArticleId(Integer articleId) {
this.articleId = articleId;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
... ...
... ... @@ -12,13 +12,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.context.ApplicationEventPublisherAware;
import javax.annotation.Resource;
import java.lang.reflect.ParameterizedType;
import java.nio.charset.StandardCharsets;
public abstract class AbstractMqListener<T> implements ApplicationEventPublisherAware, MessageListener {
public abstract class AbstractMqListener<T> implements MessageListener {
private final Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());
... ... @@ -171,13 +170,13 @@ public abstract class AbstractMqListener<T> implements ApplicationEventPublisher
/**
* 删除数据
*/
protected abstract void deleteData(final T data) throws Exception;
protected abstract void deleteData(final T sourceObject) throws Exception;
/**
* 更新数据
*/
protected abstract void updateData(final T data) throws Exception;
protected abstract void updateData(final T sourceObject) throws Exception;
/**
* 定义事件类型
... ...
... ... @@ -8,14 +8,14 @@ rabbitmq:
spring:
datasource:
url: jdbc:mysql://192.168.102.219:3306/line_shops?useUnicode=true&amp;characterEncoding=UTF-8
url: jdbc:mysql://192.168.102.219:3306/yh_pcms?useUnicode=true&amp;characterEncoding=UTF-8
username: yh_test
password: yh_test
driver-class-name: com.mysql.jdbc.Driver
tableConfigs:
- dbName: "line_shops"
tableName: "test_sync"
- dbName: "yh_grass"
tableName: "grass_article_praise"
primaryKeys:
- id
queueSize: 1
\ No newline at end of file
... ...