lyhzzz пре 3 година
родитељ
комит
1f000194f7

+ 4 - 0
4dkankan-center-platform/pom.xml

@@ -21,6 +21,10 @@
       </dependency>
 
       <dependency>
+          <groupId>org.projectlombok</groupId>
+          <artifactId>lombok</artifactId>
+      </dependency>
+      <dependency>
           <groupId>com.fdkankan</groupId>
           <artifactId>4dkankan-pom</artifactId>
           <version>2.0.0</version>

+ 6 - 1
4dkankan-center-platform/src/main/java/com/fdkankan/agent/controller/AgentAuditController.java

@@ -14,8 +14,13 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2021-12-22
  */
 @RestController
-@RequestMapping("/agent/agent-audit")
+@RequestMapping("/agent")
 public class AgentAuditController {
 
+    @RequestMapping("/one")
+    public String getOne (){
+        return "??";
+    }
+
 }
 

+ 8 - 7
4dkankan-center-platform/src/main/resources/logback-spring.xml

@@ -16,7 +16,8 @@
 	<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
 	<!-- 彩色日志格式 -->
 	<property name="CONSOLE_LOG_PATTERN"
-		value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
+		value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %L %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
+	<!--		value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n" />-->
 
 	<!--输出到控制台 -->
 	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
@@ -38,7 +39,7 @@
 		<file>${log.path}/log_debug.log</file>
 		<!--日志文件输出格式 -->
 		<encoder>
-			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n</pattern>
 			<charset>UTF-8</charset> <!-- 设置字符集 -->
 		</encoder>
 		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
@@ -66,7 +67,7 @@
 		<file>${log.path}/log_info.log</file>
 		<!--日志文件输出格式 -->
 		<encoder>
-			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n</pattern>
 			<charset>UTF-8</charset>
 		</encoder>
 		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
@@ -94,7 +95,7 @@
 		<file>${log.path}/log_warn.log</file>
 		<!--日志文件输出格式 -->
 		<encoder>
-			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n</pattern>
 			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
 		</encoder>
 		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
@@ -122,7 +123,7 @@
 		<file>${log.path}/log_error.log</file>
 		<!--日志文件输出格式 -->
 		<encoder>
-			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n</pattern>
 			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
 		</encoder>
 		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
@@ -148,7 +149,7 @@
 		<file>${log.path}/program/log_program.log</file>
 		<!--日志文件输出格式 -->
 		<encoder>
-			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n</pattern>
 			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
 		</encoder>
 		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
@@ -176,7 +177,7 @@
 		<file>${log.path}/visit/log_visit.log</file>
 		<!--日志文件输出格式 -->
 		<encoder>
-			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %L - %msg%n</pattern>
 			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
 		</encoder>
 		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->

+ 0 - 4
4dkankan-common/pom.xml

@@ -14,10 +14,6 @@
     <artifactId>4dkankan-common</artifactId>
 
     <dependencies>
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-        </dependency>
 
         <dependency>
             <groupId>org.projectlombok</groupId>

+ 0 - 179
4dkankan-common/src/main/java/com/fdkankan/common/base/AbstractService.java

