|
1 | 1 | package me.chanjar.weixin.cp.api.impl;
|
2 | 2 |
|
3 | 3 | import com.google.gson.JsonObject;
|
| 4 | +import lombok.NonNull; |
4 | 5 | import lombok.RequiredArgsConstructor;
|
5 | 6 | import lombok.extern.slf4j.Slf4j;
|
6 | 7 | import me.chanjar.weixin.common.error.WxErrorException;
|
7 | 8 | import me.chanjar.weixin.cp.api.WxCpSchoolService;
|
8 | 9 | import me.chanjar.weixin.cp.api.WxCpService;
|
9 |
| -import me.chanjar.weixin.cp.bean.school.WxCpCustomizeHealthInfo; |
10 |
| -import me.chanjar.weixin.cp.bean.school.WxCpPaymentResult; |
11 |
| -import me.chanjar.weixin.cp.bean.school.WxCpResultList; |
12 |
| -import me.chanjar.weixin.cp.bean.school.WxCpTrade; |
| 10 | +import me.chanjar.weixin.cp.bean.living.WxCpLivingResult; |
| 11 | +import me.chanjar.weixin.cp.bean.school.*; |
| 12 | +import org.apache.commons.lang3.StringUtils; |
13 | 13 |
|
14 | 14 | import javax.validation.constraints.NotNull;
|
15 | 15 | import java.util.List;
|
@@ -85,4 +85,45 @@ public WxCpTrade getTrade(@NotNull String paymentId, @NotNull String tradeNo) th
|
85 | 85 | return WxCpTrade.fromJson(responseContent);
|
86 | 86 | }
|
87 | 87 |
|
| 88 | + @Override |
| 89 | + public WxCpSchoolLivingInfo getLivingInfo(@NotNull String livingId) throws WxErrorException { |
| 90 | + String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_LIVING_INFO) + livingId; |
| 91 | + String responseContent = this.cpService.get(apiUrl, null); |
| 92 | + return WxCpSchoolLivingInfo.fromJson(responseContent); |
| 93 | + } |
| 94 | + |
| 95 | + @Override |
| 96 | + public WxCpLivingResult.LivingIdResult getUserAllLivingId(@NonNull String userId, String cursor, Integer limit) throws WxErrorException { |
| 97 | + return this.cpService.getLivingService().getUserAllLivingId(userId, cursor, limit); |
| 98 | + } |
| 99 | + |
| 100 | + @Override |
| 101 | + public WxCpSchoolWatchStat getWatchStat(@NonNull String livingId, String nextKey) throws WxErrorException { |
| 102 | + String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_WATCH_STAT); |
| 103 | + JsonObject jsonObject = new JsonObject(); |
| 104 | + if (StringUtils.isNotBlank(nextKey)) { |
| 105 | + jsonObject.addProperty("next_key", nextKey); |
| 106 | + } |
| 107 | + jsonObject.addProperty("livingid", livingId); |
| 108 | + String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); |
| 109 | + return WxCpSchoolWatchStat.fromJson(responseContent); |
| 110 | + } |
| 111 | + |
| 112 | + @Override |
| 113 | + public WxCpSchoolUnwatchStat getUnwatchStat(@NonNull String livingId, String nextKey) throws WxErrorException { |
| 114 | + String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_UNWATCH_STAT); |
| 115 | + JsonObject jsonObject = new JsonObject(); |
| 116 | + if (StringUtils.isNotBlank(nextKey)) { |
| 117 | + jsonObject.addProperty("next_key", nextKey); |
| 118 | + } |
| 119 | + jsonObject.addProperty("livingid", livingId); |
| 120 | + String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); |
| 121 | + return WxCpSchoolUnwatchStat.fromJson(responseContent); |
| 122 | + } |
| 123 | + |
| 124 | + @Override |
| 125 | + public WxCpLivingResult deleteReplayData(@NonNull String livingId) throws WxErrorException { |
| 126 | + return cpService.getLivingService().deleteReplayData(livingId); |
| 127 | + } |
| 128 | + |
88 | 129 | }
|
0 commit comments