Skip to content

Commit 7622eda

Browse files
committed
update package
1 parent bdda5ce commit 7622eda

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+128
-93
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ java -jar target/code-demo-1.0-SNAPSHOT.jar
103103
| - - - - - - - - - - - - - - - - - - - -- - - - - - - - - -- - - - - - - - - -- - - - - - - - - - - - - -
104104
+- lazy-fast-code
105105
| |
106-
| +- core - - - - LazyFastCode核心类集合,会打成Maven-jar包,供其它项目/模块依赖
106+
| +- core-web - - - - LazyFastCode核心类集合,会打成Maven-jar包,供其它项目/模块依赖
107107
| | +- src/
108108
| | | +- main
109109
| | | +- java
110-
| | | +- lazy.fast.code.core
110+
| | | +- lazy.fast.code.core.web
111111
| | +- pom.xml
112112
| |
113113
| |

core/pom.xml renamed to core-web/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<version>1.0-SNAPSHOT</version>
1111
</parent>
1212

13-
<artifactId>code-core</artifactId>
13+
<artifactId>core-web</artifactId>
1414
<packaging>jar</packaging>
1515

1616
<dependencies>

core/src/main/java/lazy/fast/code/core/configuration/LocalDateTimeSerializerConfig.java renamed to core-web/src/main/java/lazy/fast/code/core/web/configuration/LocalDateTimeSerializerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.configuration;
1+
package lazy.fast.code.core.web.configuration;
22

33
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
44
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;

core/src/main/java/lazy/fast/code/core/exception/AuthException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/AuthException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.MsgEnum;
4-
import lazy.fast.code.core.result.MsgEnumable;
5-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.MsgEnum;
4+
import lazy.fast.code.core.web.result.MsgEnumable;
5+
import lazy.fast.code.core.web.result.ResultMsg;
66

77
/**
88
* 自定义未经过身份认证异常 - HTTP Status 401

core/src/main/java/lazy/fast/code/core/exception/BaseUnCheckException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/BaseUnCheckException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.ResultMsg;
44
import lombok.Getter;
55

66
/**

core/src/main/java/lazy/fast/code/core/exception/BusinessException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/BusinessException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.MsgEnumable;
4-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.MsgEnumable;
4+
import lazy.fast.code.core.web.result.ResultMsg;
55

66
/**
77
* 自定义业务异常类 - HTTP Status 400

core/src/main/java/lazy/fast/code/core/exception/ForbiddenException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/ForbiddenException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.MsgEnum;
4-
import lazy.fast.code.core.result.MsgEnumable;
5-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.MsgEnum;
4+
import lazy.fast.code.core.web.result.MsgEnumable;
5+
import lazy.fast.code.core.web.result.ResultMsg;
66

77
/**
88
* 访问被禁止异常 - HTTP Status 403

core/src/main/java/lazy/fast/code/core/exception/GlobalRestExceptionHandler.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/GlobalRestExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.MsgEnum;
4-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.MsgEnum;
4+
import lazy.fast.code.core.web.result.ResultMsg;
55
import lombok.extern.slf4j.Slf4j;
66
import org.springframework.beans.TypeMismatchException;
77
import org.springframework.http.HttpStatus;

core/src/main/java/lazy/fast/code/core/exception/NoContentNotException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/NoContentNotException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

33
/**
44
* 无内容 - 这不是异常 - HTTP Status 204

core/src/main/java/lazy/fast/code/core/exception/NotFoundException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/NotFoundException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.MsgEnum;
4-
import lazy.fast.code.core.result.MsgEnumable;
5-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.MsgEnum;
4+
import lazy.fast.code.core.web.result.MsgEnumable;
5+
import lazy.fast.code.core.web.result.ResultMsg;
66

77
/**
88
* 自定义资源不存在异常类 - HTTP Status 404

core/src/main/java/lazy/fast/code/core/exception/SystemException.java renamed to core-web/src/main/java/lazy/fast/code/core/web/exception/SystemException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package lazy.fast.code.core.exception;
1+
package lazy.fast.code.core.web.exception;
22

3-
import lazy.fast.code.core.result.MsgEnumable;
4-
import lazy.fast.code.core.result.ResultMsg;
3+
import lazy.fast.code.core.web.result.MsgEnumable;
4+
import lazy.fast.code.core.web.result.ResultMsg;
55

66
/**
77
* 自定义系统异常类 - HTTP Status 500

core/src/main/java/lazy/fast/code/core/orm/BaseController.java renamed to core-web/src/main/java/lazy/fast/code/core/web/orm/BaseController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package lazy.fast.code.core.orm;
1+
package lazy.fast.code.core.web.orm;
22

3-
import lazy.fast.code.core.exception.SystemException;
3+
import lazy.fast.code.core.web.exception.SystemException;
44

55
/**
66
* 基础Controller

core/src/main/java/lazy/fast/code/core/orm/BaseEntity.java renamed to core-web/src/main/java/lazy/fast/code/core/web/orm/BaseEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.orm;
1+
package lazy.fast.code.core.web.orm;
22

33
import io.swagger.annotations.ApiModelProperty;
44
import lombok.Getter;

core/src/main/java/lazy/fast/code/core/orm/BaseRepository.java renamed to core-web/src/main/java/lazy/fast/code/core/web/orm/BaseRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.orm;
1+
package lazy.fast.code.core.web.orm;
22

33
import tk.mybatis.mapper.additional.insert.InsertListMapper;
44
import tk.mybatis.mapper.annotation.RegisterMapper;

core/src/main/java/lazy/fast/code/core/orm/BaseService.java renamed to core-web/src/main/java/lazy/fast/code/core/web/orm/BaseService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.orm;
1+
package lazy.fast.code.core.web.orm;
22

33
import java.io.Serializable;
44
import java.util.List;

core/src/main/java/lazy/fast/code/core/orm/BaseServiceImpl.java renamed to core-web/src/main/java/lazy/fast/code/core/web/orm/BaseServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package lazy.fast.code.core.orm;
1+
package lazy.fast.code.core.web.orm;
22

33
import com.github.pagehelper.PageRowBounds;
4-
import lazy.fast.code.core.exception.SystemException;
4+
import lazy.fast.code.core.web.exception.SystemException;
55
import tk.mybatis.mapper.util.Assert;
66

77
import java.io.Serializable;

core/src/main/java/lazy/fast/code/core/orm/genid/SnowFlakeGenId.java renamed to core-web/src/main/java/lazy/fast/code/core/web/orm/genid/SnowFlakeGenId.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package lazy.fast.code.core.orm.genid;
1+
package lazy.fast.code.core.web.orm.genid;
22

3-
import lazy.fast.code.core.exception.SystemException;
3+
import lazy.fast.code.core.web.exception.SystemException;
44
import tk.mybatis.mapper.genid.GenId;
55

66
import java.net.InetAddress;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* lazy-fast-code-core-web
3+
*
4+
* @author wendell
5+
*/
6+
package lazy.fast.code.core.web;

core/src/main/java/lazy/fast/code/core/result/MsgEnum.java renamed to core-web/src/main/java/lazy/fast/code/core/web/result/MsgEnum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.result;
1+
package lazy.fast.code.core.web.result;
22

