Commit 69a29333 by wzy

err in setSuperEntityColumns

parent d919ede9
......@@ -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>11</java.version>
<java.version>15</java.version>
</properties>
<dependencies>
<dependency>
......
......@@ -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() + "_");
......
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
@RestController
@RequestMapping("/post")
......
......@@ -15,7 +15,7 @@ import javax.annotation.Resource;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
@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);
}
}
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-07
* @since 2021-06-08
*/
@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;
......
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-07
* @since 2021-06-08
*/
@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;
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
public interface PostMapper extends BaseMapper<Post> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
public interface UserMapper extends BaseMapper<User> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
public interface IPostService extends IService<Post> {
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
public interface IUserService extends IService<User> {
......
......@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
@Service
public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements IPostService {
......
......@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author core
* @since 2021-06-07
* @since 2021-06-08
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment