-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
func of element-svg icon for side menu
- Loading branch information
Showing
35 changed files
with
1,504 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
ty-common/src/main/java/top/kuanghua/khcomomon/entity/CommonParamsSelf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package top.kuanghua.khcomomon.entity; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @Title: CommonParams | ||
* @Description: | ||
* @Auther: kuanghua | ||
* @create 2020/12/15 12:01 | ||
*/ | ||
@Data | ||
@ApiModel | ||
public class CommonParamsSelf extends KHCommonPageParams{ | ||
@ApiModelProperty("开始时间") | ||
private String startTime; | ||
@ApiModelProperty("结束时间") | ||
private String endTime; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?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>micro-service-plus</artifactId> | ||
<groupId>top.kuanghua</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>ty-excel</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.alibaba</groupId> | ||
<artifactId>easyexcel</artifactId> | ||
<version>3.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>top.kuanghua</groupId> | ||
<artifactId>ty-common</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<!--开启过滤,用指定的参数替换directory下的文件中的参数--> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
<!--添加配置跳过测试--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.1</version> | ||
<configuration> | ||
<skipTests>true</skipTests> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
13 changes: 13 additions & 0 deletions
13
ty-excel/src/main/java/top/kuanghua/tyexcel/ExcelApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package top.kuanghua.tyexcel; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | ||
|
||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) | ||
public class ExcelApplication { | ||
public static void main(String[] args) { | ||
SpringApplication.run(ExcelApplication.class,args); | ||
} | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
ty-excel/src/main/java/top/kuanghua/tyexcel/bo/ComplexHeadData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package top.kuanghua.tyexcel.bo; | ||
|
||
import com.alibaba.excel.annotation.ExcelProperty; | ||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
@Data | ||
public class ComplexHeadData { | ||
@ExcelProperty({"主标题", "字符串标题"}) | ||
private String string; | ||
@ExcelProperty({"主标题", "日期标题"}) | ||
private Date date; | ||
@ExcelProperty({"主标题", "数字标题"}) | ||
private Double doubleData; | ||
} |
15 changes: 15 additions & 0 deletions
15
ty-excel/src/main/java/top/kuanghua/tyexcel/bo/CustomStringStringConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package top.kuanghua.tyexcel.bo; | ||
|
||
import com.alibaba.excel.converters.Converter; | ||
import com.alibaba.excel.enums.CellDataTypeEnum; | ||
import com.alibaba.excel.metadata.GlobalConfiguration; | ||
import com.alibaba.excel.metadata.data.ReadCellData; | ||
import com.alibaba.excel.metadata.property.ExcelContentProperty; | ||
|
||
|
||
public class CustomStringStringConverter implements Converter<String> { | ||
@Override | ||
public String convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { | ||
return "自定义:" + cellData.getStringValue(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
ty-excel/src/main/java/top/kuanghua/tyexcel/bo/DemoData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package top.kuanghua.tyexcel.bo; | ||
|
||
import com.alibaba.excel.annotation.ExcelIgnore; | ||
import com.alibaba.excel.annotation.ExcelProperty; | ||
import com.alibaba.excel.annotation.format.DateTimeFormat; | ||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
@Data | ||
public class DemoData { | ||
@ExcelProperty("字符串标题") | ||
private String string; | ||
@ExcelProperty("日期标题") | ||
@DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒") | ||
private Date date; | ||
@ExcelProperty(value="数字标题",index = 3) | ||
private Double doubleData; | ||
/** | ||
* 忽略这个字段 | ||
*/ | ||
@ExcelIgnore | ||
private String ignore; | ||
} |
11 changes: 11 additions & 0 deletions
11
ty-excel/src/main/java/top/kuanghua/tyexcel/bo/DemoExtraData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package top.kuanghua.tyexcel.bo; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class DemoExtraData { | ||
|
||
private String row1; | ||
|
||
private String row2; | ||
} |
28 changes: 28 additions & 0 deletions
28
ty-excel/src/main/java/top/kuanghua/tyexcel/bo/RuiDeKqBo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package top.kuanghua.tyexcel.bo; | ||
|
||
import com.alibaba.excel.annotation.ExcelProperty; | ||
import com.alibaba.excel.annotation.format.DateTimeFormat; | ||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* @Title: RuiDeKqBo | ||
* @Description: | ||
* @Auther: kuanghua | ||
* @create 2021/7/9 10:27 | ||
*/ | ||
@Data | ||
public class RuiDeKqBo { | ||
@ExcelProperty(value = "部门",converter = CustomStringStringConverter.class) | ||
private String department; | ||
@ExcelProperty("姓名") | ||
private String username; | ||
@ExcelProperty("日期") | ||
@DateTimeFormat("yyyy年") | ||
private Date dateTime; | ||
@ExcelProperty("签到时间") | ||
private String checkInTime; | ||
private String row1; | ||
private String row2; | ||
} |
25 changes: 25 additions & 0 deletions
25
ty-excel/src/main/java/top/kuanghua/tyexcel/config/BaseConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package top.kuanghua.tyexcel.config; | ||
|
||
import org.mybatis.spring.annotation.MapperScan; | ||
import org.springframework.cloud.openfeign.EnableFeignClients; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* @Title: BaseConfig | ||
* @Description: | ||
* @Auther: kuanghua | ||
* @create 2020/8/23 21:52 | ||
*/ | ||
/* | ||
* 总结:1.@Configuration 下的@ComponentScan回将包下带有@Component扫描变成配置类, | ||
* 而@SpringBootApplication扫描的只会变成普通类 | ||
* */ | ||
@Configuration | ||
//扫描公用包的配置和自身的配置类 | ||
@ComponentScan(basePackages = {"top.kuanghua.khcomomon","top.kuanghua.tyexcel"}) | ||
//feign扫描 | ||
//@EnableFeignClients(basePackages = {"top.kuanghua.feign.tyexecl","top.kuanghua.feign.tyauth"}) | ||
//mapper包扫描 | ||
//@MapperScan(basePackages = {"top.kuanghua.tyuser.mapper"}) | ||
public class BaseConfig {} |
56 changes: 56 additions & 0 deletions
56
ty-excel/src/main/java/top/kuanghua/tyexcel/config/Swagger2Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package top.kuanghua.tyexcel.config; | ||
|
||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.stereotype.Component; | ||
import springfox.documentation.builders.ApiInfoBuilder; | ||
import springfox.documentation.builders.PathSelectors; | ||
import springfox.documentation.builders.RequestHandlerSelectors; | ||
import springfox.documentation.service.ApiInfo; | ||
import springfox.documentation.service.Contact; | ||
import springfox.documentation.spi.DocumentationType; | ||
import springfox.documentation.spring.web.plugins.Docket; | ||
import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||
|
||
@Component | ||
@EnableSwagger2 //开启在线接口文档 | ||
//配置包扫描 | ||
public class Swagger2Config { | ||
private boolean swagger_is_enable = true; | ||
// @Value("${.ipAddr}") | ||
// private String ipAddr; | ||
@Value("${server.port}") | ||
private String port; | ||
|
||
@Bean | ||
public Docket api() { | ||
return new Docket(DocumentationType.SWAGGER_2) | ||
.enable(swagger_is_enable) | ||
//.host(this.ipAddr + ":" + this.port) | ||
.apiInfo(apiInfo()) | ||
.select() | ||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) | ||
//.apis(basePackage("top.kuanghua.swagger.controller")) | ||
.paths(PathSelectors.any()) | ||
.build(); | ||
} | ||
|
||
/** | ||
* 构建 api文档的详细信息函数 | ||
* | ||
* @return | ||
*/ | ||
private ApiInfo apiInfo() { | ||
return new ApiInfoBuilder() | ||
.title("标题:swagger文档") | ||
.description("描述:新一代的微服务架构") | ||
.contact(new Contact("jzfai", null, "[email protected]")) | ||
.version("版本号:2.8") | ||
.build(); | ||
} | ||
|
||
/** | ||
* http://localhost:8080/swagger-ui.html | ||
*/ | ||
} |
Oops, something went wrong.