Demo
This commit is contained in:
24
yudao-module-template/pom.xml
Normal file
24
yudao-module-template/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modules>
|
||||
<module>yudao-module-template-api</module>
|
||||
<module>yudao-module-template-server</module>
|
||||
</modules>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-module-template</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
样例模块。
|
||||
</description>
|
||||
|
||||
</project>
|
||||
26
yudao-module-template/yudao-module-template-api/pom.xml
Normal file
26
yudao-module-template/yudao-module-template-api/pom.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-template</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-template-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.template.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* Template 错误码枚举类
|
||||
* Template 系统,使用 1_100_000_000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 模板样例 1_100_000_000 ==========
|
||||
ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_100_000_000, "模板样例不存在");
|
||||
|
||||
}
|
||||
145
yudao-module-template/yudao-module-template-server/pom.xml
Normal file
145
yudao-module-template/yudao-module-template-server/pom.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.template;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* @author 周迪
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class TemplateServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TemplateServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.template.controller.admin.example.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模板样例分页 Request VO")
|
||||
@Data
|
||||
public class ExamplePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "字符串")
|
||||
private String strTemp;
|
||||
|
||||
@Schema(description = "整数")
|
||||
private Integer intTemp;
|
||||
|
||||
@Schema(description = "小整数")
|
||||
private Short sintTemp;
|
||||
|
||||
@Schema(description = "布尔值")
|
||||
private Boolean bitTemp;
|
||||
|
||||
@Schema(description = "数值类型")
|
||||
private BigDecimal decimalTemp;
|
||||
|
||||
@Schema(description = "日期类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate dateTemp;
|
||||
|
||||
@Schema(description = "时间类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.template.controller.admin.example.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模板样例 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExampleRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24968")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "字符串")
|
||||
@ExcelProperty("字符串")
|
||||
private String strTemp;
|
||||
|
||||
@Schema(description = "整数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("整数")
|
||||
private Integer intTemp;
|
||||
|
||||
@Schema(description = "小整数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("小整数")
|
||||
private Short sintTemp;
|
||||
|
||||
@Schema(description = "布尔值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("布尔值")
|
||||
private Boolean bitTemp;
|
||||
|
||||
@Schema(description = "数值类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("数值类型")
|
||||
private BigDecimal decimalTemp;
|
||||
|
||||
@Schema(description = "日期类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("日期类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate dateTemp;
|
||||
|
||||
@Schema(description = "时间类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("时间类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.template.controller.admin.example.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模板样例新增/修改 Request VO")
|
||||
@Data
|
||||
public class ExampleSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24968")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "字符串")
|
||||
private String strTemp;
|
||||
|
||||
@Schema(description = "整数")
|
||||
// @NotNull(message = "整数不能为空")
|
||||
private Integer intTemp;
|
||||
|
||||
@Schema(description = "小整数")
|
||||
// @NotNull(message = "小整数不能为空")
|
||||
private Short sintTemp;
|
||||
|
||||
@Schema(description = "布尔值")
|
||||
// @NotNull(message = "布尔值不能为空")
|
||||
private Boolean bitTemp;
|
||||
|
||||
@Schema(description = "数值类型")
|
||||
// @NotNull(message = "数值类型不能为空")
|
||||
private BigDecimal decimalTemp;
|
||||
|
||||
@Schema(description = "日期类型")
|
||||
// @NotNull(message = "日期类型不能为空")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate dateTemp;
|
||||
|
||||
@Schema(description = "时间类型")
|
||||
// @NotNull(message = "时间类型不能为空")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package cn.iocoder.yudao.module.template.dal.dataobject.example;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
||||
|
||||
/**
|
||||
* 模板样例 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("template_example")
|
||||
@KeySequence("template_example_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
// @EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
// public class ExampleDO extends TenantBaseDO {
|
||||
public class ExampleDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 字符串
|
||||
*/
|
||||
private String strTemp;
|
||||
/**
|
||||
* 整数
|
||||
*/
|
||||
private Integer intTemp;
|
||||
/**
|
||||
* 小整数
|
||||
*/
|
||||
private Short sintTemp;
|
||||
/**
|
||||
* 布尔值
|
||||
*/
|
||||
@TableField(value = "bit_temp", typeHandler = org.apache.ibatis.type.BooleanTypeHandler.class)
|
||||
private Boolean bitTemp;
|
||||
/**
|
||||
* 数值类型
|
||||
*/
|
||||
private BigDecimal decimalTemp;
|
||||
/**
|
||||
* 日期类型
|
||||
*/
|
||||
private LocalDate dateTemp;
|
||||
/**
|
||||
* 时间类型
|
||||
*/
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
/**
|
||||
* 多租户编号
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
private String creator;
|
||||
private String updater;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user