文件模块初步完成
This commit is contained in:
@ -30,7 +30,6 @@ springdoc:
|
||||
|
||||
|
||||
server:
|
||||
address: 0.0.0.0
|
||||
port: 3456
|
||||
|
||||
servlet:
|
||||
|
26
src/main/resources/mapper/FileInfoMapper.xml
Normal file
26
src/main/resources/mapper/FileInfoMapper.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.greenorange.promotion.mapper.FileInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.greenorange.promotion.model.entity.FileInfo">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
<result property="path" column="path" jdbcType="VARCHAR"/>
|
||||
<result property="size" column="size" jdbcType="BIGINT"/>
|
||||
<result property="fileView" column="fileView" jdbcType="VARCHAR"/>
|
||||
<result property="biz" column="biz" jdbcType="VARCHAR"/>
|
||||
<result property="isDelete" column="isDelete" jdbcType="TINYINT"/>
|
||||
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,type,
|
||||
path,size,fileView,
|
||||
biz,isDelete,createTime,
|
||||
updateTime
|
||||
</sql>
|
||||
</mapper>
|
@ -10,7 +10,7 @@ import jakarta.validation.Valid;
|
||||
* ${entityComment} 控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("${tableName}")
|
||||
@RequestMapping("${entityNameLower}")
|
||||
@Slf4j
|
||||
@Tag(name = "${entityComment}管理")
|
||||
public class ${entityName}Controller {
|
||||
@ -28,6 +28,8 @@ public class ${entityName}Controller {
|
||||
*/
|
||||
@PostMapping("add")
|
||||
@Operation(summary = "web端管理员添加${entityComment}", description = "参数:${entityComment}添加请求体,权限:管理员,方法名:add${entityName}")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "${entityComment}管理", content = "web端管理员添加${entityComment}")
|
||||
public BaseResponse<Boolean> add${entityName}(@Valid @RequestBody ${entityName}AddRequest ${entityNameLower}AddRequest) {
|
||||
${entityName} ${entityNameLower} = commonService.copyProperties(${entityNameLower}AddRequest, ${entityName}.class);
|
||||
${entityNameLower}Service.save(${entityNameLower});
|
||||
|
@ -16,21 +16,17 @@ import com.greenorange.promotion.common.PageRequest;
|
||||
@Schema(description = "${entityComment}查询请求体", requiredProperties = {"current", "pageSize"})
|
||||
public class ${entityName}QueryRequest extends PageRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* ${entityComment} ID
|
||||
*/
|
||||
@Schema(description = "${entityComment} ID", example = "1")
|
||||
@Min(value = 1L, message = "${entityComment} ID不能小于1")
|
||||
private Long id;
|
||||
|
||||
#foreach($field in ${table.fields})
|
||||
#if(!$field.keyFlag && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
#if($field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
/**
|
||||
* ${field.comment}
|
||||
*/
|
||||
#if($field.propertyType == "String")
|
||||
@NotBlank(message = "${field.comment}不能为空")
|
||||
#end
|
||||
#if($field.propertyType == "Long")
|
||||
@Min(value = 1L, message = "${field.comment} ID不能小于1")
|
||||
#end
|
||||
@Schema(description = "${field.comment}", example = "")
|
||||
private ${field.propertyType} ${field.propertyName};
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@Schema(description = "${entityComment}更新请求体", requiredProperties = {
|
||||
#foreach($field in ${table.fields})
|
||||
#if(!$field.keyFlag && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
#if($field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
"${field.propertyName}",
|
||||
#end
|
||||
#end
|
||||
@ -22,7 +22,7 @@ import java.io.Serializable;
|
||||
public class ${entityName}UpdateRequest implements Serializable {
|
||||
|
||||
#foreach($field in ${table.fields})
|
||||
#if(!$field.keyFlag && $field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
#if($field.propertyName != "createTime" && $field.propertyName != "updateTime" && $field.propertyName != "isDelete")
|
||||
/**
|
||||
* ${field.comment}
|
||||
*/
|
||||
@ -30,7 +30,7 @@ public class ${entityName}UpdateRequest implements Serializable {
|
||||
@NotBlank(message = "${field.comment}不能为空")
|
||||
#end
|
||||
#if($field.propertyType == "Long")
|
||||
@Min(value = 1L, message = "${field.comment} ID不能小于1")
|
||||
@Min(value = 1L, message = "${field.comment} ID不能小于1")
|
||||
#end
|
||||
@Schema(description = "${field.comment}", example = "")
|
||||
private ${field.propertyType} ${field.propertyName};
|
||||
|
@ -15,9 +15,9 @@ import java.math.BigDecimal;
|
||||
public class ${entityName}VO implements Serializable {
|
||||
|
||||
/**
|
||||
* ${entityComment} ID
|
||||
* ${entityComment}ID
|
||||
*/
|
||||
@Schema(description = "${entityComment} ID", example = "1")
|
||||
@Schema(description = "${entityComment}ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
#foreach($field in ${table.fields})
|
||||
|
Reference in New Issue
Block a user