3
3
import com .google .gson .annotations .JsonAdapter ;
4
4
import com .google .gson .annotations .SerializedName ;
5
5
import lombok .Data ;
6
+ import lombok .Getter ;
6
7
import lombok .NoArgsConstructor ;
8
+ import lombok .Setter ;
7
9
import me .chanjar .weixin .cp .util .json .WxCpConclusionAdapter ;
8
10
import me .chanjar .weixin .cp .util .json .WxCpGsonBuilder ;
9
11
18
20
@ NoArgsConstructor
19
21
public class WxCpContactWayInfo {
20
22
21
- /**
22
- * 联系方式的配置id
23
- */
24
- @ SerializedName ("config_id" )
25
- private String configId ;
26
-
27
- /**
28
- * <pre>
29
- * 必填
30
- * 联系方式类型,1-单人, 2-多人
31
- * </pre>
32
- */
33
- private TYPE type ;
34
-
35
- /**
36
- * <pre>
37
- * 必填
38
- * 场景,1-在小程序中联系,2-通过二维码联系
39
- * </pre>
40
- */
41
- private SCENE scene ;
42
-
43
- /**
44
- * <pre>
45
- * 非必填
46
- * 在小程序中联系时使用的控件样式
47
- * <b>单人样式(type=1)时可选1,2,3</b>
48
- * <b>多人样式(type=2)时可选1,2</b>
49
- * </pre>
50
- */
51
- private Integer style ;
52
-
53
- /**
54
- * <pre>
55
- * 非必填
56
- * 联系方式的备注信息,用于助记,不超过30个字符
57
- * </pre>
58
- */
59
- private String remark ;
60
-
61
- /**
62
- * <pre>
63
- * 非必填
64
- * 外部客户添加时是否无需验证,默认为true
65
- * </pre>
66
- */
67
- @ SerializedName ("skip_verify" )
68
- private Boolean skipVerify = Boolean .TRUE ;
69
-
70
- /**
71
- * <pre>
72
- * 非必填
73
- * 企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情(WxCpExternalContactService.getContactDetail)” 时会返回该参数值,不超过30个字符
74
- * </pre>
75
- */
76
- private String state ;
77
-
78
- /**
79
- * <pre>
80
- * 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
81
- * </pre>
82
- */
83
- @ SerializedName ("user" )
84
- private List <String > users ;
85
-
86
-
87
- /**
88
- * <pre>
89
- * 非必填
90
- * 使用该联系方式的部门id列表,只在type为2时有效
91
- * </pre>
92
- */
93
- @ SerializedName ("party" )
94
- private List <String > partys ;
95
-
96
- /**
97
- * <pre>
98
- * 非必填
99
- * 是否临时会话模式,true表示使用临时会话模式,默认为false
100
- * </pre>
101
- */
102
- @ SerializedName ("is_temp" )
103
- private Boolean isTemp = Boolean .FALSE ;
104
-
105
- /**
106
- * <pre>
107
- * 非必填
108
- * 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天
109
- * </pre>
110
- */
111
- @ SerializedName ("expires_in" )
112
- private Integer expiresIn ;
113
-
114
- /**
115
- * <pre>
116
- * 非必填
117
- * 临时会话有效期,以秒为单位。该参数仅在is_temp为true时有效,默认为添加好友后24小时
118
- * </pre>
119
- */
120
- @ SerializedName ("chat_expires_in" )
121
- private Integer chatExpiresIn ;
122
-
123
- /**
124
- * <pre>
125
- * 非必填
126
- * 可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
127
- * </pre>
128
- */
129
- @ SerializedName ("unionid" )
130
- private String unionId ;
131
-
132
- /**
133
- * <pre>
134
- * 非必填
135
- * 结束语,会话结束时自动发送给客户,可参考“结束语定义”,仅在is_temp为true时有效
136
- * </pre>
137
- */
138
- private Conclusion conclusions ;
23
+ @ SerializedName ("contact_way" )
24
+ private ContactWay contactWay ;
25
+
26
+ @ Getter
27
+ @ Setter
28
+ public static class ContactWay {
29
+ /**
30
+ * 联系方式的配置id
31
+ */
32
+ @ SerializedName ("config_id" )
33
+ private String configId ;
34
+
35
+ /**
36
+ * <pre>
37
+ * 必填
38
+ * 联系方式类型,1-单人, 2-多人
39
+ * </pre>
40
+ */
41
+ private TYPE type ;
42
+
43
+ /**
44
+ * <pre>
45
+ * 必填
46
+ * 场景,1-在小程序中联系,2-通过二维码联系
47
+ * </pre>
48
+ */
49
+ private SCENE scene ;
50
+
51
+ /**
52
+ * <pre>
53
+ * 非必填
54
+ * 在小程序中联系时使用的控件样式
55
+ * <b>单人样式(type=1)时可选1,2,3</b>
56
+ * <b>多人样式(type=2)时可选1,2</b>
57
+ * </pre>
58
+ */
59
+ private Integer style ;
60
+
61
+ /**
62
+ * <pre>
63
+ * 非必填
64
+ * 联系方式的备注信息,用于助记,不超过30个字符
65
+ * </pre>
66
+ */
67
+ private String remark ;
68
+
69
+ /**
70
+ * <pre>
71
+ * 非必填
72
+ * 外部客户添加时是否无需验证,默认为true
73
+ * </pre>
74
+ */
75
+ @ SerializedName ("skip_verify" )
76
+ private Boolean skipVerify = Boolean .TRUE ;
77
+
78
+ /**
79
+ * <pre>
80
+ * 非必填
81
+ * 企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情(WxCpExternalContactService.getContactDetail)” 时会返回该参数值,不超过30个字符
82
+ * </pre>
83
+ */
84
+ private String state ;
85
+
86
+ /**
87
+ * <pre>
88
+ * 联系二维码的URL,仅在scene为2时返回
89
+ * </pre>
90
+ */
91
+ @ SerializedName ("qr_code" )
92
+ private String qrCode ;
93
+
94
+ /**
95
+ * <pre>
96
+ * 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
97
+ * </pre>
98
+ */
99
+ @ SerializedName ("user" )
100
+ private List <String > users ;
101
+
102
+
103
+ /**
104
+ * <pre>
105
+ * 非必填
106
+ * 使用该联系方式的部门id列表,只在type为2时有效
107
+ * </pre>
108
+ */
109
+ @ SerializedName ("party" )
110
+ private List <String > partys ;
111
+
112
+ /**
113
+ * <pre>
114
+ * 非必填
115
+ * 是否临时会话模式,true表示使用临时会话模式,默认为false
116
+ * </pre>
117
+ */
118
+ @ SerializedName ("is_temp" )
119
+ private Boolean isTemp = Boolean .FALSE ;
120
+
121
+ /**
122
+ * <pre>
123
+ * 非必填
124
+ * 临时会话二维码有效期,以秒为单位。该参数仅在is_temp为true时有效,默认7天
125
+ * </pre>
126
+ */
127
+ @ SerializedName ("expires_in" )
128
+ private Integer expiresIn ;
129
+
130
+ /**
131
+ * <pre>
132
+ * 非必填
133
+ * 临时会话有效期,以秒为单位。该参数仅在is_temp为true时有效,默认为添加好友后24小时
134
+ * </pre>
135
+ */
136
+ @ SerializedName ("chat_expires_in" )
137
+ private Integer chatExpiresIn ;
138
+
139
+ /**
140
+ * <pre>
141
+ * 非必填
142
+ * 可进行临时会话的客户unionid,该参数仅在is_temp为true时有效,如不指定则不进行限制
143
+ * </pre>
144
+ */
145
+ @ SerializedName ("unionid" )
146
+ private String unionId ;
147
+
148
+ /**
149
+ * <pre>
150
+ * 非必填
151
+ * 结束语,会话结束时自动发送给客户,可参考“结束语定义”,仅在is_temp为true时有效
152
+ * </pre>
153
+ */
154
+ private Conclusion conclusions ;
155
+
156
+ public static WxCpContactWayInfo .ContactWay fromJson (String json ) {
157
+ return WxCpGsonBuilder .create ().fromJson (json , WxCpContactWayInfo .ContactWay .class );
158
+ }
159
+
160
+ public String toJson () {
161
+ return WxCpGsonBuilder .create ().toJson (this );
162
+ }
163
+
164
+ /**
165
+ * 结束语定义
166
+ */
167
+ @ Data
168
+ @ JsonAdapter (WxCpConclusionAdapter .class )
169
+ public static class Conclusion {
170
+ private String textContent ;
171
+ private String imgMediaId ;
172
+ private String imgPicUrl ;
173
+ private String linkTitle ;
174
+ private String linkPicUrl ;
175
+ private String linkDesc ;
176
+ private String linkUrl ;
177
+ private String miniProgramTitle ;
178
+ private String miniProgramPicMediaId ;
179
+ private String miniProgramAppId ;
180
+ private String miniProgramPage ;
181
+ }
182
+
183
+ }
184
+
139
185
140
186
public static WxCpContactWayInfo fromJson (String json ) {
141
187
return WxCpGsonBuilder .create ().fromJson (json , WxCpContactWayInfo .class );
@@ -145,25 +191,6 @@ public String toJson() {
145
191
return WxCpGsonBuilder .create ().toJson (this );
146
192
}
147
193
148
- /**
149
- * 结束语定义
150
- */
151
- @ Data
152
- @ JsonAdapter (WxCpConclusionAdapter .class )
153
- public static class Conclusion {
154
- private String textContent ;
155
- private String imgMediaId ;
156
- private String imgPicUrl ;
157
- private String linkTitle ;
158
- private String linkPicUrl ;
159
- private String linkDesc ;
160
- private String linkUrl ;
161
- private String miniProgramTitle ;
162
- private String miniProgramPicMediaId ;
163
- private String miniProgramAppId ;
164
- private String miniProgramPage ;
165
- }
166
-
167
194
public enum TYPE {
168
195
/**
169
196
* 单人
0 commit comments