1. 支持common-mapper

2. 修复entity和plusentity的swagger引包错误
This commit is contained in:
CHENTIANMING002
2021-08-05 11:04:01 +08:00
parent 3007dbac2e
commit 18d79cf314
8 changed files with 91 additions and 4 deletions

View File

@@ -0,0 +1,50 @@
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.entity;</#if>
<#if isAutoImport?exists && isAutoImport==true>
<#if isLombok?exists && isLombok==true>import lombok.Data;</#if>
import java.util.Date;
import java.util.List;
import java.io.Serializable;
import javax.persistence.*;
<#if isSwagger?exists && isSwagger==true>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;</#if>
</#if>
/**
* @description ${classInfo.classComment}
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd')}
*/
<#if isLombok?exists && isLombok==true>@Data</#if>
<#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")</#if><#if isSwagger?exists && isSwagger==true>
@ApiModel("${classInfo.classComment}")</#if>
public class ${classInfo.className} implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
<#list classInfo.fieldList as fieldItem >
<#if isComment?exists && isComment==true>/**
* ${fieldItem.fieldComment}
*/</#if><#if isSwagger?exists && isSwagger==true>
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
</#list>
public ${classInfo.className}() {
}
</#if>
<#if isLombok?exists && isLombok==false>
public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
return ${fieldItem.fieldName};
}
public void set${fieldItem.fieldName?cap_first}(${fieldItem.fieldClass} ${fieldItem.fieldName}) {
this.${fieldItem.fieldName} = ${fieldItem.fieldName};
}
</#if>
}

View File

@@ -0,0 +1,16 @@
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.mapper;</#if>
<#if isAutoImport?exists && isAutoImport==true>
import tk.mybatis.mapper.common.Mapper;
import org.apache.ibatis.annotations.Mapper;
import ${packageName}.entity.${classInfo.className};
</#if>
/**
* @description ${classInfo.classComment}Mapper
* @author ${authorName}
* @date ${.now?string('yyyy-MM-dd')}
*/
@Mapper
public interface ${classInfo.className}Mapper extends Mapper<${classInfo.className}> {
}

View File

@@ -10,8 +10,9 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
<#if isSwagger?exists && isSwagger==true>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;</#if>
</#if>
/**
* @description ${classInfo.classComment}

View File

@@ -7,6 +7,9 @@ import java.util.List;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
<#if isSwagger?exists && isSwagger==true>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;</#if>
</#if>
/**
* @description ${classInfo.classComment}