@@ -1,179 +0,0 @@
-package com.fdkankan.common.base;
-
-import com.fdkankan.common.response.PageInfo;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-public abstract class AbstractService<T extends Serializable> implements IServiceOperations<T> {
-
-	protected abstract IOperations<T> getMapper();
-
-	protected String tableName = "";
-
-	public abstract void setTableName(String tableName);
-
-	protected String getTableName() {
-		return this.tableName;
-	}
-
-	@Override
-	public void insert(T entity) {
-		getMapper().insert(entity, this.getTableName());
-	}
-
-	@Override
-	public int insertByBatch(List<T> list) {
-		return getMapper().insertByBatch(list, this.getTableName());
-	}
-
-	@Override
-	public int update(List<T> list) {
-		return getMapper().update(list, this.getTableName());
-	}
-	@Override
-	public int update(T entity) {
-		List<T> entityList = new ArrayList<>();
-		entityList.add(entity);
-		return getMapper().update(entityList, this.getTableName());
-	}
-
-	@Override
-	public int updateByBatch(LinkedHashMap<String, String> condition, String field) {
-		return getMapper().updateByBatch(condition, field, this.getTableName());
-	}
-
-	@Override
-	public T getById(int id) {
-		return getMapper().getById(id, this.getTableName());
-	}
-
-	@Override
-	public T getOne(LinkedHashMap<String, String> condition) {
-		String field = null;
-		return this.getOne(condition, field, this.getTableName());
-	}
-
-	@Override
-	public T getOne(LinkedHashMap<String, String> condition, String field) {
-		return getMapper().getOne(condition, field, this.getTableName());
-	}
-
-	@Override
-	public int getCount(LinkedHashMap<String, String> condition, String field) {
-		return getMapper().getCount(condition, field, this.getTableName());
-	}
-
-	@Override
-	public List<T> getList(LinkedHashMap<String, String> condition, int pageNo, int pageSize, String order, String field) {
-		int offset = (pageNo - 1) * pageSize;
-		int limit = pageSize;
-		return getMapper().getList(condition, offset, limit, order, field, this.getTableName());
-	}
-
-	@Override
-	public List<T> getAllList(LinkedHashMap<String, String> condition) {
-		return this.getAllList(condition, null);
-	}
-
-	@Override
-	public List<T> getAllList(LinkedHashMap<String, String> condition, String order) {
-		if(order == null || order.trim().length() == 0) {
-			order = null;
-		}
-		return getMapper().getList(condition, 0, 0, order, null, this.getTableName());
-	}
-
-	@Override
-	public List<T> getList(int pageNo, int pageSize) {
-		String order = null;
-		return this.getList(pageNo, pageSize, order);
-	}
-
-	@Override
-	public List<T> getList(int pageNo, int pageSize, String order) {
-		String field = null;
-		return this.getList(pageNo, pageSize, order, field);
-	}
-
-	@Override
-	public List<T> getList(int pageNo, int pageSize, String order, String field) {
-		LinkedHashMap<String, String> condition = new LinkedHashMap<String, String>();
-		return this.getList(condition, pageNo, pageSize, order, field);
-	}
-
-	@Override
-	public List<T> getList(LinkedHashMap<String, String> condition, int pageNo, int pageSize) {
-		String order = null;
-		return this.getList(condition, pageNo, pageSize, order);
-	}
-
-	@Override
-	public List<T> getList(LinkedHashMap<String, String> condition, int pageNo, int pageSize, String order) {
-		String field = null;
-		return this.getList(condition, pageNo, pageSize, order, field);
-	}
-
-	@Override
-	public int existTable(String tableName) {
-		return getMapper().existTable(tableName);
-	}
-
-	@Override
-	public int createTable(String tableName) {
-		return getMapper().createTable(tableName);
-	}
-
-	// 以下暂时没有场景用到,留在这里,需要时候根据实际情况进行修改即可。
-	@Override
-	public void insert(T entity, String tableName) {
-		this.getMapper().insert(entity, tableName);
-	}
-
-	@Override
-	public int insertByBatch(List<T> list, String tableName) {
-		return this.getMapper().insertByBatch(list, tableName);
-	}
-
-	@Override
-	public int update(List<T> list, String tableName) {
-		return this.update(list, tableName);
-	}
-
-	@Override
-	public int updateByBatch(LinkedHashMap<String, String> condition, String field, String tableName) {
-		return this.getMapper().updateByBatch(condition, field, this.getTableName());
-	}
-
-	@Override
-	public T getById(int id, String tableName) {
-		return this.getMapper().getById(id, tableName);
-	}
-
-	@Override
-	public T getOne(LinkedHashMap<String, String> condition, String field, String tableName) {
-		return this.getMapper().getOne(condition, field, tableName);
-	}
-
-	@Override
-	public int getCount(LinkedHashMap<String, String> condition, String field, String tableName) {
-		return this.getMapper().getCount(condition, field, tableName);
-	}
-
-	@Override
-	public List<T> getList(LinkedHashMap<String, String> condition, int offset, int limit, String order, String field, String tableName) {
-		return this.getMapper().getList(condition, offset, limit, order, field, tableName);
-	}
-
-	@Override
-	public PageInfo pageInfo(LinkedHashMap<String, String> condition, int pageNo, int pageSize, String order) {
-		List<T> list = this.getList(condition, pageNo, pageSize, order);
-		int count = this.getCount(condition, null);
-		return  PageInfo.pageInfo(pageNo,pageSize,count,list);
-	}
-}
-
-
-

+ 0 - 38
4dkankan-common/src/main/java/com/fdkankan/common/base/IOperations.java

