Apollo配置-各数据类型的配置和读取

1、配置:

复制代码
user.search.flag = 1
## 客群价模板ID
user.search.template_id = 46

## 客群价模板ID
user.search.template_name = 测试

# 用户域字段
user.search.domain_user_fields = wid,nickname,phone,headUrl,name

# 用户域字段
user.search.domain_map[user] = wid,nickname,phone,headUrl,name
# 会员域字段
user.search.domain_map[membership] = becomeMemberTime,becomeCustomerTime,membershipTypeList,customerStatus
# 积分域字段
user.search.domain_map[point] = currentPoint
# 储值域字段
user.search.domain_map[store] = currentAmount,totalDepositAmount,depositCount
# 交易域字段
user.search.domain_map[consume] = lastConsumeTime,lastConsumeAmount,consumeAmountAll,consumeCountAll,avgConsumeAmount,paidAmount,afterSalesAmountAll,afterSalesCountAll,discountFee,associatedPurchaseRate
# 导购域字段
user.search.domain_map[guide] = bindGuideTime,hasBindGuider
# 分销域字段
user.search.domain_map[distribution] = hasDistribution,leaderNickname
复制代码

2、读取

复制代码
 1 import lombok.Data;
 2 import org.springframework.boot.context.properties.ConfigurationProperties;
 3 import org.springframework.context.annotation.Configuration;
 4 
 5 import java.util.List;
 6 import java.util.Map;
 7 
 8 /**
 9  * @author jijiecong
10  * @version 1.0
11  * @date 2022/1/4 19:29
12  * @description TODO
13  */
14 @Data
15 @Configuration
16 @ConfigurationProperties("user.search")
17 public class UserSearchConfig {
18 
19     /**
20      * boolean类型
21      */
22     private Boolean flag;
23 
24     /**
25      * 数字类型
26      */
27     private Long templateId;
28 
29     /**
30      * 字符串类型
31      */
32     private String templateName;
33 
34     /**
35      * list类型
36      */
37     private List<String> domainUserFields;
38 
39     /**
40      * map类型
41      */
42     private Map<String, List<String>> domainMap;
43 }
复制代码

 

posted on   Iversonstear  阅读(2890)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示