Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
schbrain-initializer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
schbrain-initializer
Commits
c4e468c5
Commit
c4e468c5
authored
Aug 31, 2023
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to schbrain-parent 3.0.8-SNAPSHOT
parent
68d31b29
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
20 deletions
+63
-20
initializer-dao/src/main/java/com/schbrain/initializer/dao/entity/Entity.java
...main/java/com/schbrain/initializer/dao/entity/Entity.java
+2
-0
initializer-facade/pom.xml
initializer-facade/pom.xml
+7
-3
initializer-starter/pom.xml
initializer-starter/pom.xml
+3
-3
initializer-starter/src/main/resources/application.yaml
initializer-starter/src/main/resources/application.yaml
+6
-1
initializer-web/src/main/java/com/schbrain/initializer/web/controller/EntityController.java
...schbrain/initializer/web/controller/EntityController.java
+43
-11
pom.xml
pom.xml
+2
-2
No files found.
initializer-dao/src/main/java/com/schbrain/initializer/dao/entity/Entity.java
View file @
c4e468c5
...
...
@@ -16,4 +16,6 @@ public class Entity extends BaseEntity {
@BizId
private
String
name
;
private
Integer
age
;
}
initializer-facade/pom.xml
View file @
c4e468c5
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns
=
"http://maven.apache.org/POM/4.0.0
"
xmlns
:xsi=
"http://www.w3.org/2001/XMLSchema-instance
"
<project
xmlns
:xsi=
"http://www.w3.org/2001/XMLSchema-instance
"
xmlns
=
"http://maven.apache.org/POM/4.0.0
"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -50,6 +50,10 @@
<groupId>
com.schbrain.framework
</groupId>
<artifactId>
oss-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.redisson
</groupId>
<artifactId>
redisson-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.schbrain.framework
</groupId>
<artifactId>
xxl-job-spring-boot-starter
</artifactId>
...
...
@@ -60,4 +64,4 @@
</dependency>
</dependencies>
</project>
\ No newline at end of file
</project>
initializer-starter/pom.xml
View file @
c4e468c5
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns
=
"http://maven.apache.org/POM/4.0.0
"
xmlns
:xsi=
"http://www.w3.org/2001/XMLSchema-instance
"
<project
xmlns
:xsi=
"http://www.w3.org/2001/XMLSchema-instance
"
xmlns
=
"http://maven.apache.org/POM/4.0.0
"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -54,4 +54,4 @@
</plugins>
</build>
</project>
\ No newline at end of file
</project>
initializer-starter/src/main/resources/application.yaml
View file @
c4e468c5
spring
:
application
:
name
:
schbrain-initializer
\ No newline at end of file
name
:
schbrain-initializer
kafka
:
consumer
:
enabled
:
true
listener
:
ack-mode
:
manual
initializer-web/src/main/java/com/schbrain/initializer/web/controller/EntityController.java
View file @
c4e468c5
package
com.schbrain.initializer.web.controller
;
import
cn.hutool.core.util.RandomUtil
;
import
com.schbrain.common.util.BeanCopyUtils
;
import
com.schbrain.common.util.JacksonUtils
;
import
com.schbrain.common.util.support.lock.RedisLockUtils
;
import
com.schbrain.framework.autoconfigure.mybatis.base.BaseEntity
;
import
com.schbrain.framework.autoconfigure.mybatis.base.BaseService
;
import
com.schbrain.initializer.dao.entity.Entity
;
...
...
@@ -9,14 +11,12 @@ import com.schbrain.initializer.dao.entity.EntityWithLogicDelete;
import
com.schbrain.initializer.service.EntityService
;
import
com.schbrain.initializer.service.EntityWithLogicDeleteService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.tuple.Triple
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
import
java.time.LocalDate
;
import
java.util.*
;
/**
* @author liaozan
...
...
@@ -32,21 +32,53 @@ public class EntityController {
@Autowired
private
EntityWithLogicDeleteService
entityWithLogicDeleteService
;
@GetMapping
public
void
localDateTime
(
@RequestParam
LocalDateTime
time
)
{
System
.
out
.
println
(
time
);
@GetMapping
(
"/copy"
)
public
void
copy
()
{
Entity
entity
=
new
Entity
();
entity
.
setId
(
1L
);
Entity
copied
=
BeanCopyUtils
.
copy
(
entity
,
Entity
.
class
);
System
.
out
.
println
(
copied
);
}
@GetMapping
(
"/time"
)
public
Triple
<
Date
,
LocalDate
,
Entity
>
dateTime
(
@RequestParam
Date
date
,
@RequestParam
LocalDate
dateTime
,
@RequestBody
Entity
entity
)
{
log
.
info
(
"date: {}"
,
date
);
log
.
info
(
"dateTime: {}"
,
dateTime
);
return
Triple
.
of
(
date
,
dateTime
,
entity
);
}
@GetMapping
(
"/lock"
)
public
void
lock
()
{
RedisLockUtils
.
executeWithLock
(
"lock"
,
()
->
System
.
out
.
println
(
"lock"
));
}
@GetMapping
(
"/bizId"
)
public
void
bizId
()
{
String
name
=
entityService
.
getById
(
106L
,
Entity:
:
getName
);
System
.
out
.
println
(
JacksonUtils
.
toPrettyJsonString
(
name
));
Entity
entity
=
entityService
.
getByBizId
(
"8352707733"
);
System
.
out
.
println
(
JacksonUtils
.
toPrettyJsonString
(
entity
));
List
<
Entity
>
entities
=
entityService
.
listByBizIds
(
List
.
of
(
"8352707733"
));
Integer
age
=
entityService
.
getByBizId
(
"8352707733"
,
Entity:
:
getAge
);
System
.
out
.
println
(
age
);
Long
id
=
entityService
.
getByBizId
(
"8352707733"
,
Entity:
:
getId
);
System
.
out
.
println
(
id
);
List
<
Entity
>
entities
=
entityService
.
listByBizIds
(
List
.
of
(
"8352707733"
,
"1119254675595816960"
));
System
.
out
.
println
(
JacksonUtils
.
toPrettyJsonString
(
entities
));
Map
<
String
,
Entity
>
entityMap
=
entityService
.
getMapByBizIds
(
List
.
of
(
"8352707733"
));
Map
<
String
,
Entity
>
entityMap
=
entityService
.
getMapByBizIds
(
List
.
of
(
"8352707733"
,
"1119254675595816960"
));
System
.
out
.
println
(
JacksonUtils
.
toPrettyJsonString
(
entityMap
));
List
<
String
>
names
=
entityService
.
listByBizIds
(
List
.
of
(
"8352707733"
,
"1119254675595816960"
),
Entity:
:
getName
);
System
.
out
.
println
(
JacksonUtils
.
toPrettyJsonString
(
names
));
List
<
String
>
nameList
=
entityService
.
listByIds
(
List
.
of
(
37L
,
106L
,
107L
),
Entity:
:
getName
);
System
.
out
.
println
(
JacksonUtils
.
toPrettyJsonString
(
nameList
));
}
@GetMapping
(
"/entity"
)
...
...
pom.xml
View file @
c4e468c5
...
...
@@ -8,7 +8,7 @@
<parent>
<groupId>
com.schbrain.framework
</groupId>
<artifactId>
schbrain-parent
</artifactId>
<version>
3.0.
5
-SNAPSHOT
</version>
<version>
3.0.
8
-SNAPSHOT
</version>
</parent>
<groupId>
com.schbrain
</groupId>
...
...
@@ -82,4 +82,4 @@
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
</project>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment