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