代码生成器更改
parent
9403635b1d
commit
6a68227f67
|
@ -3,6 +3,11 @@ package com.ruoyi.generator.domain;
|
||||||
import com.ruoyi.common.constant.GenConstants;
|
import com.ruoyi.common.constant.GenConstants;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
@ -14,6 +19,11 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class GenTable extends BaseEntity {
|
public class GenTable extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -141,6 +151,11 @@ public class GenTable extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String parentMenuName;
|
private String parentMenuName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
public static boolean isSub (String tplCategory) {
|
public static boolean isSub (String tplCategory) {
|
||||||
return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory);
|
return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory);
|
||||||
}
|
}
|
||||||
|
@ -161,190 +176,6 @@ public class GenTable extends BaseEntity {
|
||||||
return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
|
return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getTableId () {
|
|
||||||
return tableId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTableId (Long tableId) {
|
|
||||||
this.tableId = tableId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTableName () {
|
|
||||||
return tableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTableName (String tableName) {
|
|
||||||
this.tableName = tableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTableComment () {
|
|
||||||
return tableComment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTableComment (String tableComment) {
|
|
||||||
this.tableComment = tableComment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSubTableName () {
|
|
||||||
return subTableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubTableName (String subTableName) {
|
|
||||||
this.subTableName = subTableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSubTableFkName () {
|
|
||||||
return subTableFkName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubTableFkName (String subTableFkName) {
|
|
||||||
this.subTableFkName = subTableFkName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName () {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassName (String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTplCategory () {
|
|
||||||
return tplCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTplCategory (String tplCategory) {
|
|
||||||
this.tplCategory = tplCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPackageName () {
|
|
||||||
return packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageName (String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getModuleName () {
|
|
||||||
return moduleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModuleName (String moduleName) {
|
|
||||||
this.moduleName = moduleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBusinessName () {
|
|
||||||
return businessName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBusinessName (String businessName) {
|
|
||||||
this.businessName = businessName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFunctionName () {
|
|
||||||
return functionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFunctionName (String functionName) {
|
|
||||||
this.functionName = functionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFunctionAuthor () {
|
|
||||||
return functionAuthor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFunctionAuthor (String functionAuthor) {
|
|
||||||
this.functionAuthor = functionAuthor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGenType () {
|
|
||||||
return genType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenType (String genType) {
|
|
||||||
this.genType = genType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGenPath () {
|
|
||||||
return genPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenPath (String genPath) {
|
|
||||||
this.genPath = genPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GenTableColumn getPkColumn () {
|
|
||||||
return pkColumn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPkColumn (GenTableColumn pkColumn) {
|
|
||||||
this.pkColumn = pkColumn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GenTable getSubTable () {
|
|
||||||
return subTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubTable (GenTable subTable) {
|
|
||||||
this.subTable = subTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<GenTableColumn> getColumns () {
|
|
||||||
return columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setColumns (List<GenTableColumn> columns) {
|
|
||||||
this.columns = columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOptions () {
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOptions (String options) {
|
|
||||||
this.options = options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTreeCode () {
|
|
||||||
return treeCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTreeCode (String treeCode) {
|
|
||||||
this.treeCode = treeCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTreeParentCode () {
|
|
||||||
return treeParentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTreeParentCode (String treeParentCode) {
|
|
||||||
this.treeParentCode = treeParentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTreeName () {
|
|
||||||
return treeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTreeName (String treeName) {
|
|
||||||
this.treeName = treeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentMenuId () {
|
|
||||||
return parentMenuId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentMenuId (String parentMenuId) {
|
|
||||||
this.parentMenuId = parentMenuId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentMenuName () {
|
|
||||||
return parentMenuName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentMenuName (String parentMenuName) {
|
|
||||||
this.parentMenuName = parentMenuName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSub () {
|
public boolean isSub () {
|
||||||
return isSub(this.tplCategory);
|
return isSub(this.tplCategory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,10 +127,13 @@ public class VelocityUtils {
|
||||||
public static List<String> getTemplateList (String tplCategory) {
|
public static List<String> getTemplateList (String tplCategory) {
|
||||||
List<String> templates = new ArrayList<String>();
|
List<String> templates = new ArrayList<String>();
|
||||||
templates.add("vm/java/domain.java.vm");
|
templates.add("vm/java/domain.java.vm");
|
||||||
templates.add("vm/java/mapper.java.vm");
|
templates.add("vm/java/query.java.vm");
|
||||||
|
templates.add("vm/java/save.java.vm");
|
||||||
|
templates.add("vm/java/edit.java.vm");
|
||||||
|
templates.add("vm/java/controller.java.vm");
|
||||||
templates.add("vm/java/service.java.vm");
|
templates.add("vm/java/service.java.vm");
|
||||||
templates.add("vm/java/serviceImpl.java.vm");
|
templates.add("vm/java/serviceImpl.java.vm");
|
||||||
templates.add("vm/java/controller.java.vm");
|
templates.add("vm/java/mapper.java.vm");
|
||||||
templates.add("vm/xml/mapper.xml.vm");
|
templates.add("vm/xml/mapper.xml.vm");
|
||||||
templates.add("vm/sql/sql.vm");
|
templates.add("vm/sql/sql.vm");
|
||||||
templates.add("vm/js/api.js.vm");
|
templates.add("vm/js/api.js.vm");
|
||||||
|
@ -167,6 +170,15 @@ public class VelocityUtils {
|
||||||
if (template.contains("domain.java.vm")) {
|
if (template.contains("domain.java.vm")) {
|
||||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
|
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
|
||||||
}
|
}
|
||||||
|
if (template.contains("query.java.vm")) {
|
||||||
|
fileName = StringUtils.format("{}/domain/req/{}QueryReq.java", javaPath, className);
|
||||||
|
}
|
||||||
|
if (template.contains("save.java.vm")) {
|
||||||
|
fileName = StringUtils.format("{}/domain/req/{}SaveReq.java", javaPath, className);
|
||||||
|
}
|
||||||
|
if (template.contains("edit.java.vm")) {
|
||||||
|
fileName = StringUtils.format("{}/domain/req/{}EditReq.java", javaPath, className);
|
||||||
|
}
|
||||||
if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) {
|
if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) {
|
||||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName());
|
fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName());
|
||||||
} else if (template.contains("mapper.java.vm")) {
|
} else if (template.contains("mapper.java.vm")) {
|
||||||
|
|
|
@ -19,6 +19,9 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.Result;
|
import com.ruoyi.common.core.domain.Result;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
|
import ${packageName}.domain.req.${ClassName}QueryReq;
|
||||||
|
import ${packageName}.domain.req.${ClassName}SaveReq;
|
||||||
|
import ${packageName}.domain.req.${ClassName}EditReq;
|
||||||
import ${packageName}.service.${ClassName}Service;
|
import ${packageName}.service.${ClassName}Service;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
|
@ -46,9 +49,9 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
public Result<TableDataInfo> list(${ClassName} ${className}) {
|
public Result<TableDataInfo> list(${ClassName}QueryReq ${className}QueryReq) {
|
||||||
startPage();
|
startPage();
|
||||||
List<${ClassName}> list = ${className}Service.list(${className});
|
List<${ClassName}> list = ${className}Service.list(${ClassName}.queryBuild(${className}QueryReq));
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
|
@ -89,8 +92,8 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation("新增${functionName}")
|
@ApiOperation("新增${functionName}")
|
||||||
public Result add(@RequestBody ${ClassName} ${className}) {
|
public Result add(@RequestBody ${ClassName}SaveReq ${className}SaveReq) {
|
||||||
return toAjax(${className}Service.save(${className}));
|
return toAjax(${className}Service.save(${ClassName}.saveBuild(${className}SaveReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,10 +101,10 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping("/{${pkColumn.javaField}}")
|
||||||
@ApiOperation("修改${functionName}")
|
@ApiOperation("修改${functionName}")
|
||||||
public Result edit(@RequestBody ${ClassName} ${className}) {
|
public Result edit(@PathVariable ${pkColumn.javaType} ${pkColumn.javaField}, @RequestBody ${ClassName}EditReq ${className}EditReq) {
|
||||||
return toAjax(${className}Service.updateById(${className}));
|
return toAjax(${className}Service.updateById(${ClassName}.editBuild(${pkColumn.javaField},${className}EditReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,6 +3,7 @@ package ${packageName}.domain;
|
||||||
#foreach ($import in $importList)
|
#foreach ($import in $importList)
|
||||||
import ${import};
|
import ${import};
|
||||||
#end
|
#end
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -12,6 +13,9 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import ${packageName}.domain.req.${ClassName}QueryReq;
|
||||||
|
import ${packageName}.domain.req.${ClassName}SaveReq;
|
||||||
|
import ${packageName}.domain.req.${ClassName}EditReq;
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
|
@ -60,7 +64,7 @@ public class ${ClassName} extends ${Entity} {
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($column.javaField == $pkColumn.javaField)
|
#if($column.javaField == $pkColumn.javaField)
|
||||||
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
|
@TableId(value = "${pkColumn.columnName}",type = IdType.AUTO)
|
||||||
#end
|
#end
|
||||||
#set($comment='')
|
#set($comment='')
|
||||||
#if($column.isRequired == '1')
|
#if($column.isRequired == '1')
|
||||||
|
@ -71,4 +75,65 @@ public class ${ClassName} extends ${Entity} {
|
||||||
|
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
/**
|
||||||
|
* 查询构造器
|
||||||
|
*/
|
||||||
|
public static ${ClassName} queryBuild(${pkColumn.javaType} ${pkColumn.javaField}, ${ClassName}QueryReq ${className}QueryReq){
|
||||||
|
return ${ClassName}.builder()
|
||||||
|
.${pkColumn.javaField}(${pkColumn.javaField})
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.isQuery == '1')
|
||||||
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
||||||
|
#set($AttrName=$column.javaField)
|
||||||
|
#else
|
||||||
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
|
#end
|
||||||
|
.${column.javaField}(${className}QueryReq.get${AttrName}())
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加构造器
|
||||||
|
*/
|
||||||
|
public static ${ClassName} saveBuild(${ClassName}SaveReq ${className}SaveReq){
|
||||||
|
return ${ClassName}.builder()
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.isEdit == '1')
|
||||||
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
||||||
|
#set($AttrName=$column.javaField)
|
||||||
|
#else
|
||||||
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
|
#end
|
||||||
|
.${column.javaField}(${className}SaveReq.get${AttrName}())
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
|
public static ${ClassName} editBuild(${ClassName}EditReq ${className}EditReq){
|
||||||
|
return ${ClassName}.builder()
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.isInsert == '1')
|
||||||
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
||||||
|
#set($AttrName=$column.javaField)
|
||||||
|
#else
|
||||||
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
|
#end
|
||||||
|
.${column.javaField}(${className}EditReq.get${AttrName}())
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package ${packageName}.domain.req;
|
||||||
|
|
||||||
|
#foreach ($import in $importList)
|
||||||
|
import ${import};
|
||||||
|
#end
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
#if($table.crud || $table.sub)
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
#elseif($table.tree)
|
||||||
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
|
#end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ${functionName}对象 ${tableName}
|
||||||
|
*
|
||||||
|
* @author ${author}
|
||||||
|
* @date ${datetime}
|
||||||
|
*/
|
||||||
|
#if($table.crud || $table.sub)
|
||||||
|
#set($Entity="BaseEntity")
|
||||||
|
#elseif($table.tree)
|
||||||
|
#set($Entity="TreeEntity")
|
||||||
|
#end
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "${ClassName}EditReq", description = "${functionName}")
|
||||||
|
public class ${ClassName}EditReq extends ${Entity} {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
#if($column.isEdit == '1')
|
||||||
|
/** $column.columnComment */
|
||||||
|
#if($column.list)
|
||||||
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||||
|
#else
|
||||||
|
#set($comment=$column.columnComment)
|
||||||
|
#end
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
#elseif($column.javaType == 'Date')
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
#else
|
||||||
|
@Excel(name = "${comment}")
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($column.javaField == $pkColumn.javaField)
|
||||||
|
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
|
||||||
|
#end
|
||||||
|
#set($isRequired='')
|
||||||
|
#if($column.isRequired == '1')
|
||||||
|
#set($isRequired=', required = true')
|
||||||
|
#end
|
||||||
|
@ApiModelProperty(name = "${column.columnComment}", value = "${column.columnComment}"$isRequired)
|
||||||
|
private $column.javaType $column.javaField;
|
||||||
|
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package ${packageName}.domain.req;
|
||||||
|
|
||||||
|
#foreach ($import in $importList)
|
||||||
|
import ${import};
|
||||||
|
#end
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
#if($table.crud || $table.sub)
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
#elseif($table.tree)
|
||||||
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
|
#end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ${functionName}对象 ${tableName}
|
||||||
|
*
|
||||||
|
* @author ${author}
|
||||||
|
* @date ${datetime}
|
||||||
|
*/
|
||||||
|
#if($table.crud || $table.sub)
|
||||||
|
#set($Entity="BaseEntity")
|
||||||
|
#elseif($table.tree)
|
||||||
|
#set($Entity="TreeEntity")
|
||||||
|
#end
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "${ClassName}QueryReq", description = "${functionName}")
|
||||||
|
public class ${ClassName}QueryReq extends ${Entity} {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
#if($column.isQuery == '1')
|
||||||
|
/** $column.columnComment */
|
||||||
|
#if($column.list)
|
||||||
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||||
|
#else
|
||||||
|
#set($comment=$column.columnComment)
|
||||||
|
#end
|
||||||
|
#if($column.javaType == 'Date')
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($column.javaField == $pkColumn.javaField)
|
||||||
|
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
|
||||||
|
#end
|
||||||
|
@ApiModelProperty(name = "${column.columnComment}", value = "${column.columnComment}")
|
||||||
|
private $column.javaType $column.javaField;
|
||||||
|
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package ${packageName}.domain.req;
|
||||||
|
|
||||||
|
#foreach ($import in $importList)
|
||||||
|
import ${import};
|
||||||
|
#end
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
#if($table.crud || $table.sub)
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
#elseif($table.tree)
|
||||||
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
|
#end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ${functionName}对象 ${tableName}
|
||||||
|
*
|
||||||
|
* @author ${author}
|
||||||
|
* @date ${datetime}
|
||||||
|
*/
|
||||||
|
#if($table.crud || $table.sub)
|
||||||
|
#set($Entity="BaseEntity")
|
||||||
|
#elseif($table.tree)
|
||||||
|
#set($Entity="TreeEntity")
|
||||||
|
#end
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "${ClassName}SaveReq", description = "${functionName}")
|
||||||
|
public class ${ClassName}SaveReq extends ${Entity} {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
#if($column.isInsert == '1')
|
||||||
|
/** $column.columnComment */
|
||||||
|
#if($column.list)
|
||||||
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||||
|
#else
|
||||||
|
#set($comment=$column.columnComment)
|
||||||
|
#end
|
||||||
|
#if($parentheseIndex != -1)
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
#elseif($column.javaType == 'Date')
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
#else
|
||||||
|
@Excel(name = "${comment}")
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($column.javaField == $pkColumn.javaField)
|
||||||
|
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
|
||||||
|
#end
|
||||||
|
#set($isRequired='')
|
||||||
|
#if($column.isRequired == '1')
|
||||||
|
#set($isRequired=', required = true')
|
||||||
|
#end
|
||||||
|
@ApiModelProperty(name = "${column.columnComment}", value = "${column.columnComment}"$isRequired)
|
||||||
|
private $column.javaType $column.javaField;
|
||||||
|
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
|
@ -29,7 +29,7 @@ export function add${BusinessName}(data) {
|
||||||
// 修改${functionName}
|
// 修改${functionName}
|
||||||
export function update${BusinessName}(data) {
|
export function update${BusinessName}(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/${moduleName}/${businessName}',
|
url: '/${moduleName}/${businessName}/'+data.${pkColumn.javaField},
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,6 +19,9 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.Result;
|
import com.ruoyi.common.core.domain.Result;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.book.domain.BookInfo;
|
import com.ruoyi.book.domain.BookInfo;
|
||||||
|
import com.ruoyi.book.domain.req.BookInfoQueryReq;
|
||||||
|
import com.ruoyi.book.domain.req.BookInfoSaveReq;
|
||||||
|
import com.ruoyi.book.domain.req.BookInfoEditReq;
|
||||||
import com.ruoyi.book.service.BookInfoService;
|
import com.ruoyi.book.service.BookInfoService;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
@ -27,7 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
* 书籍信息Controller
|
* 书籍信息Controller
|
||||||
*
|
*
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2023-10-10
|
* @date 2023-10-11
|
||||||
*/
|
*/
|
||||||
@Api("书籍信息")
|
@Api("书籍信息")
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -42,9 +45,9 @@ public class BookInfoController extends BaseController {
|
||||||
@ApiOperation("获取书籍信息列表")
|
@ApiOperation("获取书籍信息列表")
|
||||||
@PreAuthorize("@ss.hasPermi('book:info:list')")
|
@PreAuthorize("@ss.hasPermi('book:info:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo> list(BookInfo bookInfo) {
|
public Result<TableDataInfo> list(BookInfoQueryReq bookInfoQueryReq) {
|
||||||
startPage();
|
startPage();
|
||||||
List<BookInfo> list = bookInfoService.list(bookInfo);
|
List<BookInfo> list = bookInfoService.list(BookInfo.queryBuild(bookInfoQueryReq));
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,8 +82,8 @@ public class BookInfoController extends BaseController {
|
||||||
@Log(title = "书籍信息", businessType = BusinessType.INSERT)
|
@Log(title = "书籍信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation("新增书籍信息")
|
@ApiOperation("新增书籍信息")
|
||||||
public Result add(@RequestBody BookInfo bookInfo) {
|
public Result add(@RequestBody BookInfoSaveReq bookInfoSaveReq) {
|
||||||
return toAjax(bookInfoService.save(bookInfo));
|
return toAjax(bookInfoService.save(BookInfo.saveBuild(bookInfoSaveReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,8 +93,8 @@ public class BookInfoController extends BaseController {
|
||||||
@Log(title = "书籍信息", businessType = BusinessType.UPDATE)
|
@Log(title = "书籍信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@ApiOperation("修改书籍信息")
|
@ApiOperation("修改书籍信息")
|
||||||
public Result edit(@RequestBody BookInfo bookInfo) {
|
public Result edit(@RequestBody BookInfoEditReq bookInfoEditReq) {
|
||||||
return toAjax(bookInfoService.updateById(bookInfo));
|
return toAjax(bookInfoService.updateById(BookInfo.editBuild(bookInfoEditReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +102,7 @@ public class BookInfoController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('book:info:remove')")
|
@PreAuthorize("@ss.hasPermi('book:info:remove')")
|
||||||
@Log(title = "书籍信息", businessType = BusinessType.DELETE)
|
@Log(title = "书籍信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@ApiOperation("删除书籍信息")
|
@ApiOperation("删除书籍信息")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||||
public Result remove(@PathVariable List<Long> ids) {
|
public Result remove(@PathVariable List<Long> ids) {
|
||||||
|
|
|
@ -12,13 +12,16 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.book.domain.req.BookInfoQueryReq;
|
||||||
|
import com.ruoyi.book.domain.req.BookInfoSaveReq;
|
||||||
|
import com.ruoyi.book.domain.req.BookInfoEditReq;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍信息对象 book_info
|
* 书籍信息对象 book_info
|
||||||
*
|
*
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2023-10-10
|
* @date 2023-10-11
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -43,7 +46,29 @@ public class BookInfo extends BaseEntity {
|
||||||
|
|
||||||
/** 价格 */
|
/** 价格 */
|
||||||
@Excel(name = "价格")
|
@Excel(name = "价格")
|
||||||
@ApiModelProperty(name = "价格", value = "价格")
|
@ApiModelProperty(name = "价格", value = "价格", required = true)
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
|
|
||||||
|
public static BookInfo queryBuild(BookInfoQueryReq bookInfoQueryReq){
|
||||||
|
return BookInfo.builder()
|
||||||
|
.name(bookInfoQueryReq.getName())
|
||||||
|
.price(bookInfoQueryReq.getPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BookInfo saveBuild(BookInfoSaveReq bookInfoSaveReq){
|
||||||
|
return BookInfo.builder()
|
||||||
|
.name(bookInfoSaveReq.getName())
|
||||||
|
.price(bookInfoSaveReq.getPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BookInfo editBuild(BookInfoEditReq bookInfoEditReq){
|
||||||
|
return BookInfo.builder()
|
||||||
|
.name(bookInfoEditReq.getName())
|
||||||
|
.price(bookInfoEditReq.getPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ruoyi.book.domain.req;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书籍信息对象 book_info
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2023-10-11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "BookInfoEditReq", description = "书籍信息")
|
||||||
|
public class BookInfoEditReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
@Excel(name = "名称")
|
||||||
|
@ApiModelProperty(name = "名称", value = "名称", required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 价格 */
|
||||||
|
@Excel(name = "价格")
|
||||||
|
@ApiModelProperty(name = "价格", value = "价格", required = true)
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ruoyi.book.domain.req;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书籍信息对象 book_info
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2023-10-11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "BookInfoQueryReq", description = "书籍信息")
|
||||||
|
public class BookInfoQueryReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
@Excel(name = "名称")
|
||||||
|
@ApiModelProperty(name = "名称", value = "名称", required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 价格 */
|
||||||
|
@Excel(name = "价格")
|
||||||
|
@ApiModelProperty(name = "价格", value = "价格", required = true)
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ruoyi.book.domain.req;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书籍信息对象 book_info
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2023-10-11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "BookInfoSaveReq", description = "书籍信息")
|
||||||
|
public class BookInfoSaveReq extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
@Excel(name = "名称")
|
||||||
|
@ApiModelProperty(name = "名称", value = "名称", required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 价格 */
|
||||||
|
@Excel(name = "价格")
|
||||||
|
@ApiModelProperty(name = "价格", value = "价格", required = true)
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ruoyi.book.service;
|
package com.ruoyi.book.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.book.domain.BookInfo;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.book.domain.BookInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍信息Service接口
|
* 书籍信息Service接口
|
||||||
|
|
|
@ -2,10 +2,10 @@ package com.ruoyi.book.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.book.domain.BookInfo;
|
||||||
import com.ruoyi.common.utils.ObjUtils;
|
import com.ruoyi.common.utils.ObjUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.book.mapper.BookInfoMapper;
|
import com.ruoyi.book.mapper.BookInfoMapper;
|
||||||
import com.ruoyi.book.domain.BookInfo;
|
|
||||||
import com.ruoyi.book.service.BookInfoService;
|
import com.ruoyi.book.service.BookInfoService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
package com.ruoyi.system.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongZl
|
|
||||||
* @description: 书籍信息
|
|
||||||
* @Date 2023-10-7 上午 09:29
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@TableName("book_info")
|
|
||||||
public class BookInfo {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 价格
|
|
||||||
*/
|
|
||||||
private BigDecimal price;
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String create_by;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date create_time;
|
|
||||||
}
|
|
Loading…
Reference in New Issue