Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
01fc380a
提交
01fc380a
authored
5月 07, 2022
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 升级依赖包版本, 其他细节优化
上级
a22bf199
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
26 行增加
和
24 行删除
+26
-24
build.gradle
app/build.gradle
+1
-0
ExampleController.java
app/src/main/java/com/yiring/app/web/ExampleController.java
+2
-5
application.yml
app/src/main/resources/application.yml
+3
-3
build.gradle
basic-common/core/build.gradle
+4
-2
RequestAspect.java
...src/main/java/com/yiring/common/aspect/RequestAspect.java
+8
-4
JacksonConfig.java
...src/main/java/com/yiring/common/config/JacksonConfig.java
+1
-1
build.gradle
build.gradle
+7
-9
没有找到文件。
app/build.gradle
浏览文件 @
01fc380a
...
...
@@ -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
...
...
app/src/main/java/com/yiring/app/web/ExampleController.java
浏览文件 @
01fc380a
/* (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
(
""
));
}
}
app/src/main/resources/application.yml
浏览文件 @
01fc380a
...
...
@@ -7,13 +7,13 @@ spring:
servlet
:
# 文件上传大小限制
multipart
:
max-file-size
:
2
0MB
max-request-size
:
5
0MB
max-file-size
:
1
0MB
max-request-size
:
3
0MB
application
:
name
:
"
basic-api-app"
profiles
:
include
:
auth, conf-patch
active
:
mock
active
:
test
# DEBUG
debug
:
false
basic-common/core/build.gradle
浏览文件 @
01fc380a
...
...
@@ -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'
}
...
...
basic-common/core/src/main/java/com/yiring/common/aspect/RequestAspect.java
浏览文件 @
01fc380a
...
...
@@ -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
,
...
...
basic-common/core/src/main/java/com/yiring/common/config/JacksonConfig.java
浏览文件 @
01fc380a
/* (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
;
...
...
build.gradle
浏览文件 @
01fc380a
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论