@@ -1,38 +0,0 @@
-package com.fdkankan.common.base;
-
-
-import org.apache.ibatis.annotations.Param;
-
-import java.io.Serializable;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-public interface IOperations<T extends Serializable> {
-
-	void insert(@Param("entity") final T entity, @Param("tableName") String tableName);
-
-	int insertByBatch(@Param("list") List<T> list, @Param("tableName") String tableName);
-
-	int update(@Param("list") List<T> list, @Param("tableName") String tableName);
-
-	int updateByBatch(@Param("condition") LinkedHashMap<String, String> condition, @Param("field") String field, @Param("tableName") String tableName);
-
-	T getById(@Param("id") final int id, @Param("tableName") String tableName);
-
-	T getOne(@Param("condition") LinkedHashMap<String, String> condition, @Param("field") String field, @Param("tableName") String tableName);
-
-	int getCount(@Param("condition") LinkedHashMap<String, String> condition, @Param("field") String field, @Param("tableName") String tableName);
-
-	List<T> getList(@Param("condition") LinkedHashMap<String, String> condition, @Param("offset") int offset, @Param("limit") int limit, @Param("order") String order,
-			@Param("field") String field, @Param("tableName") String tableName);
-
-	// 以下方法特殊,为判断表是否存在,批量和创建表
-
-	int existTable(@Param("tableName") String tableName);
-
-	int createTable(@Param("tableName") String tableName);
-
-}
-
-
-

+ 0 - 51
4dkankan-common/src/main/java/com/fdkankan/common/base/IServiceOperations.java

@@ -1,51 +0,0 @@
-package com.fdkankan.common.base;
-
-import com.fdkankan.common.response.PageInfo;
-
-import java.io.Serializable;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-public interface IServiceOperations<T extends Serializable> extends IOperations<T> {
-
-	void setTableName(String tableName);
-
-	void insert(final T entity);
-
-	int insertByBatch(List<T> list);
-
-	int update(List<T> list);
-
-	int update (final T entity);
-
-	int updateByBatch(LinkedHashMap<String, String> condition, String field);
-
-	T getById(final int id);
-
-	T getOne(LinkedHashMap<String, String> condition, String field);
-
-	int getCount(LinkedHashMap<String, String> condition, String field);
-
-	List<T> getList(int pageNo, int pageSize);
-
-	List<T> getList(int pageNo, int pageSize, String order);
-
-	List<T> getList(int pageNo, int pageSize, String order, String field);
-
-	List<T> getList(LinkedHashMap<String, String> condition, int pageNo, int pageSize);
-
-	List<T> getList(LinkedHashMap<String, String> condition, int pageNo, int pageSize, String order);
-
-	public List<T> getAllList(LinkedHashMap<String, String> condition);
-
-	public List<T> getAllList(LinkedHashMap<String, String> condition, String order);
-
-	T getOne(LinkedHashMap<String, String> condition);
-
-	List<T> getList(LinkedHashMap<String, String> condition, int pageNo, int pageSize, String order, String field);
-
-	PageInfo pageInfo (LinkedHashMap<String,String> condition ,int pageNo,int pageSize,String order);
-}
-
-
-

+ 0 - 16
4dkankan-common/src/main/java/com/fdkankan/common/base/request/RequestBase.java

@@ -1,16 +0,0 @@
-package com.fdkankan.common.base.request;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-@Data
-public class RequestBase implements Serializable {
-
-    private int pageNum;
-
-    private int pageSize;
-
-    private int start;
-
-}

+ 31 - 0
4dkankan-common/src/main/java/com/fdkankan/common/response/BaseResponseAdvice.java

@@ -0,0 +1,31 @@
+package com.fdkankan.common.response;
+
+
+import com.alibaba.fastjson.JSON;
+import org.springframework.core.MethodParameter;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.server.ServerHttpRequest;
+import org.springframework.http.server.ServerHttpResponse;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
+
+@RestControllerAdvice
+public class BaseResponseAdvice implements ResponseBodyAdvice<Object> {
+    @Override
+    public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> aClass) {
+        return true;
+    }
+
+    @Override
+    public Object beforeBodyWrite(Object body, MethodParameter methodParameter, MediaType mediaType, Class<? extends HttpMessageConverter<?>> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
+        System.out.println("响应拦截成功");
+        if (body instanceof ResultData) {
+            return body;
+        } else if (body == null) {
+            return JSON.toJSONString(ResultData.ok());
+        } else {
+            return JSON.toJSONString( ResultData.ok(body));
+        }
+    }
+}

Разлика између датотеке није приказан због своје велике величине
+ 724 - 724
4dkankan-common/src/main/java/com/fdkankan/common/util/UploadToOssUtil.java


+ 1 - 0
4dkankan-pom/pom.xml

@@ -67,6 +67,7 @@
             <scope>runtime</scope>
         </dependency>
 
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>