Skip to content

Commit 6d98c8a

Browse files
committed
1.1.0 release
1 parent 0da0adb commit 6d98c8a

14 files changed

Lines changed: 35 additions & 78 deletions

File tree

doc/db/tables_tinyurl.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
CREATE database if NOT EXISTS `tinyurl` default character set utf8mb4 collate utf8mb4_unicode_ci;
2+
CREATE database if NOT EXISTS `tinyurl` default character set utf8mb4 collate utf8mb4_bin;
33
use `tinyurl`;
44

55
SET NAMES utf8mb4;

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<maven.compiler.source>1.8</maven.compiler.source>
2020
<maven.compiler.target>1.8</maven.compiler.target>
2121
<springboot.version>2.3.7.RELEASE</springboot.version>
22-
<tinyurl.version>1.1.0</tinyurl.version>
2322
<mybatis-spring-boot-starter.version>2.1.3</mybatis-spring-boot-starter.version>
2423
<swagger.version>2.9.2</swagger.version>
2524
<!-- Plugins Version -->
@@ -41,7 +40,7 @@
4140
<dependency>
4241
<groupId>xyz.hellothomas</groupId>
4342
<artifactId>tinyurl-common</artifactId>
44-
<version>${tinyurl.version}</version>
43+
<version>${project.version}</version>
4544
</dependency>
4645

4746
<dependency>

tinyurl-generator/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
<dependency>
1616
<groupId>xyz.hellothomas</groupId>
1717
<artifactId>tinyurl-common</artifactId>
18-
<version>${tinyurl.version}</version>
19-
</dependency>
20-
21-
<dependency>
22-
<groupId>org.springframework.boot</groupId>
23-
<artifactId>spring-boot-devtools</artifactId>
24-
<optional>true</optional>
2518
</dependency>
2619

2720
<dependency>

tinyurl-generator/src/main/java/xyz/hellothomas/tinyurl/generator/api/dto/TinyUrlCreateRequest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ public class TinyUrlCreateRequest {
2727

2828
@NotBlank
2929
@Length(max = 2083)
30-
@ApiModelProperty(value = "原始url", required = true, dataType = "string", example = "\"https://oa.cmbchina" +
31-
".com/OAMS/Shell/\"")
30+
@ApiModelProperty(value = "原始url", required = true, dataType = "string", example = "\"https://gitee.com/hellothomas\"")
3231
private String originUrl;
3332

3433
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
3534
@Future
36-
@ApiModelProperty(value = "过期时间", dataType = "string", example = "\"2021-01-31 10:22:22\"")
35+
@ApiModelProperty(value = "过期时间", dataType = "string", example = "\"2023-01-31 10:22:22\"")
3736
private LocalDateTime expirationTime;
3837
}

tinyurl-generator/src/main/java/xyz/hellothomas/tinyurl/generator/domain/vo/UrlMappingResult.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package xyz.hellothomas.tinyurl.generator.domain.vo;
22

3-
import lombok.Builder;
4-
import lombok.Getter;
5-
import lombok.Setter;
6-
import lombok.ToString;
3+
import lombok.*;
74

85
import java.time.LocalDateTime;
96

