代码生成器更改

nacos
DongZeLiang 2023-10-10 22:56:39 +08:00
parent 25c38ebeef
commit 9403635b1d
3 changed files with 14 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.page.ReqDomain;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -40,6 +41,7 @@ public class BaseEntity implements Serializable {
*
*/
@TableField(value = "create_by" , fill = FieldFill.INSERT)
@ApiModelProperty(hidden=true)
private Long createBy;
/**
@ -47,12 +49,14 @@ public class BaseEntity implements Serializable {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "create_time" , fill = FieldFill.INSERT)
@ApiModelProperty(hidden=true)
private Date createTime;
/**
*
*/
@TableField(value = "update_by" , fill = FieldFill.UPDATE)
@ApiModelProperty(hidden=true)
private Long updateBy;
/**
@ -60,6 +64,7 @@ public class BaseEntity implements Serializable {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "update_time" , fill = FieldFill.UPDATE)
@ApiModelProperty(hidden=true)
private Date updateTime;
/**
@ -67,6 +72,7 @@ public class BaseEntity implements Serializable {
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
@ApiModelProperty(hidden=true)
private Map<String, Object> params;
public Map<String, Object> getParams () {

View File

@ -62,7 +62,11 @@ public class ${ClassName} extends ${Entity} {
#if($column.javaField == $pkColumn.javaField)
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
#end
@ApiModelProperty(name = "${comment}")
#set($comment='')
#if($column.isRequired == '1')
#set($comment=', required = true')
#end
@ApiModelProperty(name = "${column.columnComment}", value = "${column.columnComment}"$comment)
private $column.javaType $column.javaField;
#end

View File

@ -33,17 +33,17 @@ public class BookInfo extends BaseEntity {
/** 主键 */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(name = "${comment}")
@ApiModelProperty(name = "主键", value = "主键")
private Long id;
/** 名称 */
@Excel(name = "名称")
@ApiModelProperty(name = "名称")
@ApiModelProperty(name = "名称", value = "名称", required = true)
private String name;
/** 价格 */
@Excel(name = "价格")
@ApiModelProperty(name = "价格")
@ApiModelProperty(name = "价格", value = "价格")
private BigDecimal price;
}