File tree Expand file tree Collapse file tree 3 files changed +43
-11
lines changed
weixin-java-cp/src/main/java/me/chanjar/weixin/cp Expand file tree Collapse file tree 3 files changed +43
-11
lines changed Original file line number Diff line number Diff line change 1
1
package me .chanjar .weixin .cp .api ;
2
2
3
3
import me .chanjar .weixin .common .error .WxErrorException ;
4
- import me .chanjar .weixin .cp .bean .message .WxCpLinkedCorpMessage ;
5
- import me .chanjar .weixin .cp .bean .message .WxCpMessage ;
6
- import me .chanjar .weixin .cp .bean .message .WxCpMessageSendResult ;
7
- import me .chanjar .weixin .cp .bean .message .WxCpMessageSendStatistics ;
4
+ import me .chanjar .weixin .cp .bean .message .*;
8
5
9
6
/**
10
7
* 消息推送接口.
@@ -52,5 +49,5 @@ public interface WxCpMessageService {
52
49
* @return the wx cp message send result
53
50
* @throws WxErrorException the wx error exception
54
51
*/
55
- WxCpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException ;
52
+ WxCpLinkedCorpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException ;
56
53
}
Original file line number Diff line number Diff line change 5
5
import me .chanjar .weixin .common .error .WxErrorException ;
6
6
import me .chanjar .weixin .cp .api .WxCpMessageService ;
7
7
import me .chanjar .weixin .cp .api .WxCpService ;
8
- import me .chanjar .weixin .cp .bean .message .WxCpLinkedCorpMessage ;
9
- import me .chanjar .weixin .cp .bean .message .WxCpMessage ;
10
- import me .chanjar .weixin .cp .bean .message .WxCpMessageSendResult ;
11
- import me .chanjar .weixin .cp .bean .message .WxCpMessageSendStatistics ;
8
+ import me .chanjar .weixin .cp .bean .message .*;
12
9
import me .chanjar .weixin .cp .constant .WxCpApiPathConsts .Message ;
13
10
import me .chanjar .weixin .cp .util .json .WxCpGsonBuilder ;
14
11
@@ -40,13 +37,13 @@ public WxCpMessageSendStatistics getStatistics(int timeType) throws WxErrorExcep
40
37
}
41
38
42
39
@ Override
43
- public WxCpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException {
40
+ public WxCpLinkedCorpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException {
44
41
Integer agentId = message .getAgentId ();
45
42
if (null == agentId ) {
46
43
message .setAgentId (this .cpService .getWxCpConfigStorage ().getAgentId ());
47
44
}
48
45
49
- return WxCpMessageSendResult .fromJson (this .cpService .post (this .cpService .getWxCpConfigStorage ()
46
+ return WxCpLinkedCorpMessageSendResult .fromJson (this .cpService .post (this .cpService .getWxCpConfigStorage ()
50
47
.getApiUrl (Message .LINKEDCORP_MESSAGE_SEND ), message .toJson ()));
51
48
}
52
49
}
Original file line number Diff line number Diff line change
1
+ package me .chanjar .weixin .cp .bean .message ;
2
+
3
+ import com .google .gson .annotations .SerializedName ;
4
+ import lombok .Getter ;
5
+ import lombok .Setter ;
6
+ import me .chanjar .weixin .cp .bean .WxCpBaseResp ;
7
+ import me .chanjar .weixin .cp .util .json .WxCpGsonBuilder ;
8
+
9
+ /**
10
+ * 互联企业的消息推送接口返回实体
11
+ *
12
+ * @author pg
13
+ * @date 2021年6月22日
14
+ */
15
+ @ Setter
16
+ @ Getter
17
+ public class WxCpLinkedCorpMessageSendResult extends WxCpBaseResp {
18
+ private static final long serialVersionUID = 3990693822996824333L ;
19
+
20
+ @ SerializedName ("invaliduser" )
21
+ private String [] invalidUser ;
22
+
23
+ @ SerializedName ("invalidparty" )
24
+ private String [] invalidParty ;
25
+
26
+ @ SerializedName ("invalidtag" )
27
+ private String [] invalidTag ;
28
+
29
+ @ Override
30
+ public String toString () {
31
+ return WxCpGsonBuilder .create ().toJson (this );
32
+ }
33
+
34
+ public static WxCpLinkedCorpMessageSendResult fromJson (String json ) {
35
+ return WxCpGsonBuilder .create ().fromJson (json , WxCpLinkedCorpMessageSendResult .class );
36
+ }
37
+
38
+ }
You can’t perform that action at this time.
0 commit comments