-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43c3056
commit 51c882c
Showing
15 changed files
with
317 additions
and
34 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
learn-kit/src/main/java/com/futao/learn/kit/kit/TimeKit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.futao.learn.kit.kit; | ||
|
||
import java.time.Instant; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.time.ZoneOffset; | ||
import java.util.Date; | ||
|
||
/** | ||
* @author futao | ||
* @date 2020/3/16. | ||
*/ | ||
public class TimeKit { | ||
|
||
|
||
/** | ||
* LocalDateTime 转为 Date | ||
* | ||
* @param localDateTime | ||
* @return | ||
*/ | ||
public Date parseLocalDateTime2Date(LocalDateTime localDateTime) { | ||
Instant instant = localDateTime.atZone(ZoneOffset.ofHours(8)).toInstant(); | ||
return Date.from(instant); | ||
} | ||
|
||
/** | ||
* LocalDate 转为 Date | ||
* | ||
* @param localDate | ||
* @return | ||
*/ | ||
public Date parseLocalDate2Date(LocalDate localDate) { | ||
Instant instant = localDate.atStartOfDay(ZoneOffset.ofHours(8)).toInstant(); | ||
return Date.from(instant); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...-rabbitmq/src/main/java/com/futao/springboot/learn/rabbitmq/config/MybatisPlusConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
package com.futao.springboot.learn.rabbitmq.config; | ||
|
||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; | ||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; | ||
import org.apache.ibatis.reflection.MetaObject; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* @author futao | ||
* @date 2020/3/9. | ||
*/ | ||
@Configuration | ||
public class MybatisPlusConfig implements MetaObjectHandler { | ||
|
||
|
||
/** | ||
* 分页插件 | ||
* | ||
* @return | ||
*/ | ||
@Bean | ||
public PaginationInterceptor paginationInterceptor() { | ||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); | ||
return paginationInterceptor; | ||
} | ||
|
||
@Override | ||
public void insertFill(MetaObject metaObject) { | ||
setFieldValByName("createDateTime", LocalDateTime.now(), metaObject); | ||
} | ||
|
||
@Override | ||
public void updateFill(MetaObject metaObject) { | ||
setFieldValByName("updateDateTime", LocalDateTime.now(), metaObject); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...boot-learn-rabbitmq/src/main/java/com/futao/springboot/learn/rabbitmq/dao/UserMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.futao.springboot.learn.rabbitmq.dao; | ||
|
||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import com.futao.springboot.learn.rabbitmq.model.UserModel; | ||
|
||
/** | ||
* @author futao | ||
* @date 2020/3/19. | ||
*/ | ||
public interface UserMapper extends BaseMapper<UserModel> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.