Skip to content

Commit dff15bc

Browse files
committed
ApiModel-》Schema
1 parent 1095661 commit dff15bc

File tree

7 files changed

+21
-24
lines changed

7 files changed

+21
-24
lines changed

generator-web/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.util.List;
1010
* @date ${.now?string('yyyy-MM-dd')}
1111
*/
1212
@Data<#if isSwagger?exists && isSwagger==true>
13-
@ApiModel("${classInfo.classComment}")</#if>
13+
@Schema"${classInfo.classComment}")</#if>
1414
public class ${classInfo.className} implements Serializable {
1515

1616
private static final long serialVersionUID = 1L;
@@ -20,7 +20,7 @@ public class ${classInfo.className} implements Serializable {
2020
<#if isComment?exists && isComment==true>/**
2121
* ${fieldItem.fieldComment}
2222
*/</#if><#if isSwagger?exists && isSwagger==true>
23-
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
23+
@Schema(description = "${fieldItem.fieldComment}")</#if>
2424
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
2525

2626
</#list>

generator-web/src/main/resources/templates/code-generator/common-mapper/tkentity.ftl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import java.util.List;
77
import java.io.Serializable;
88
import javax.persistence.*;
99
<#if isSwagger?exists && isSwagger==true>
10-
import io.swagger.annotations.ApiModel;
11-
import io.swagger.annotations.ApiModelProperty;</#if>
10+
import io.swagger.v3.oas.annotations.media.Schema;</#if>
1211
</#if>
1312
/**
1413
* @description ${classInfo.classComment}
@@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
1716
*/
1817
<#if isLombok?exists && isLombok==true>@Data</#if>
1918
<#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")</#if><#if isSwagger?exists && isSwagger==true>
20-
@ApiModel("${classInfo.classComment}")</#if>
19+
@Schema"${classInfo.classComment}")</#if>
2120
public class ${classInfo.className} implements Serializable {
2221

2322
private static final long serialVersionUID = 1L;
@@ -29,7 +28,7 @@ public class ${classInfo.className} implements Serializable {
2928
<#if isComment?exists && isComment==true>/**
3029
* ${fieldItem.fieldComment}
3130
*/</#if><#if isSwagger?exists && isSwagger==true>
32-
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
31+
@Schema(description = "${fieldItem.fieldComment}")</#if>
3332
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
3433
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
3534

generator-web/src/main/resources/templates/code-generator/jpa-starp/starp-entity.ftl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import javax.persistence.Id;
1111
import javax.persistence.Table;
1212
import javax.persistence.GeneratedValue;
1313
<#if isSwagger?exists && isSwagger==true>
14-
import io.swagger.annotations.ApiModel;
15-
import io.swagger.annotations.ApiModelProperty;</#if>
14+
import io.swagger.v3.oas.annotations.media.Schema;</#if>
1615
</#if>
1716
/**
1817
* @description ${classInfo.classComment}
@@ -24,13 +23,13 @@ import io.swagger.annotations.ApiModelProperty;</#if>
2423
@AllArgsConstructor
2524
<#if isLombok?exists && isLombok==true>@Data</#if>
2625
<#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")</#if><#if isSwagger?exists && isSwagger==true>
27-
@ApiModel("${classInfo.classComment}")</#if>
26+
@Schema"${classInfo.classComment}")</#if>
2827
public class ${classInfo.className} implements Serializable {
2928

3029
private static final long serialVersionUID = 1L;
3130

3231
@Id
33-
@ApiModelProperty("id")
32+
@Schema(description = "id")
3433
@GeneratedValue(strategy = GenerationType.IDENTITY)
3534
private Integer id;
3635

@@ -39,7 +38,7 @@ public class ${classInfo.className} implements Serializable {
3938
<#if isComment?exists && isComment==true>/**
4039
* ${fieldItem.fieldComment}
4140
*/</#if><#if isSwagger?exists && isSwagger==true>
42-
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
41+
@Schema(description = "${fieldItem.fieldComment}")</#if>
4342
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
4443
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
4544

generator-web/src/main/resources/templates/code-generator/jpa/entity.ftl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import javax.persistence.Id;
1111
import javax.persistence.Table;
1212
import javax.persistence.GeneratedValue;
1313
<#if isSwagger?exists && isSwagger==true>
14-
import io.swagger.annotations.ApiModel;
15-
import io.swagger.annotations.ApiModelProperty;</#if>
14+
import io.swagger.v3.oas.annotations.media.Schema;</#if>
1615
</#if>
1716
/**
1817
* @description ${classInfo.classComment}
@@ -22,7 +21,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
2221
@Entity
2322
<#if isLombok?exists && isLombok==true>@Data</#if>
2423
<#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")</#if><#if isSwagger?exists && isSwagger==true>
25-
@ApiModel("${classInfo.classComment}")</#if>
24+
@Schema"${classInfo.classComment}")</#if>
2625
public class ${classInfo.className} implements Serializable {
2726

2827
private static final long serialVersionUID = 1L;
@@ -34,7 +33,7 @@ public class ${classInfo.className} implements Serializable {
3433
<#if isComment?exists && isComment==true>/**
3534
* ${fieldItem.fieldComment}
3635
*/</#if><#if isSwagger?exists && isSwagger==true>
37-
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
36+
@Schema(description = "${fieldItem.fieldComment}")</#if>
3837
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
3938
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
4039

generator-web/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
1212
import com.baomidou.mybatisplus.core.metadata.IPage;
1313
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
1414
import org.springframework.web.servlet.ModelAndView;
15-
15+
<#if isSwagger?exists && isSwagger==true>import io.swagger.v3.oas.annotations.tags.Tag;
16+
import io.swagger.v3.oas.annotations.responses.ApiResponse;</#if>
1617
import java.util.Date;
1718
import java.util.List;
1819
import java.util.Map;
@@ -25,6 +26,7 @@ import java.util.Map;
2526
@Slf4j
2627
@RestController
2728
@RequestMapping("/${classInfo.className?uncap_first}")
29+
<#if isSwagger?exists && isSwagger==true>@Tag(name = "${classInfo.className}",description = "${classInfo.classComment}控制器")</#if>
2830
public class ${classInfo.className}Controller {
2931

3032
@Autowired

generator-web/src/main/resources/templates/code-generator/mybatis-plus/plusentity.ftl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ import java.io.Serializable;
88
import com.baomidou.mybatisplus.annotation.IdType;
99
import com.baomidou.mybatisplus.annotation.TableId;
1010
<#if isSwagger?exists && isSwagger==true>
11-
import io.swagger.annotations.ApiModel;
12-
import io.swagger.annotations.ApiModelProperty;</#if>
11+
import io.swagger.v3.oas.annotations.media.Schema;</#if>
1312
</#if>
1413
/**
1514
* @description ${classInfo.classComment}
1615
* @author ${authorName}
1716
* @date ${.now?string('yyyy-MM-dd')}
1817
*/
1918
<#if isLombok?exists && isLombok==true>@Data</#if><#if isSwagger?exists && isSwagger==true>
20-
@ApiModel("${classInfo.classComment}")</#if>
19+
@Schema"${classInfo.classComment}")</#if>
2120
public class ${classInfo.className} implements Serializable {
2221

2322
private static final long serialVersionUID = 1L;
@@ -28,7 +27,7 @@ public class ${classInfo.className} implements Serializable {
2827
<#if isComment?exists && isComment==true>/**
2928
* ${fieldItem.fieldComment}
3029
*/</#if><#if isSwagger?exists && isSwagger==true>
31-
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
30+
@Schema(description = "${fieldItem.fieldComment}")</#if>
3231
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
3332

3433
<#if isLombok?exists && isLombok==false>

generator-web/src/main/resources/templates/code-generator/tk-mybatis/tk-entity.ftl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import java.util.List;
77
import java.io.Serializable;
88
import io.mybatis.provider.Entity;
99
<#if isSwagger?exists && isSwagger==true>
10-
import io.swagger.annotations.ApiModel;
11-
import io.swagger.annotations.ApiModelProperty;</#if>
10+
import io.swagger.v3.oas.annotations.media.Schema;</#if>
1211
</#if>
1312
/**
1413
* @description ${classInfo.classComment}
@@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty;</#if>
1716
*/
1817
<#if isLombok?exists && isLombok==true>@Data</#if>
1918
<#if isComment?exists && isComment==true>@Entity.Table("${classInfo.originTableName}")</#if><#if isSwagger?exists && isSwagger==true>
20-
@ApiModel("${classInfo.classComment}")</#if>
19+
@Schema"${classInfo.classComment}")</#if>
2120
public class ${classInfo.className} implements Serializable {
2221

2322
private static final long serialVersionUID = 1L;
@@ -28,7 +27,7 @@ public class ${classInfo.className} implements Serializable {
2827
<#if isComment?exists && isComment==true>/**
2928
* ${fieldItem.fieldComment}
3029
*/</#if><#if isSwagger?exists && isSwagger==true>
31-
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
30+
@Schema(description = "${fieldItem.fieldComment}")</#if>
3231
<#if isComment?exists && isComment==true>@Entity.Column("${fieldItem.columnName}")</#if>
3332
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
3433

0 commit comments

Comments
 (0)