@@ -17,6 +14,8 @@
1714
@Getter
1815
@Setter
1916
@ToString
17+
@NoArgsConstructor
18+
@AllArgsConstructor
2019
@Builder
2120
public class UrlMappingResult {
2221
/**

tinyurl-generator/src/main/java/xyz/hellothomas/tinyurl/generator/applicaton/handler/GlobalExceptionHandler.java renamed to tinyurl-generator/src/main/java/xyz/hellothomas/tinyurl/generator/infrastructure/exception/GlobalExceptionHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package xyz.hellothomas.tinyurl.generator.applicaton.handler;
1+
package xyz.hellothomas.tinyurl.generator.infrastructure.exception;
22

33
import lombok.extern.slf4j.Slf4j;
44
import org.springframework.http.converter.HttpMessageNotReadableException;
@@ -31,7 +31,8 @@ public class GlobalExceptionHandler {
3131
@ResponseBody
3232
public ApiResponse defaultErrorHandler(HttpServletRequest req, Exception e) throws Exception {
3333
log.error("default error handler", e);
34-
return ApiResponse.fail(ErrorCodeEnum.SYSTEM_ERROR.getMessage(), ErrorCodeEnum.SYSTEM_ERROR);
34+
return ApiResponse.fail(String.format("%s:%s", ErrorCodeEnum.SYSTEM_ERROR.getMessage(), e.getMessage()),
35+
ErrorCodeEnum.SYSTEM_ERROR);
3536
}
3637

3738
@ExceptionHandler(MyException.class)

tinyurl-generator/src/main/resources/application-local.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
spring:
22
datasource:
3-
password: 222222
4-
url: jdbc:mysql://127.0.0.1:3306/my_tool?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
3+
password: 123456
4+
url: jdbc:mysql://127.0.0.1:3306/tinyurl?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
55
&serverTimezone=Asia/Shanghai
66
username: root
77
redis:
@@ -12,14 +12,11 @@ spring:
1212
max-idle: 5
1313
max-active: 20
1414
min-idle: 5
15-
timeout: 2000-5000 #建立连接的超时时间2-5秒
16-
soTimeout: 2000-5000 #执行指令的超时时间(如果有这项配置)
17-
testOnBorrow: true #在从连接池取连接时检查有效性
18-
testWhileIdle: true #在空闲时检测连接有效性
1915
password:
2016
host: 127.0.0.1
2117
port: 6379
22-
timeout: 1000ms
18+
timeout: 500ms
19+
client-name: tinyurl-generator
2320
mybatis:
2421
mapper-locations: classpath*:mapper/*.xml
2522
tiny-url:
@@ -33,4 +30,4 @@ logging:
3330
hikari: debug
3431
xyz.hellothomas: debug
3532
root: info
36-
debug: true
33+
debug: false

tinyurl-generator/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spring:
1212
maximum-pool-size: 30
1313
minimum-idle: 10
1414
profiles:
15-
active: dev
15+
active: local
1616
logging:
1717
pattern:
1818
console: 'logback: %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %class#%method@%line : %msg %n'
Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
_ooOoo_
2-
o8888888o
3-
88" . "88
4-
(| -_- |)
5-
O\ = /O
6-
____/`---'\____
7-
. ' \\| |// `.
8-
/ \\||| : |||// \
9-
/ _||||| -:- |||||- \
10-
| | \\\ - /// | |
11-
| \_| ''\---/'' | |
12-
\ .-\__ `-` ___/-. /
13-
___`. .' /--.--\ `. . __
14-
."" '< `.___\_<|>_/___.' >'"".
15-
| | : `- \`.;`\ _ /`;.`/ - ` : | |
16-
\ \ `-. \_ __\ /__ _/ .-` / /
17-
======`-.____`-.___\_____/___.-`____.-'======
18-
`=---='
1+
_ _ _ _ _
2+
| | | | | | | | |
3+
| |__ ___| | | ___ | |_| |__ ___ _ __ ___ __ _ ___
4+
| '_ \ / _ \ | |/ _ \| __| '_ \ / _ \| '_ ` _ \ / _` / __|
5+
| | | | __/ | | (_) | |_| | | | (_) | | | | | | (_| \__ \
6+
|_| |_|\___|_|_|\___/ \__|_| |_|\___/|_| |_| |_|\__,_|___/
197

20-
.............................................
21-
佛祖保佑 永无BUG

tinyurl-query/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<dependency>
1616
<groupId>xyz.hellothomas</groupId>
1717
<artifactId>tinyurl-common</artifactId>
18-
<version>${tinyurl.version}</version>
1918
</dependency>
2019

2120
<dependency>

0 commit comments

Comments
 (0)