From 521ea08ba949f608fba3f59633ebfa6211625b46 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 9 Jan 2023 09:32:37 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E7=A7=BB=E9=99=A4=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/cp/api/WxCpSchoolService.java | 22 +++++++++---------- .../cp/api/impl/WxCpSchoolServiceImpl.java | 22 +++++++++---------- .../weixin/cp/tp/service/WxCpTpService.java | 4 +--- .../service/impl/BaseWxCpTpServiceImpl.java | 4 +--- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolService.java index 4528abb11..56687c9cb 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolService.java @@ -1,11 +1,9 @@ package me.chanjar.weixin.cp.api; -import lombok.NonNull; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.cp.bean.living.WxCpLivingResult; import me.chanjar.weixin.cp.bean.school.*; -import javax.validation.constraints.NotNull; import java.util.List; /** @@ -30,7 +28,7 @@ public interface WxCpSchoolService { * @return teacher customize health info * @throws WxErrorException the wx error exception */ - WxCpCustomizeHealthInfo getTeacherCustomizeHealthInfo(@NotNull String date, String nextKey, Integer limit) throws WxErrorException; + WxCpCustomizeHealthInfo getTeacherCustomizeHealthInfo(String date, String nextKey, Integer limit) throws WxErrorException; /** * 获取学生健康信息 @@ -43,7 +41,7 @@ public interface WxCpSchoolService { * @return student customize health info * @throws WxErrorException the wx error exception */ - WxCpCustomizeHealthInfo getStudentCustomizeHealthInfo(@NotNull String date, String nextKey, Integer limit) throws WxErrorException; + WxCpCustomizeHealthInfo getStudentCustomizeHealthInfo(String date, String nextKey, Integer limit) throws WxErrorException; /** * 获取师生健康码 @@ -55,7 +53,7 @@ public interface WxCpSchoolService { * @return health qr code * @throws WxErrorException the wx error exception */ - WxCpResultList getHealthQrCode(@NotNull List userIds, @NotNull Integer type) throws WxErrorException; + WxCpResultList getHealthQrCode(List userIds, Integer type) throws WxErrorException; /** * 获取学生付款结果 @@ -66,7 +64,7 @@ public interface WxCpSchoolService { * @return payment result * @throws WxErrorException the wx error exception */ - WxCpPaymentResult getPaymentResult(@NotNull String paymentId) throws WxErrorException; + WxCpPaymentResult getPaymentResult(String paymentId) throws WxErrorException; /** * 获取订单详情 @@ -78,7 +76,7 @@ public interface WxCpSchoolService { * @return trade * @throws WxErrorException the wx error exception */ - WxCpTrade getTrade(@NotNull String paymentId, @NotNull String tradeNo) throws WxErrorException; + WxCpTrade getTrade(String paymentId, String tradeNo) throws WxErrorException; /** * 获取直播详情 @@ -90,7 +88,7 @@ public interface WxCpSchoolService { * @return living info * @throws WxErrorException the wx error exception */ - WxCpSchoolLivingInfo getLivingInfo(@NotNull String livingId) throws WxErrorException; + WxCpSchoolLivingInfo getLivingInfo(String livingId) throws WxErrorException; /** * 获取老师直播ID列表 @@ -105,7 +103,7 @@ public interface WxCpSchoolService { * @return user all living id * @throws WxErrorException the wx error exception */ - WxCpLivingResult.LivingIdResult getUserAllLivingId(@NonNull String userId, String cursor, Integer limit) throws WxErrorException; + WxCpLivingResult.LivingIdResult getUserAllLivingId(String userId, String cursor, Integer limit) throws WxErrorException; /** * 获取观看直播统计 @@ -119,7 +117,7 @@ public interface WxCpSchoolService { * @return watch stat * @throws WxErrorException the wx error exception */ - WxCpSchoolWatchStat getWatchStat(@NonNull String livingId, String nextKey) throws WxErrorException; + WxCpSchoolWatchStat getWatchStat(String livingId, String nextKey) throws WxErrorException; /** * 获取未观看直播统计 @@ -133,7 +131,7 @@ public interface WxCpSchoolService { * @return unwatch stat * @throws WxErrorException the wx error exception */ - WxCpSchoolUnwatchStat getUnwatchStat(@NonNull String livingId, String nextKey) throws WxErrorException; + WxCpSchoolUnwatchStat getUnwatchStat(String livingId, String nextKey) throws WxErrorException; /** * 删除直播回放 @@ -144,6 +142,6 @@ public interface WxCpSchoolService { * @return wx cp living result * @throws WxErrorException the wx error exception */ - WxCpLivingResult deleteReplayData(@NonNull String livingId) throws WxErrorException; + WxCpLivingResult deleteReplayData(String livingId) throws WxErrorException; } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolServiceImpl.java index 7d8cadca3..c503aebdf 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolServiceImpl.java @@ -1,7 +1,6 @@ package me.chanjar.weixin.cp.api.impl; import com.google.gson.JsonObject; -import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; @@ -11,7 +10,6 @@ import me.chanjar.weixin.cp.bean.living.WxCpLivingResult; import me.chanjar.weixin.cp.bean.school.*; import org.apache.commons.lang3.StringUtils; -import javax.validation.constraints.NotNull; import java.util.List; import java.util.Optional; @@ -30,7 +28,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { private final WxCpService cpService; @Override - public WxCpCustomizeHealthInfo getTeacherCustomizeHealthInfo(@NotNull String date, String nextKey, Integer limit) throws WxErrorException { + public WxCpCustomizeHealthInfo getTeacherCustomizeHealthInfo(String date, String nextKey, Integer limit) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_TEACHER_CUSTOMIZE_HEALTH_INFO); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("date", date); @@ -43,7 +41,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpCustomizeHealthInfo getStudentCustomizeHealthInfo(@NotNull String date, String nextKey, Integer limit) throws WxErrorException { + public WxCpCustomizeHealthInfo getStudentCustomizeHealthInfo(String date, String nextKey, Integer limit) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_STUDENT_CUSTOMIZE_HEALTH_INFO); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("date", date); @@ -56,7 +54,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpResultList getHealthQrCode(@NotNull List userIds, @NotNull Integer type) throws WxErrorException { + public WxCpResultList getHealthQrCode(List userIds, Integer type) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_HEALTH_QRCODE); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("type", type); @@ -66,7 +64,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpPaymentResult getPaymentResult(@NotNull String paymentId) throws WxErrorException { + public WxCpPaymentResult getPaymentResult(String paymentId) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_PAYMENT_RESULT); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("payment_id", paymentId); @@ -75,7 +73,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpTrade getTrade(@NotNull String paymentId, @NotNull String tradeNo) throws WxErrorException { + public WxCpTrade getTrade(String paymentId, String tradeNo) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_TRADE); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("payment_id", paymentId); @@ -85,19 +83,19 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpSchoolLivingInfo getLivingInfo(@NotNull String livingId) throws WxErrorException { + public WxCpSchoolLivingInfo getLivingInfo(String livingId) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_LIVING_INFO) + livingId; String responseContent = this.cpService.get(apiUrl, null); return WxCpSchoolLivingInfo.fromJson(responseContent); } @Override - public WxCpLivingResult.LivingIdResult getUserAllLivingId(@NonNull String userId, String cursor, Integer limit) throws WxErrorException { + public WxCpLivingResult.LivingIdResult getUserAllLivingId(String userId, String cursor, Integer limit) throws WxErrorException { return this.cpService.getLivingService().getUserAllLivingId(userId, cursor, limit); } @Override - public WxCpSchoolWatchStat getWatchStat(@NonNull String livingId, String nextKey) throws WxErrorException { + public WxCpSchoolWatchStat getWatchStat(String livingId, String nextKey) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_WATCH_STAT); JsonObject jsonObject = new JsonObject(); if (StringUtils.isNotBlank(nextKey)) { @@ -109,7 +107,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpSchoolUnwatchStat getUnwatchStat(@NonNull String livingId, String nextKey) throws WxErrorException { + public WxCpSchoolUnwatchStat getUnwatchStat(String livingId, String nextKey) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_UNWATCH_STAT); JsonObject jsonObject = new JsonObject(); if (StringUtils.isNotBlank(nextKey)) { @@ -121,7 +119,7 @@ public class WxCpSchoolServiceImpl implements WxCpSchoolService { } @Override - public WxCpLivingResult deleteReplayData(@NonNull String livingId) throws WxErrorException { + public WxCpLivingResult deleteReplayData(String livingId) throws WxErrorException { return cpService.getLivingService().deleteReplayData(livingId); } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java index 6805d43b4..f86426876 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java @@ -10,8 +10,6 @@ import me.chanjar.weixin.common.util.http.RequestHttp; import me.chanjar.weixin.cp.bean.*; import me.chanjar.weixin.cp.config.WxCpTpConfigStorage; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; import java.util.List; /** @@ -403,7 +401,7 @@ public interface WxCpTpService { * @return customized auth url * @throws WxErrorException the wx error exception */ - WxTpCustomizedAuthUrl getCustomizedAuthUrl(@NotBlank String state, @NotEmpty List templateIdList) throws WxErrorException; + WxTpCustomizedAuthUrl getCustomizedAuthUrl(String state, List templateIdList) throws WxErrorException; /** * 获取服务商providerToken diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java index 3faa718cd..06f919aa6 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/impl/BaseWxCpTpServiceImpl.java @@ -28,8 +28,6 @@ import me.chanjar.weixin.cp.config.WxCpTpConfigStorage; import me.chanjar.weixin.cp.tp.service.*; import org.apache.commons.lang3.StringUtils; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; import java.io.File; import java.io.IOException; import java.net.URLEncoder; @@ -540,7 +538,7 @@ public abstract class BaseWxCpTpServiceImpl implements WxCpTpService, Requ } @Override - public WxTpCustomizedAuthUrl getCustomizedAuthUrl(@NotBlank String state, @NotEmpty List templateIdList) throws WxErrorException { + public WxTpCustomizedAuthUrl getCustomizedAuthUrl(String state, List templateIdList) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("state", state); jsonObject.add("templateid_list", WxGsonBuilder.create().toJsonTree(templateIdList).getAsJsonArray());