Compare commits

..

No commits in common. 'e471b5628165c5d92c1c777230fc3ac513f4cf6a' and '58a14e31c20f582ce11d1f19403f7085c3778d07' have entirely different histories.

@ -31,8 +31,6 @@
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<mapstruct.version>1.6.2</mapstruct.version>
<lombok.version>1.18.22</lombok.version>
</properties>
<!-- 依赖声明 -->
@ -198,13 +196,6 @@
<version>${sync.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -225,25 +216,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<parameters>true</parameters>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>

@ -43,11 +43,6 @@
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.lyr</groupId>
@ -72,7 +67,6 @@
<artifactId>sync-gather</artifactId>
</dependency>
</dependencies>

@ -1,7 +1,11 @@
package com.lyr.web.controller.tool;
import com.lyr.framework.manager.DataSourceManagerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author liyc
* @date 2024/10/30

@ -5,12 +5,13 @@ spring:
port: 6379
database: 1
password: eGDiN3RRhRNzrzjd
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${spring.redis.host}:3306/sync-data?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: K2bfP8rzG62ZSJGN
@ -18,7 +19,6 @@ spring:
slave:
# 从数据源开关/默认关闭
enabled: false
driverClassName:
url:
username:
password:

@ -5,12 +5,13 @@ spring:
port: 6379
database: 1
password: eGDiN3RRhRNzrzjd
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${spring.redis.host}:3306/sync-data?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: K2bfP8rzG62ZSJGN
@ -18,7 +19,6 @@ spring:
slave:
# 从数据源开关/默认关闭
enabled: false
driverClassName:
url:
username:
password:

@ -114,24 +114,6 @@
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-jre</version>
</dependency>
</dependencies>
</project>

@ -16,18 +16,8 @@ import java.lang.annotation.*;
@Documented
@Inherited
public @interface DataSource {
/**
*
*/
DataSourceType value() default DataSourceType.MASTER;
/**
* (使,使value)
*
* @return
*/
String name() default "";
}

@ -1,31 +0,0 @@
package com.lyr.common.core.domain;
import com.google.common.collect.ImmutableMap;
import com.lyr.common.constant.HttpStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.HashMap;
import java.util.Map;
/**
*
*
* @author liyc
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ServiceResult extends HashMap<String, Object> {
private Integer code;
private String message;
private Map data;
public static ServiceResult success(String name) {
ImmutableMap<Object, Object> data1 = ImmutableMap.of();
return new ServiceResult(HttpStatus.SUCCESS, name, data1);
}
}

@ -14,11 +14,5 @@ public enum DataSourceType {
/**
*
*/
SLAVE,
/**
*
*/
EXTERNAL
SLAVE
}

@ -1,104 +0,0 @@
package com.lyr.common.utils;
import com.lyr.common.exception.ServiceException;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.util.CollectionUtils;
import java.util.Collection;
import java.util.List;
/**
* @author Admin
*/
public class AssertUtil {
public static void notEmpty(Long val, String s, Integer... codes) throws ServiceException {
if (val == null) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void notEmpty(Collection c, String s, Integer... codes) throws ServiceException {
if (CollectionUtils.isEmpty(c)) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void notEmpty(String val, String s, Integer... codes) throws ServiceException {
if (StringUtils.isEmpty(val)) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void notEmpty(Object val, String s, Integer... codes) throws ServiceException {
if (val == null) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
/**
*
*
* @param obj
* @param s
*/
public static void empty(Object obj, String s, Integer... codes) {
if (null != obj) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void empty(Object obj, String s, List<T> t, Integer... codes) {
if (null != obj) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void empty(Collection c, String s) {
if (!CollectionUtils.isEmpty(c)) {
throw new ServiceException(s, 500);
}
}
public static void notEqual(boolean val, String s, Integer... codes) {
if (val) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void equal(boolean val, String s) {
notEqual(!val, s);
}
public static void isFalse(boolean b, String s, Integer... codes) {
if (b) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void isTrue(boolean b, String s, Integer... codes) throws ServiceException {
if (!b) {
Integer code = (codes.length == 0) ? 500 : codes[0];
throw new ServiceException(s, code);
}
}
public static void test() {
throw new ServiceException("222");
}
}

@ -1,49 +0,0 @@
package com.lyr.common.utils;
import org.springframework.context.annotation.Bean;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
/**
* spel
*
* @author liyc
* @date 2024/10/30
* @description TODO
**/
@Component
public class SpElUtil {
@Resource
public ExpressionParser expressionParser;
@Bean
public ExpressionParser expressionParser() {
return new SpelExpressionParser();
}
/**
*
*
* @param method
* @param args
* @param expression
* @return
*/
public String parseExpression(Method method, Object[] args, String expression) {
StandardEvaluationContext context = new StandardEvaluationContext();
Parameter[] parameters = method.getParameters();
for (int i = 0; i < parameters.length; i++) {
Parameter parameter = parameters[i];
context.setVariable(parameter.getName(), args[i]);
}
return expressionParser.parseExpression(expression).getValue(context, String.class);
}
}

@ -36,15 +36,6 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
return (T) beanFactory.getBean(name);
}
public static <T> T getBeanOfNull(String name) throws BeansException {
try {
return (T) beanFactory.getBean(name);
} catch (BeansException e) {
}
return null;
}
/**
* requiredType
*

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save