Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
springboot-mybatis
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wzy
springboot-mybatis
Commits
69a29333
Commit
69a29333
authored
Jun 08, 2021
by
wzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
err in setSuperEntityColumns
parent
d919ede9
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
25 additions
and
15 deletions
+25
-15
pom.xml
+2
-2
src/main/java/CodeGenerator.java
+1
-1
src/main/java/cn/blog/controller/PostController.java
+1
-1
src/main/java/cn/blog/controller/UserController.java
+3
-3
src/main/java/cn/blog/entity/Post.java
+6
-1
src/main/java/cn/blog/entity/User.java
+6
-1
src/main/java/cn/blog/mapper/PostMapper.java
+1
-1
src/main/java/cn/blog/mapper/UserMapper.java
+1
-1
src/main/java/cn/blog/service/IPostService.java
+1
-1
src/main/java/cn/blog/service/IUserService.java
+1
-1
src/main/java/cn/blog/service/impl/PostServiceImpl.java
+1
-1
src/main/java/cn/blog/service/impl/UserServiceImpl.java
+1
-1
No files found.
pom.xml
View file @
69a29333
...
...
@@ -8,13 +8,13 @@
<version>
2.5.0
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>
cn
.core
</groupId>
<groupId>
cn
</groupId>
<artifactId>
blog
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
blog
</name>
<description>
Demo project for Spring Boot
</description>
<properties>
<java.version>
1
1
</java.version>
<java.version>
1
5
</java.version>
</properties>
<dependencies>
<dependency>
...
...
src/main/java/CodeGenerator.java
View file @
69a29333
...
...
@@ -118,7 +118,7 @@ public class CodeGenerator {
// 公共父类
// strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// 写于父类中的公共字段
strategy
.
setSuperEntityColumns
(
"id"
);
//
strategy.setSuperEntityColumns("id");
strategy
.
setInclude
(
scanner
(
"表名,多个英文逗号分割"
).
split
(
","
));
strategy
.
setControllerMappingHyphenStyle
(
true
);
strategy
.
setTablePrefix
(
pc
.
getModuleName
()
+
"_"
);
...
...
src/main/java/cn/blog/controller/PostController.java
View file @
69a29333
...
...
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
@RestController
@RequestMapping
(
"/post"
)
...
...
src/main/java/cn/blog/controller/UserController.java
View file @
69a29333
...
...
@@ -15,7 +15,7 @@ import javax.annotation.Resource;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
@RestController
@RequestMapping
(
"/user"
)
...
...
@@ -24,8 +24,8 @@ public class UserController {
@Resource
IUserService
iUserService
;
@GetMapping
(
"/"
)
public
Object
index
()
{
@GetMapping
()
public
Object
getUser
()
{
return
iUserService
.
getById
(
1L
);
}
}
src/main/java/cn/blog/entity/Post.java
View file @
69a29333
package
cn
.
blog
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
...
...
@@ -11,7 +13,7 @@ import lombok.EqualsAndHashCode;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
...
...
@@ -19,6 +21,9 @@ public class Post implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
private
Long
userId
;
private
String
title
;
...
...
src/main/java/cn/blog/entity/User.java
View file @
69a29333
package
cn
.
blog
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
...
...
@@ -11,7 +13,7 @@ import lombok.EqualsAndHashCode;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
...
...
@@ -19,6 +21,9 @@ public class User implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
private
String
username
;
private
String
avatar
;
...
...
src/main/java/cn/blog/mapper/PostMapper.java
View file @
69a29333
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
public
interface
PostMapper
extends
BaseMapper
<
Post
>
{
...
...
src/main/java/cn/blog/mapper/UserMapper.java
View file @
69a29333
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
public
interface
UserMapper
extends
BaseMapper
<
User
>
{
...
...
src/main/java/cn/blog/service/IPostService.java
View file @
69a29333
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
public
interface
IPostService
extends
IService
<
Post
>
{
...
...
src/main/java/cn/blog/service/IUserService.java
View file @
69a29333
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
public
interface
IUserService
extends
IService
<
User
>
{
...
...
src/main/java/cn/blog/service/impl/PostServiceImpl.java
View file @
69a29333
...
...
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
@Service
public
class
PostServiceImpl
extends
ServiceImpl
<
PostMapper
,
Post
>
implements
IPostService
{
...
...
src/main/java/cn/blog/service/impl/UserServiceImpl.java
View file @
69a29333
...
...
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author core
* @since 2021-06-0
7
* @since 2021-06-0
8
*/
@Service
public
class
UserServiceImpl
extends
ServiceImpl
<
UserMapper
,
User
>
implements
IUserService
{
...
...
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