33
/**
44
* 常用消息枚举类

core/src/main/java/lazy/fast/code/core/result/MsgEnumable.java renamed to core-web/src/main/java/lazy/fast/code/core/web/result/MsgEnumable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lazy.fast.code.core.result;
1+
package lazy.fast.code.core.web.result;
22

33
/**
44
* 消息枚举顶层接口, 自定义消息枚举类应该实现此接口

core/src/main/java/lazy/fast/code/core/result/ResultMsg.java renamed to core-web/src/main/java/lazy/fast/code/core/web/result/ResultMsg.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package lazy.fast.code.core.result;
1+
package lazy.fast.code.core.web.result;
22

33
import com.fasterxml.jackson.annotation.JsonInclude;
44
import com.fasterxml.jackson.core.JsonProcessingException;
55
import com.fasterxml.jackson.databind.ObjectMapper;
6-
import lazy.fast.code.core.exception.SystemException;
6+
import lazy.fast.code.core.web.exception.SystemException;
77
import lombok.Getter;
88
import lombok.Setter;
99

core/src/main/java/lazy/fast/code/core/package-info.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

demo/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
<version>1.0-SNAPSHOT</version>
1111
</parent>
1212

13-
<artifactId>code-demo</artifactId>
13+
<artifactId>demo</artifactId>
1414
<packaging>jar</packaging>
1515

16-
<name>code-demo</name>
16+
<name>demo</name>
1717
<description>lazyFastCode 使用示例</description>
1818

1919
<dependencies>
2020
<dependency>
2121
<groupId>lazy.fast.code</groupId>
22-
<artifactId>code-core</artifactId>
22+
<artifactId>core-web</artifactId>
2323
</dependency>
2424
</dependencies>
2525

demo/src/main/java/lazy/fast/code/demo/Application.java

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package lazy.fast.code.demo;
22

3+
import lazy.fast.code.core.web.exception.NoContentNotException;
4+
import lazy.fast.code.core.web.exception.NotFoundException;
35
import org.springframework.boot.SpringApplication;
46
import org.springframework.boot.autoconfigure.SpringBootApplication;
57
import org.springframework.http.ResponseEntity;
@@ -8,7 +10,7 @@
810

911
import com.spring4all.swagger.EnableSwagger2Doc;
1012

11-
import lazy.fast.code.core.result.ResultMsg;
13+
import lazy.fast.code.core.web.result.ResultMsg;
1214

1315
/**
1416
* 启动类
@@ -64,11 +66,44 @@ public ResultMsg ok2() {
6466
}
6567

6668
/**
67-
* 无返回值
69+
* 无返回值, 这是正确的请求,只是没有内容返回,http状态为204
6870
*/
6971
@GetMapping("/no-content")
70-
public ResponseEntity hello() {
72+
public ResponseEntity<Void> noContent() {
7173
return ResponseEntity.noContent().build();
7274
}
7375

76+
/**
77+
* 无返回值, 等同于:
78+
*
79+
* <pre>
80+
* &#64;GetMapping("/no-content")
81+
* public ResponseEntity noContent() {
82+
* return ResponseEntity.noContent().build();
83+
* }
84+
* </pre>
85+
*/
86+
@GetMapping("/no-content1")
87+
public void noContent1() {
88+
throw new NoContentNotException();
89+
}
90+
91+
/**
92+
* http状态为404, 无返回内容
93+
*/
94+
@GetMapping("/not-found")
95+
public ResponseEntity<Void> notFound() {
96+
return ResponseEntity.notFound().build();
97+
}
98+
99+
/**
100+
* http状态为404,
101+
*
102+
* @return {"code":404,"msg":"资源不存在"}
103+
*/
104+
@GetMapping("/not-found")
105+
public ResponseEntity<ResultMsg> notFound1() {
106+
throw new NotFoundException();
107+
}
108+
74109
}

demo/src/main/java/lazy/fast/code/demo/address/AddressController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import io.swagger.annotations.ApiImplicitParam;
66
import io.swagger.annotations.ApiImplicitParams;
77
import io.swagger.annotations.ApiOperation;
8-
import lazy.fast.code.core.exception.NoContentNotException;
9-
import lazy.fast.code.core.exception.NotFoundException;
10-
import lazy.fast.code.core.orm.BaseController;
11-
import lazy.fast.code.core.orm.BaseService;
8+
import lazy.fast.code.core.web.exception.NoContentNotException;
9+
import lazy.fast.code.core.web.exception.NotFoundException;
10+
import lazy.fast.code.core.web.orm.BaseController;
11+
import lazy.fast.code.core.web.orm.BaseService;
1212
import org.springframework.http.ResponseEntity;
1313
import org.springframework.util.CollectionUtils;
1414
import org.springframework.web.bind.annotation.DeleteMapping;

demo/src/main/java/lazy/fast/code/demo/address/AddressRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.apache.ibatis.annotations.Mapper;
44
import org.springframework.stereotype.Repository;
55

6-
import lazy.fast.code.core.orm.BaseRepository;
6+
import lazy.fast.code.core.web.orm.BaseRepository;
77

88
/**
99
* 地址信息

demo/src/main/java/lazy/fast/code/demo/address/AddressService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package lazy.fast.code.demo.address;
22

3-
import lazy.fast.code.core.orm.BaseService;
3+
import lazy.fast.code.core.web.orm.BaseService;
44

55
/**
66
* 地址信息

demo/src/main/java/lazy/fast/code/demo/address/AddressServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import org.springframework.stereotype.Service;
44

5-
import lazy.fast.code.core.orm.BaseRepository;
6-
import lazy.fast.code.core.orm.BaseServiceImpl;
5+
import lazy.fast.code.core.web.orm.BaseRepository;
6+
import lazy.fast.code.core.web.orm.BaseServiceImpl;
77

88
/**
99
* 地址信息

demo/src/main/java/lazy/fast/code/demo/core/BaseEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package lazy.fast.code.demo.core;
22

33
import io.swagger.annotations.ApiModelProperty;
4-
import lazy.fast.code.core.orm.genid.SnowFlakeGenId;
4+
import lazy.fast.code.core.web.orm.genid.SnowFlakeGenId;
55
import lombok.Getter;
66
import lombok.Setter;
77
import tk.mybatis.mapper.annotation.KeySql;
@@ -18,7 +18,7 @@
1818
@MappedSuperclass
1919
@Setter
2020
@Getter
21-
public abstract class BaseEntity extends lazy.fast.code.core.orm.BaseEntity {
21+
public abstract class BaseEntity extends lazy.fast.code.core.web.orm.BaseEntity {
2222

2323
/**
2424
* 数据主键 - 自定义生成策略

demo/src/main/java/lazy/fast/code/demo/user/User.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import io.swagger.annotations.ApiModel;
44
import io.swagger.annotations.ApiModelProperty;
5-
import lazy.fast.code.core.orm.BaseEntity;
5+
import lazy.fast.code.core.web.orm.BaseEntity;
66
import lombok.Data;
77
import lombok.EqualsAndHashCode;
88

demo/src/main/java/lazy/fast/code/demo/user/UserController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import io.swagger.annotations.ApiImplicitParam;
55
import io.swagger.annotations.ApiImplicitParams;
66
import io.swagger.annotations.ApiOperation;
7-
import lazy.fast.code.core.exception.NoContentNotException;
8-
import lazy.fast.code.core.exception.NotFoundException;
9-
import lazy.fast.code.core.orm.BaseController;
10-
import lazy.fast.code.core.orm.BaseService;
7+
import lazy.fast.code.core.web.exception.NoContentNotException;
8+
import lazy.fast.code.core.web.exception.NotFoundException;
9+
import lazy.fast.code.core.web.orm.BaseController;
10+
import lazy.fast.code.core.web.orm.BaseService;
1111
import org.springframework.http.ResponseEntity;
1212
import org.springframework.util.CollectionUtils;
1313
import org.springframework.web.bind.annotation.DeleteMapping;

demo/src/main/java/lazy/fast/code/demo/user/UserRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package lazy.fast.code.demo.user;
22

3-
import lazy.fast.code.core.orm.BaseRepository;
3+
import lazy.fast.code.core.web.orm.BaseRepository;
44
import org.apache.ibatis.annotations.Mapper;
55
import org.apache.ibatis.annotations.Select;
66
import org.springframework.stereotype.Repository;

demo/src/main/java/lazy/fast/code/demo/user/UserService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package lazy.fast.code.demo.user;
22

3-
import lazy.fast.code.core.orm.BaseService;
3+
import lazy.fast.code.core.web.orm.BaseService;
44

55
import java.util.List;
66

demo/src/main/java/lazy/fast/code/demo/user/UserServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package lazy.fast.code.demo.user;
22

3-
import lazy.fast.code.core.exception.NoContentNotException;
4-
import lazy.fast.code.core.orm.BaseRepository;
5-
import lazy.fast.code.core.orm.BaseServiceImpl;
3+
import lazy.fast.code.core.web.exception.NoContentNotException;
4+
import lazy.fast.code.core.web.orm.BaseRepository;
5+
import lazy.fast.code.core.web.orm.BaseServiceImpl;
66
import lazy.fast.code.demo.address.Address;
77
import lazy.fast.code.demo.address.AddressService;
88
import org.springframework.beans.factory.annotation.Autowired;

0 commit comments

Comments
 (0)