增加mall模块,测试Fluent-Mybatis
This commit is contained in:
parent
a72109cd7a
commit
6a5146d7b0
1
pom.xml
1
pom.xml
|
@ -234,6 +234,7 @@
|
|||
<module>ruoyi-demo</module>
|
||||
<module>ruoyi-extend</module>
|
||||
<module>ruoyi-oss</module>
|
||||
<module>ruoyi-mall</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ token:
|
|||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
expireTime: 300
|
||||
|
||||
# 重复提交
|
||||
repeat-submit:
|
||||
|
|
|
@ -178,6 +178,22 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
package com.ruoyi.common.core.domain.entity.test;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
|
||||
import cn.org.atool.fluent.mybatis.base.IEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品对象 product
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2021-09-03
|
||||
*/
|
||||
|
||||
@Data
|
||||
@FluentMybatis
|
||||
public class Product implements IEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDateTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDateTime;
|
||||
|
||||
/**
|
||||
* 商品唯一编号
|
||||
*/
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
private BigDecimal freight;
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.ruoyi.common.core.domain.entity.test;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.mapper.ProductMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 商品测试
|
||||
* @author Geniou
|
||||
* @create 2021/9/6 18:41
|
||||
*/
|
||||
public class ProductTest {
|
||||
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.dao.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.test.dao.base.ProductCategoryBaseDao;
|
||||
import com.ruoyi.common.core.domain.entity.test.dao.intf.ProductCategoryDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* ProductCategoryDaoImpl: 数据操作接口实现
|
||||
*
|
||||
* 这只是一个减少手工创建的模板文件
|
||||
* 可以任意添加方法和实现, 更改作者和重定义类名
|
||||
* <p/>@author Powered By Fluent Mybatis
|
||||
*/
|
||||
@Repository
|
||||
public class ProductCategoryDaoImpl extends ProductCategoryBaseDao implements ProductCategoryDao {
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.dao.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.test.dao.base.ProductCategoryRelationBaseDao;
|
||||
import com.ruoyi.common.core.domain.entity.test.dao.intf.ProductCategoryRelationDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* ProductCategoryRelationDaoImpl: 数据操作接口实现
|
||||
*
|
||||
* 这只是一个减少手工创建的模板文件
|
||||
* 可以任意添加方法和实现, 更改作者和重定义类名
|
||||
* <p/>@author Powered By Fluent Mybatis
|
||||
*/
|
||||
@Repository
|
||||
public class ProductCategoryRelationDaoImpl extends ProductCategoryRelationBaseDao implements ProductCategoryRelationDao {
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.dao.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.test.dao.base.ProductBaseDao;
|
||||
import com.ruoyi.common.core.domain.entity.test.dao.intf.ProductDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* ProductDaoImpl: 数据操作接口实现
|
||||
*
|
||||
* 这只是一个减少手工创建的模板文件
|
||||
* 可以任意添加方法和实现, 更改作者和重定义类名
|
||||
* <p/>@author Powered By Fluent Mybatis
|
||||
*/
|
||||
@Repository
|
||||
public class ProductDaoImpl extends ProductBaseDao implements ProductDao {
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.dao.intf;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.base.IBaseDao;
|
||||
import com.ruoyi.common.core.domain.entity.test.entity.ProductCategory;
|
||||
|
||||
/**
|
||||
* ProductCategoryDao: 数据操作接口
|
||||
*
|
||||
* 这只是一个减少手工创建的模板文件
|
||||
* 可以任意添加方法和实现, 更改作者和重定义类名
|
||||
* <p/>@author Powered By Fluent Mybatis
|
||||
*/
|
||||
public interface ProductCategoryDao extends IBaseDao<ProductCategory> {
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.dao.intf;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.base.IBaseDao;
|
||||
import com.ruoyi.common.core.domain.entity.test.entity.ProductCategoryRelation;
|
||||
|
||||
/**
|
||||
* ProductCategoryRelationDao: 数据操作接口
|
||||
*
|
||||
* 这只是一个减少手工创建的模板文件
|
||||
* 可以任意添加方法和实现, 更改作者和重定义类名
|
||||
* <p/>@author Powered By Fluent Mybatis
|
||||
*/
|
||||
public interface ProductCategoryRelationDao extends IBaseDao<ProductCategoryRelation> {
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.dao.intf;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.base.IBaseDao;
|
||||
import com.ruoyi.common.core.domain.entity.test.entity.Product;
|
||||
|
||||
/**
|
||||
* ProductDao: 数据操作接口
|
||||
*
|
||||
* 这只是一个减少手工创建的模板文件
|
||||
* 可以任意添加方法和实现, 更改作者和重定义类名
|
||||
* <p/>@author Powered By Fluent Mybatis
|
||||
*/
|
||||
public interface ProductDao extends IBaseDao<Product> {
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.entity;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
|
||||
import cn.org.atool.fluent.mybatis.annotation.RefMethod;
|
||||
import cn.org.atool.fluent.mybatis.annotation.TableField;
|
||||
import cn.org.atool.fluent.mybatis.annotation.TableId;
|
||||
import cn.org.atool.fluent.mybatis.base.IEntity;
|
||||
import cn.org.atool.fluent.mybatis.base.RichEntity;
|
||||
import cn.org.atool.fluent.mybatis.functions.TableSupplier;
|
||||
import java.io.Serializable;
|
||||
import java.lang.Class;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* Product: 数据映射实体定义
|
||||
*
|
||||
* @author Powered By Fluent Mybatis
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@Data
|
||||
@Accessors(
|
||||
chain = true
|
||||
)
|
||||
@EqualsAndHashCode(
|
||||
callSuper = false
|
||||
)
|
||||
@FluentMybatis(
|
||||
table = "product",
|
||||
schema = "ruoyi",
|
||||
suffix = ""
|
||||
)
|
||||
public class Product extends RichEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date_time")
|
||||
private Date createDateTime;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
@TableField("freight")
|
||||
private BigDecimal freight;
|
||||
|
||||
/**
|
||||
* 商品唯一编号
|
||||
*/
|
||||
@TableField("product_code")
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@TableField("product_name")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@TableField("unit_price")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("update_date_time")
|
||||
private Date updateDateTime;
|
||||
|
||||
@Override
|
||||
public Serializable findPk() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Class<? extends IEntity> entityClass() {
|
||||
return Product.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Product changeTableBelongTo(TableSupplier supplier) {
|
||||
return super.changeTableBelongTo(supplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Product changeTableBelongTo(String table) {
|
||||
return super.changeTableBelongTo(table);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现定义在{@link cn.org.atool.fluent.mybatis.base.IRefs}子类Refs上
|
||||
*/
|
||||
@RefMethod
|
||||
public List<ProductCategory> findProductCategoryList() {
|
||||
return super.invoke("findProductCategoryList", true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.entity;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
|
||||
import cn.org.atool.fluent.mybatis.annotation.RefMethod;
|
||||
import cn.org.atool.fluent.mybatis.annotation.TableField;
|
||||
import cn.org.atool.fluent.mybatis.annotation.TableId;
|
||||
import cn.org.atool.fluent.mybatis.base.IEntity;
|
||||
import cn.org.atool.fluent.mybatis.base.RichEntity;
|
||||
import cn.org.atool.fluent.mybatis.functions.TableSupplier;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.Class;
|
||||
import java.lang.Integer;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* ProductCategory: 数据映射实体定义
|
||||
*
|
||||
* @author Powered By Fluent Mybatis
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@FluentMybatis(table = "product_category", schema = "ruoyi", suffix = "")
|
||||
public class ProductCategory extends RichEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@TableField("category_name")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 分类类型(Title-标题,Value-值)
|
||||
*/
|
||||
@TableField("category_type")
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date_time")
|
||||
private Date createDateTime;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
@TableField("level_no")
|
||||
private Integer levelNo;
|
||||
|
||||
/**
|
||||
* 父级分类主键
|
||||
*/
|
||||
@TableField("parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@TableField("sort_num")
|
||||
private Integer sortNum;
|
||||
|
||||
/**
|
||||
* 分类状态(Enable-启用,Disable-禁用,Delete-删除)
|
||||
*/
|
||||
@TableField("status_type")
|
||||
private String statusType;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("update_date_time")
|
||||
private Date updateDateTime;
|
||||
|
||||
@Override
|
||||
public Serializable findPk() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Class<? extends IEntity> entityClass() {
|
||||
return ProductCategory.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ProductCategory changeTableBelongTo(TableSupplier supplier) {
|
||||
return super.changeTableBelongTo(supplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ProductCategory changeTableBelongTo(String table) {
|
||||
return super.changeTableBelongTo(table);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现定义在{@link cn.org.atool.fluent.mybatis.base.IRefs}子类Refs上
|
||||
*/
|
||||
@RefMethod
|
||||
public List<Product> findProductList() {
|
||||
return super.invoke("findProductList", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现定义在{@link cn.org.atool.fluent.mybatis.base.IRefs}子类Refs上
|
||||
*/
|
||||
@RefMethod("parentId = id")
|
||||
public List<ProductCategory> findProductCategoryList() {
|
||||
return super.invoke("findProductCategoryList", true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现定义在{@link cn.org.atool.fluent.mybatis.base.IRefs}子类Refs上
|
||||
*/
|
||||
@RefMethod("id = parentId")
|
||||
public ProductCategory findProductCategory() {
|
||||
return super.invoke("findProductCategory", true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.ruoyi.common.core.domain.entity.test.entity;
|
||||
|
||||
import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
|
||||
import cn.org.atool.fluent.mybatis.annotation.TableField;
|
||||
import cn.org.atool.fluent.mybatis.base.IEntity;
|
||||
import cn.org.atool.fluent.mybatis.base.RichEntity;
|
||||
import cn.org.atool.fluent.mybatis.functions.TableSupplier;
|
||||
|
||||
import java.lang.Class;
|
||||
import java.lang.Long;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.lang.SuppressWarnings;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* ProductCategoryRelation: 数据映射实体定义
|
||||
*
|
||||
* @author Powered By Fluent Mybatis
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@FluentMybatis(table = "product_category_relation", schema = "ruoyi", suffix = "")
|
||||
public class ProductCategoryRelation extends RichEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品分类主键
|
||||
*/
|
||||
@TableField("product_category_id")
|
||||
private Long productCategoryId;
|
||||
|
||||
/**
|
||||
* 商品主键
|
||||
*/
|
||||
@TableField("product_id")
|
||||
private Long productId;
|
||||
|
||||
@Override
|
||||
public final Class<? extends IEntity> entityClass() {
|
||||
return ProductCategoryRelation.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ProductCategoryRelation changeTableBelongTo(TableSupplier supplier) {
|
||||
return super.changeTableBelongTo(supplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ProductCategoryRelation changeTableBelongTo(String table) {
|
||||
return super.changeTableBelongTo(table);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.ruoyi.common;
|
||||
|
||||
import cn.org.atool.generator.FileGenerator;
|
||||
import cn.org.atool.generator.annotation.Relation;
|
||||
import cn.org.atool.generator.annotation.RelationType;
|
||||
import cn.org.atool.generator.annotation.Table;
|
||||
import cn.org.atool.generator.annotation.Tables;
|
||||
import cn.org.atool.generator.database.model.ConfigKey;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* 代码生成测试
|
||||
* @author Geniou
|
||||
* @create 2021/9/9 12:17
|
||||
*/
|
||||
@Slf4j
|
||||
public class GeneratorTest {
|
||||
|
||||
static final String url =
|
||||
"jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true";
|
||||
static final String basePackage = "com.ruoyi.common.core.domain.entity.test";
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
FileGenerator.build(RelationMTM.class);
|
||||
}
|
||||
|
||||
@Tables(
|
||||
url = url, username = "root", password = "123456",
|
||||
basePack = basePackage,
|
||||
srcDir = "src/main/java/com/ruoyi/common/core/domain/entity/test",
|
||||
tables = @Table(value = {"product_category", "product", "product_category_relation"})
|
||||
)
|
||||
static class Noting{}
|
||||
|
||||
@Tables(
|
||||
url = url, username = "root", password = "123456",
|
||||
basePack = basePackage,
|
||||
srcDir = "src\\main\\java\\",
|
||||
tables = {@Table(value = {"product", "product_category", "product_category_relation"})},
|
||||
relations = {
|
||||
@Relation(source = "product", target = "product_category", type = RelationType.TwoWay_N_N),
|
||||
@Relation(source = "product_category", target = "product_category", type = RelationType.TwoWay_1_N,
|
||||
where = "id = parent_id")
|
||||
},
|
||||
entitySuffix = ""
|
||||
)
|
||||
static class RelationMTM{}
|
||||
|
||||
}
|
|
@ -1,13 +1,17 @@
|
|||
package com.ruoyi.demo.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.mapper.ProductMapper;
|
||||
import com.ruoyi.common.core.domain.entity.test.Product;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.test.entity.Product;
|
||||
import com.ruoyi.common.core.domain.entity.test.entity.ProductCategory;
|
||||
import com.ruoyi.common.core.domain.entity.test.mapper.ProductMapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -23,17 +27,19 @@ import java.util.Date;
|
|||
@Api(value = "商品测试控制方法", tags = {"商品测试控制方法"})
|
||||
@RestController
|
||||
@RequestMapping("/demo/product")
|
||||
public class ProductTestController {
|
||||
public class ProductTestController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询测试树表列表
|
||||
* 测试插入
|
||||
*/
|
||||
@ApiOperation("测试语句")
|
||||
@GetMapping("/mapperTest")
|
||||
public void list() {
|
||||
@ApiOperation("测试插入商品")
|
||||
@PostMapping("/insertProduct")
|
||||
public void insertProduct() {
|
||||
Product product = new Product();
|
||||
product.setProductCode("M10001");
|
||||
product.setProductName("测试商品");
|
||||
|
@ -42,7 +48,87 @@ public class ProductTestController {
|
|||
product.setCreateDateTime(new Date());
|
||||
product.setUpdateDateTime(new Date());
|
||||
productMapper.insert(product);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试插入
|
||||
*/
|
||||
@ApiOperation("测试插入商品分类")
|
||||
@PostMapping("/insertProductCategory")
|
||||
public void insertProductCategory() {
|
||||
ProductCategory productCategory = new ProductCategory();
|
||||
productCategory.setCategoryName("一年级");
|
||||
productCategory.setCategoryType("Title");
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 测试查询
|
||||
// */
|
||||
// @ApiOperation("测试查询")
|
||||
// @GetMapping("/queryTest")
|
||||
// public AjaxResult<Product> query(@Validated Product bo) {
|
||||
// Product product = productMapper.findById(bo.getId());
|
||||
// return new AjaxResult<Product>().setData(product);
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 测试查询2(根据实体类字段)
|
||||
// */
|
||||
// @ApiOperation("测试查询2")
|
||||
// @GetMapping("/query2Test")
|
||||
// public AjaxResult<List<Product>> query2(@Validated Product bo) {
|
||||
// ProductQuery productQuery = productMapper.query().where.eqByEntity(bo).end();
|
||||
// List<Product> products = productMapper.listEntity(productQuery);
|
||||
// log.info("query2 rows = {}", CollUtil.size(products));
|
||||
// return new AjaxResult<List<Product>>().setData(products);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试删除
|
||||
// */
|
||||
// @ApiOperation("测试删除")
|
||||
// @DeleteMapping("/deleteTest")
|
||||
// public AjaxResult<Void> delete(@Validated Product bo) {
|
||||
// return toAjax(productMapper.deleteById(bo.getId()));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 测试删除2
|
||||
// */
|
||||
// @ApiOperation("测试删除2(根据相关参数)")
|
||||
// @DeleteMapping("/delete2Test")
|
||||
// public AjaxResult<Void> delete2(@Validated Product bo) {
|
||||
// ProductQuery productQuery = productMapper.query().where.eqByEntity(bo).end();
|
||||
// List<Product> products = productMapper.listEntity(productQuery);
|
||||
// int row = productMapper.delete(productQuery);
|
||||
// return toAjax(row);
|
||||
// }
|
||||
//
|
||||
// static final String url =
|
||||
// "jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true";
|
||||
// static final String basePackage = "com.ruoyi.common.core.domain.entity.test";
|
||||
|
||||
// /**
|
||||
// * 测试删除2
|
||||
// */
|
||||
// @ApiOperation("生成测试")
|
||||
// @DeleteMapping("/generatorTest")
|
||||
// public AjaxResult<Void> generatorTest() {
|
||||
// FileGenerator.build(Noting.class);
|
||||
// return toAjax(true);
|
||||
// }
|
||||
//
|
||||
// @Tables(
|
||||
// url = url, username = "root", password = "123456",
|
||||
// basePack = basePackage,
|
||||
// srcDir = "src/main/java/com/ruoyi/common/core/domain/entity/test",
|
||||
// tables = @Table(value = {"product_category", "product", "product_category_relation"})
|
||||
// )
|
||||
// static class Noting{}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<?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"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-mall</artifactId>
|
||||
|
||||
</project>
|
Loading…
Reference in New Issue