提交 01fc380a 作者: 方治民

feat: 升级依赖包版本, 其他细节优化

上级 a22bf199
......@@ -46,6 +46,7 @@ dependencies {
// hutool
implementation "cn.hutool:hutool-core:${hutoolVersion}"
implementation "cn.hutool:hutool-extra:${hutoolVersion}"
// https://github.com/vladmihalcea/hibernate-types
// hibernate-types-55
......
/* (C) 2021 YiRing, Inc. */
package com.yiring.app.web;
import cn.hutool.extra.spring.SpringUtil;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.yiring.app.constant.Code;
import com.yiring.app.domain.TestTable;
......@@ -15,7 +16,6 @@ import io.swagger.annotations.ApiOperation;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
......@@ -66,13 +66,10 @@ public class ExampleController {
FileUtils.download(response, resource.getFile());
}
@Resource
TestTableMapper testTableMapper;
@ApiOperation("测试 MyBatis Plus 查询")
@GetMapping("test")
public Result<String> test() {
List<TestTable> tests = testTableMapper.selectList(null);
List<TestTable> tests = SpringUtil.getBean(TestTableMapper.class).selectList(null);
return Result.ok(tests.stream().map(TestTable::getName).reduce((a, b) -> a + "," + b).orElse(""));
}
}
......@@ -7,13 +7,13 @@ spring:
servlet:
# 文件上传大小限制
multipart:
max-file-size: 20MB
max-request-size: 50MB
max-file-size: 10MB
max-request-size: 30MB
application:
name: "basic-api-app"
profiles:
include: auth, conf-patch
active: mock
active: test
# DEBUG
debug: false
......@@ -21,9 +21,11 @@ dependencies {
// JTS 几何对象操作库
implementation "org.locationtech.jts:jts-core:${jtsVersion}"
// https://mvnrepository.com/artifact/com.graphhopper.external/jackson-datatype-jts
implementation("com.graphhopper.external:jackson-datatype-jts:${jacksonDatatypeJtsVersion}") {
// https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts/1.2.10
implementation("org.n52.jackson:jackson-datatype-jts:1.2.10") {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'org.locationtech.jts', module: 'jts-core'
}
......
......@@ -3,6 +3,7 @@ package com.yiring.common.aspect;
import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yiring.common.constant.DateFormatter;
import com.yiring.common.core.Result;
import com.yiring.common.util.Commons;
......@@ -34,7 +35,7 @@ public class RequestAspect {
Boolean debug;
@Pointcut(
"@annotation(org.springframework.web.bind.annotation.PostMapping) || @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.ExceptionHandler)"
"@annotation(org.springframework.web.bind.annotation.PostMapping) || @annotation(org.springframework.web.bind.annotation.GetMapping) || @annotation(org.springframework.web.bind.annotation.PutMapping) || @annotation(org.springframework.web.bind.annotation.DeleteMapping) || @annotation(org.springframework.web.bind.annotation.PatchMapping) || @annotation(org.springframework.web.bind.annotation.ExceptionHandler)"
)
public void apiPointCut() {}
......@@ -52,8 +53,10 @@ public class RequestAspect {
// Print Request Log (Optional Replace: MDC)
String extra = "";
if (Boolean.TRUE.equals(debug)) {
extra += String.format("\nHeaders: %s", JSONObject.toJSONString(ServletUtil.getHeaderMap(request), true));
extra += String.format("\nParams: %s", JSONObject.toJSONString(ServletUtil.getParamMap(request), true));
String headers = JSONObject.toJSONString(ServletUtil.getHeaderMap(request), SerializerFeature.PrettyFormat);
String params = JSONObject.toJSONString(ServletUtil.getParamMap(request), SerializerFeature.PrettyFormat);
extra += String.format("\nHeaders: %s", headers);
extra += String.format("\nParams: %s", params);
if (result instanceof Result) {
extra +=
String.format(
......@@ -64,7 +67,8 @@ public class RequestAspect {
}
}
log.info(
"[Request] URL: {}, IP: {}, Times: {}{}",
"[Request] Method: {}, URL: {}, IP: {}, Times: {}{}",
request.getMethod(),
request.getRequestURL(),
Commons.getClientIpAddress(request),
times,
......
/* (C) 2022 YiRing, Inc. */
package com.yiring.common.config;
import com.bedatadriven.jackson.datatype.jts.JtsModule;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import javax.annotation.Resource;
import org.n52.jackson.datatype.jts.JtsModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
......@@ -10,37 +10,35 @@ buildscript {
// https://mvnrepository.com/artifact/cn.dev33/sa-token-spring-boot-starter
saTokenVersion = '1.29.1.trial'
// https://mvnrepository.com/artifact/cn.hutool/hutool-all
hutoolVersion = '5.7.22'
hutoolVersion = '5.8.0'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
fastJsonVersion = '1.2.80'
fastJsonVersion = '2.0.2'
// https://mvnrepository.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '2.3.0'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
okhttpVersion = '4.9.3'
// https://mvnrepository.com/artifact/io.minio/minio
minioVersion = '8.3.8'
minioVersion = '8.4.0'
// https://mvnrepository.com/artifact/com.vladmihalcea/hibernate-types-55
hibernateTypesVersion = '2.16.1'
hibernateTypesVersion = '2.16.2'
// https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial
hibernateSpatialVersion = '5.6.8.Final'
// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
jtsVersion = '1.18.2'
// https://mvnrepository.com/artifact/com.graphhopper.external/jackson-datatype-jts
jacksonDatatypeJtsVersion = '1.0-2.7'
// https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter
mybatisPlusVersion = '3.5.1'
// https://mvnrepository.com/artifact/com.github.liaochong/myexcel
myexcelVersion = '4.1.1'
myexcelVersion = '4.2.0'
}
}
plugins {
id 'java'
id 'org.springframework.boot' version '2.6.6'
id 'org.springframework.boot' version '2.6.7'
// https://plugins.gradle.org/plugin/io.spring.dependency-management
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
// https://plugins.gradle.org/plugin/com.diffplug.spotless
id "com.diffplug.spotless" version "6.4.2"
id "com.diffplug.spotless" version "6.5.2"
// https://plugins.gradle.org/plugin/com.github.spotbugs
// id "com.github.spotbugs" version "5.0.6"
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论