File tree Expand file tree Collapse file tree
weixin-java-cp/src/main/java/me/chanjar/weixin/cp Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package me .chanjar .weixin .cp .api ;
22
33import 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 .*;
85
96/**
107 * 消息推送接口.
@@ -52,5 +49,5 @@ public interface WxCpMessageService {
5249 * @return the wx cp message send result
5350 * @throws WxErrorException the wx error exception
5451 */
55- WxCpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException ;
52+ WxCpLinkedCorpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException ;
5653}
Original file line number Diff line number Diff line change 55import me .chanjar .weixin .common .error .WxErrorException ;
66import me .chanjar .weixin .cp .api .WxCpMessageService ;
77import 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 .*;
129import me .chanjar .weixin .cp .constant .WxCpApiPathConsts .Message ;
1310import me .chanjar .weixin .cp .util .json .WxCpGsonBuilder ;
1411
@@ -40,13 +37,13 @@ public WxCpMessageSendStatistics getStatistics(int timeType) throws WxErrorExcep
4037 }
4138
4239 @ Override
43- public WxCpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException {
40+ public WxCpLinkedCorpMessageSendResult sendLinkedCorpMessage (WxCpLinkedCorpMessage message ) throws WxErrorException {
4441 Integer agentId = message .getAgentId ();
4542 if (null == agentId ) {
4643 message .setAgentId (this .cpService .getWxCpConfigStorage ().getAgentId ());
4744 }
4845
49- return WxCpMessageSendResult .fromJson (this .cpService .post (this .cpService .getWxCpConfigStorage ()
46+ return WxCpLinkedCorpMessageSendResult .fromJson (this .cpService .post (this .cpService .getWxCpConfigStorage ()
5047 .getApiUrl (Message .LINKEDCORP_MESSAGE_SEND ), message .toJson ()));
5148 }
5249}
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