mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2025-12-25 21:36:47 +08:00
ApiModel-》Schema
This commit is contained in:
parent
1095661355
commit
dff15bcc6d
@ -10,7 +10,7 @@ import java.util.List;
|
||||
* @date ${.now?string('yyyy-MM-dd')}
|
||||
*/
|
||||
@Data<#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModel("${classInfo.classComment}")</#if>
|
||||
@Schema"${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -20,7 +20,7 @@ public class ${classInfo.className} implements Serializable {
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Schema(description = "${fieldItem.fieldComment}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
</#list>
|
||||
|
||||
@ -7,8 +7,7 @@ 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>
|
||||
import io.swagger.v3.oas.annotations.media.Schema;</#if>
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
|
||||
*/
|
||||
<#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>
|
||||
@Schema"${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -29,7 +28,7 @@ public class ${classInfo.className} implements Serializable {
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Schema(description = "${fieldItem.fieldComment}")</#if>
|
||||
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
|
||||
@ -11,8 +11,7 @@ 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;</#if>
|
||||
import io.swagger.v3.oas.annotations.media.Schema;</#if>
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
@ -24,13 +23,13 @@ import io.swagger.annotations.ApiModelProperty;</#if>
|
||||
@AllArgsConstructor
|
||||
<#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>
|
||||
@Schema"${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@ApiModelProperty("id")
|
||||
@Schema(description = "id")
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
|
||||
@ -39,7 +38,7 @@ public class ${classInfo.className} implements Serializable {
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Schema(description = "${fieldItem.fieldComment}")</#if>
|
||||
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
|
||||
@ -11,8 +11,7 @@ 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;</#if>
|
||||
import io.swagger.v3.oas.annotations.media.Schema;</#if>
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
@ -22,7 +21,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
|
||||
@Entity
|
||||
<#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>
|
||||
@Schema"${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -34,7 +33,7 @@ public class ${classInfo.className} implements Serializable {
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Schema(description = "${fieldItem.fieldComment}")</#if>
|
||||
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
<#if isSwagger?exists && isSwagger==true>import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;</#if>
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -25,6 +26,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/${classInfo.className?uncap_first}")
|
||||
<#if isSwagger?exists && isSwagger==true>@Tag(name = "${classInfo.className}",description = "${classInfo.classComment}控制器")</#if>
|
||||
public class ${classInfo.className}Controller {
|
||||
|
||||
@Autowired
|
||||
|
||||
@ -8,8 +8,7 @@ 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>
|
||||
import io.swagger.v3.oas.annotations.media.Schema;</#if>
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
|
||||
* @date ${.now?string('yyyy-MM-dd')}
|
||||
*/
|
||||
<#if isLombok?exists && isLombok==true>@Data</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModel("${classInfo.classComment}")</#if>
|
||||
@Schema"${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -28,7 +27,7 @@ public class ${classInfo.className} implements Serializable {
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Schema(description = "${fieldItem.fieldComment}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
<#if isLombok?exists && isLombok==false>
|
||||
|
||||
@ -7,8 +7,7 @@ import java.util.List;
|
||||
import java.io.Serializable;
|
||||
import io.mybatis.provider.Entity;
|
||||
<#if isSwagger?exists && isSwagger==true>
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;</#if>
|
||||
import io.swagger.v3.oas.annotations.media.Schema;</#if>
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
|
||||
*/
|
||||
<#if isLombok?exists && isLombok==true>@Data</#if>
|
||||
<#if isComment?exists && isComment==true>@Entity.Table("${classInfo.originTableName}")</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModel("${classInfo.classComment}")</#if>
|
||||
@Schema"${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -28,7 +27,7 @@ public class ${classInfo.className} implements Serializable {
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Schema(description = "${fieldItem.fieldComment}")</#if>
|
||||
<#if isComment?exists && isComment==true>@Entity.Column("${fieldItem.columnName}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user