mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 04:47:10 +08:00
refactor(common-excel): 支持字典自动转换
This commit is contained in:
parent
b0ff258970
commit
883fc77011
@ -61,5 +61,9 @@
|
|||||||
<artifactId>spring-webmvc</artifactId>
|
<artifactId>spring-webmvc</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-commons</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
package com.pig4cloud.pig.common.core.config;
|
package com.pig4cloud.pig.common.core.config;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
@ -27,7 +29,13 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
public class RestTemplateConfiguration {
|
public class RestTemplateConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态 REST 模板
|
||||||
|
* @return {@link RestTemplate }
|
||||||
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
|
@LoadBalanced
|
||||||
|
@ConditionalOnProperty(value = "spring.cloud.nacos.discovery.enabled", havingValue = "true", matchIfMissing = true)
|
||||||
public RestTemplate restTemplate() {
|
public RestTemplate restTemplate() {
|
||||||
return new RestTemplate();
|
return new RestTemplate();
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,16 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
public class ExcelAutoConfiguration {
|
public class ExcelAutoConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* REST 模板
|
||||||
|
* @return {@link RestTemplate }
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public RestTemplate restTemplate() {
|
||||||
|
return new RestTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dict 数据提供程序
|
* dict 数据提供程序
|
||||||
* @param restTemplate REST 模板
|
* @param restTemplate REST 模板
|
||||||
|
@ -96,7 +96,7 @@ public class UserExcelVO implements Serializable {
|
|||||||
* 锁定标记
|
* 锁定标记
|
||||||
*/
|
*/
|
||||||
@ExcelProperty("锁定标记,0:正常,9:已锁定")
|
@ExcelProperty("锁定标记,0:正常,9:已锁定")
|
||||||
@DictTypeProperty("lock_flagX")
|
@DictTypeProperty("lock_flag")
|
||||||
private String lockFlag;
|
private String lockFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user