Explorar o código

:art: 清理一些jetbrain的校验注解

Binary Wang %!s(int64=2) %!d(string=hai) anos
pai
achega
7219c2dbd0

+ 3 - 5
weixin-java-common/src/main/java/me/chanjar/weixin/common/util/locks/RedisTemplateSimpleDistributedLock.java

@@ -1,8 +1,6 @@
 package me.chanjar.weixin.common.util.locks;
 
 import lombok.Getter;
-import lombok.NonNull;
-import org.jetbrains.annotations.NotNull;
 import org.springframework.data.redis.connection.RedisStringCommands;
 import org.springframework.data.redis.core.RedisCallback;
 import org.springframework.data.redis.core.StringRedisTemplate;
@@ -34,11 +32,11 @@ public class RedisTemplateSimpleDistributedLock implements Lock {
 
   private final ThreadLocal<String> valueThreadLocal = new ThreadLocal<>();
 
-  public RedisTemplateSimpleDistributedLock(@NonNull StringRedisTemplate redisTemplate, int leaseMilliseconds) {
+  public RedisTemplateSimpleDistributedLock( StringRedisTemplate redisTemplate, int leaseMilliseconds) {
     this(redisTemplate, "lock:" + UUID.randomUUID().toString(), leaseMilliseconds);
   }
 
-  public RedisTemplateSimpleDistributedLock(@NonNull StringRedisTemplate redisTemplate, @NonNull String key, int leaseMilliseconds) {
+  public RedisTemplateSimpleDistributedLock( StringRedisTemplate redisTemplate,  String key, int leaseMilliseconds) {
     if (leaseMilliseconds <= 0) {
       throw new IllegalArgumentException("Parameter 'leaseMilliseconds' must grate then 0: " + leaseMilliseconds);
     }
@@ -84,7 +82,7 @@ public class RedisTemplateSimpleDistributedLock implements Lock {
   }
 
   @Override
-  public boolean tryLock(long time, @NotNull TimeUnit unit) throws InterruptedException {
+  public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
     long waitMs = unit.toMillis(time);
     boolean locked = tryLock();
     while (!locked && waitMs > 0) {

+ 19 - 21
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java

@@ -1,12 +1,10 @@
 package me.chanjar.weixin.cp.api;
 
-import lombok.NonNull;
 import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.cp.bean.WxCpBaseResp;
 import me.chanjar.weixin.cp.bean.external.*;
 import me.chanjar.weixin.cp.bean.external.contact.*;
-import org.jetbrains.annotations.NotNull;
 
 import java.io.File;
 import java.io.IOException;
@@ -42,7 +40,7 @@ public interface WxCpExternalContactService {
    * @return wx cp contact way result
    * @throws WxErrorException the wx error exception
    */
-  WxCpContactWayResult addContactWay(@NonNull WxCpContactWayInfo info) throws WxErrorException;
+  WxCpContactWayResult addContactWay(WxCpContactWayInfo info) throws WxErrorException;
 
   /**
    * 获取企业已配置的「联系我」方式
@@ -55,7 +53,7 @@ public interface WxCpExternalContactService {
    * @return contact way
    * @throws WxErrorException the wx error exception
    */
-  WxCpContactWayInfo getContactWay(@NonNull String configId) throws WxErrorException;
+  WxCpContactWayInfo getContactWay(String configId) throws WxErrorException;
 
   /**
    * 更新企业已配置的「联系我」方式
@@ -68,7 +66,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpBaseResp updateContactWay(@NonNull WxCpContactWayInfo info) throws WxErrorException;
+  WxCpBaseResp updateContactWay(WxCpContactWayInfo info) throws WxErrorException;
 
   /**
    * 删除企业已配置的「联系我」方式
@@ -81,7 +79,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpBaseResp deleteContactWay(@NonNull String configId) throws WxErrorException;
+  WxCpBaseResp deleteContactWay(String configId) throws WxErrorException;
 
   /**
    * 结束临时会话
@@ -97,7 +95,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpBaseResp closeTempChat(@NonNull String userId, @NonNull String externalUserId) throws WxErrorException;
+  WxCpBaseResp closeTempChat(String userId, String externalUserId) throws WxErrorException;
 
 
   /**
@@ -170,7 +168,7 @@ public interface WxCpExternalContactService {
    * @return 该企业的外部联系人ID string
    * @throws WxErrorException .
    */
-  String unionidToExternalUserid(@NotNull String unionid, String openid) throws WxErrorException;
+  String unionidToExternalUserid(String unionid, String openid) throws WxErrorException;
 
   /**
    * 配置客户群进群方式
@@ -185,7 +183,7 @@ public interface WxCpExternalContactService {
    * @return {@link WxCpGroupJoinWayResult}
    * @throws WxErrorException the wx error exception
    */
-  WxCpGroupJoinWayResult addJoinWay(@NonNull WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
+  WxCpGroupJoinWayResult addJoinWay(WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
 
   /**
    * 更新客户群进群方式配置
@@ -196,7 +194,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpBaseResp updateJoinWay(@NonNull WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
+  WxCpBaseResp updateJoinWay(WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
 
   /**
    * 获取客户群进群方式配置
@@ -207,7 +205,7 @@ public interface WxCpExternalContactService {
    * @return join way
    * @throws WxErrorException the wx error exception
    */
-  WxCpGroupJoinWayInfo getJoinWay(@NonNull String configId) throws WxErrorException;
+  WxCpGroupJoinWayInfo getJoinWay(String configId) throws WxErrorException;
 
   /**
    * 删除客户群进群方式配置
@@ -217,7 +215,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpBaseResp delJoinWay(@NonNull String configId) throws WxErrorException;
+  WxCpBaseResp delJoinWay(String configId) throws WxErrorException;
 
   /**
    * 代开发应用external_userid转换
@@ -239,7 +237,7 @@ public interface WxCpExternalContactService {
    * @return 该服务商第三方应用下的企业的外部联系人ID string
    * @throws WxErrorException .
    */
-  String toServiceExternalUserid(@NotNull String externalUserid) throws WxErrorException;
+  String toServiceExternalUserid(String externalUserid) throws WxErrorException;
 
   /**
    * 企业客户微信unionid的升级 - unionid查询external_userid
@@ -265,7 +263,7 @@ public interface WxCpExternalContactService {
    * @return 该服务商第三方应用下的企业的外部联系人ID wx cp external user id list
    * @throws WxErrorException .
    */
-  WxCpExternalUserIdList unionidToExternalUserid3rd(@NotNull String unionid, @NotNull String openid, String corpid) throws WxErrorException;
+  WxCpExternalUserIdList unionidToExternalUserid3rd(String unionid, String openid, String corpid) throws WxErrorException;
 
   /**
    * 转换external_userid
@@ -308,7 +306,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException .
    */
-  WxCpBaseResp finishExternalUserIdMigration(@NotNull String corpid) throws WxErrorException;
+  WxCpBaseResp finishExternalUserIdMigration(String corpid) throws WxErrorException;
 
   /**
    * 客户群opengid转换
@@ -333,7 +331,7 @@ public interface WxCpExternalContactService {
    * @return 客户群ID ,可以用来调用获取客户群详情
    * @throws WxErrorException .
    */
-  String opengidToChatid(@NotNull String opengid) throws WxErrorException;
+  String opengidToChatid(String opengid) throws WxErrorException;
 
   /**
    * 批量获取客户详情.
@@ -472,7 +470,7 @@ public interface WxCpExternalContactService {
    * @return 客户转接接口实体 wx cp user transfer result resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpUserTransferResultResp transferResult(@NotNull String handOverUserid, @NotNull String takeOverUserid,
+  WxCpUserTransferResultResp transferResult(String handOverUserid, String takeOverUserid,
                                             String cursor) throws WxErrorException;
 
   /**
@@ -513,7 +511,7 @@ public interface WxCpExternalContactService {
    * @return 客户转接接口实体 wx cp user transfer result resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpUserTransferResultResp resignedTransferResult(@NotNull String handOverUserid, @NotNull String takeOverUserid,
+  WxCpUserTransferResultResp resignedTransferResult(String handOverUserid, String takeOverUserid,
                                                     String cursor) throws WxErrorException;
 
   /**
@@ -890,7 +888,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpGroupMsgListResult getGroupMsgListV2(String chatType, @NonNull Date startTime, @NonNull Date endTime,
+  WxCpGroupMsgListResult getGroupMsgListV2(String chatType, Date startTime, Date endTime,
                                            String creator, Integer filterType, Integer limit, String cursor) throws WxErrorException;
 
   /**
@@ -970,7 +968,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(@NotNull String templateId) throws WxErrorException;
+  WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(String templateId) throws WxErrorException;
 
   /**
    * <pre>
@@ -984,7 +982,7 @@ public interface WxCpExternalContactService {
    * @return wx cp base resp
    * @throws WxErrorException the wx error exception
    */
-  WxCpBaseResp delGroupWelcomeTemplate(@NotNull String templateId, String agentId) throws WxErrorException;
+  WxCpBaseResp delGroupWelcomeTemplate(String templateId, String agentId) throws WxErrorException;
 
   /**
    * <pre>

+ 20 - 22
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java

@@ -2,7 +2,6 @@ package me.chanjar.weixin.cp.api.impl;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonObject;
-import lombok.NonNull;
 import lombok.RequiredArgsConstructor;
 import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
 import me.chanjar.weixin.common.error.WxCpErrorMsgEnum;
@@ -19,7 +18,6 @@ import me.chanjar.weixin.cp.bean.external.*;
 import me.chanjar.weixin.cp.bean.external.contact.*;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.jetbrains.annotations.NotNull;
 
 import java.io.File;
 import java.io.IOException;
@@ -41,7 +39,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   private final WxCpService mainService;
 
   @Override
-  public WxCpContactWayResult addContactWay(@NonNull WxCpContactWayInfo info) throws WxErrorException {
+  public WxCpContactWayResult addContactWay(WxCpContactWayInfo info) throws WxErrorException {
 
     if (info.getContactWay().getUsers() != null && info.getContactWay().getUsers().size() > 100) {
       throw new WxRuntimeException("「联系我」使用人数默认限制不超过100人(包括部门展开后的人数)");
@@ -54,7 +52,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpContactWayInfo getContactWay(@NonNull String configId) throws WxErrorException {
+  public WxCpContactWayInfo getContactWay(String configId) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("config_id", configId);
 
@@ -64,7 +62,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpBaseResp updateContactWay(@NonNull WxCpContactWayInfo info) throws WxErrorException {
+  public WxCpBaseResp updateContactWay(WxCpContactWayInfo info) throws WxErrorException {
     if (StringUtils.isBlank(info.getContactWay().getConfigId())) {
       throw new WxRuntimeException("更新「联系我」方式需要指定configId");
     }
@@ -79,7 +77,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpBaseResp deleteContactWay(@NonNull String configId) throws WxErrorException {
+  public WxCpBaseResp deleteContactWay(String configId) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("config_id", configId);
 
@@ -90,7 +88,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpBaseResp closeTempChat(@NonNull String userId, @NonNull String externalUserId) throws WxErrorException {
+  public WxCpBaseResp closeTempChat(String userId, String externalUserId) throws WxErrorException {
 
     JsonObject json = new JsonObject();
     json.addProperty("userid", userId);
@@ -122,7 +120,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public String convertToOpenid(@NotNull String externalUserId) throws WxErrorException {
+  public String convertToOpenid(String externalUserId) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("external_userid", externalUserId);
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(CONVERT_TO_OPENID);
@@ -132,7 +130,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public String unionidToExternalUserid(@NotNull String unionid, String openid) throws WxErrorException {
+  public String unionidToExternalUserid(String unionid, String openid) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("unionid", unionid);
     if (StringUtils.isNotEmpty(openid)) {
@@ -145,7 +143,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public String toServiceExternalUserid(@NotNull String externalUserid) throws WxErrorException {
+  public String toServiceExternalUserid(String externalUserid) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("external_userid", externalUserid);
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(TO_SERVICE_EXTERNAL_USERID);
@@ -155,7 +153,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpExternalUserIdList unionidToExternalUserid3rd(@NotNull String unionid, @NotNull String openid,
+  public WxCpExternalUserIdList unionidToExternalUserid3rd(String unionid, String openid,
                                                            String corpid) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("unionid", unionid);
@@ -180,7 +178,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpBaseResp finishExternalUserIdMigration(@NotNull String corpid) throws WxErrorException {
+  public WxCpBaseResp finishExternalUserIdMigration(String corpid) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("corpid", corpid);
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(FINISH_EXTERNAL_USERID_MIGRATION);
@@ -189,7 +187,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public String opengidToChatid(@NotNull String opengid) throws WxErrorException {
+  public String opengidToChatid(String opengid) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("opengid", opengid);
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(OPENID_TO_CHATID);
@@ -280,7 +278,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpUserTransferResultResp transferResult(@NotNull String handOverUserid, @NotNull String takeOverUserid,
+  public WxCpUserTransferResultResp transferResult(String handOverUserid, String takeOverUserid,
                                                    String cursor) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("cursor", cursor);
@@ -300,8 +298,8 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpUserTransferResultResp resignedTransferResult(@NotNull String handOverUserid,
-                                                           @NotNull String takeOverUserid, String cursor) throws WxErrorException {
+  public WxCpUserTransferResultResp resignedTransferResult(String handOverUserid,
+                                                           String takeOverUserid, String cursor) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("cursor", cursor);
     json.addProperty("handover_userid", handOverUserid);
@@ -638,7 +636,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
    * @throws WxErrorException the wx error exception
    */
   @Override
-  public WxCpGroupMsgListResult getGroupMsgListV2(String chatType, @NonNull Date startTime, @NonNull Date endTime,
+  public WxCpGroupMsgListResult getGroupMsgListV2(String chatType, Date startTime, Date endTime,
                                                   String creator, Integer filterType, Integer limit, String cursor) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("chat_type", chatType);
@@ -774,7 +772,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
    * @throws WxErrorException the wx error exception
    */
   @Override
-  public WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(@NotNull String templateId) throws WxErrorException {
+  public WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(String templateId) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("template_id", templateId);
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_WELCOME_TEMPLATE_GET);
@@ -795,7 +793,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
    * @throws WxErrorException the wx error exception
    */
   @Override
-  public WxCpBaseResp delGroupWelcomeTemplate(@NotNull String templateId, String agentId) throws WxErrorException {
+  public WxCpBaseResp delGroupWelcomeTemplate(String templateId, String agentId) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("template_id", templateId);
     if (!StringUtils.isEmpty(agentId)) {
@@ -908,7 +906,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpGroupJoinWayResult addJoinWay(@NonNull WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException {
+  public WxCpGroupJoinWayResult addJoinWay(WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException {
     if (wxCpGroupJoinWayInfo.getJoinWay().getChatIdList() != null && wxCpGroupJoinWayInfo.getJoinWay().getChatIdList().size() > 5) {
       throw new WxRuntimeException("使用该配置的客户群ID列表,支持5个");
     }
@@ -919,7 +917,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpBaseResp updateJoinWay(@NonNull WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException {
+  public WxCpBaseResp updateJoinWay(WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException {
     if (wxCpGroupJoinWayInfo.getJoinWay().getChatIdList() != null && wxCpGroupJoinWayInfo.getJoinWay().getChatIdList().size() > 5) {
       throw new WxRuntimeException("使用该配置的客户群ID列表,支持5个");
     }
@@ -939,7 +937,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
   }
 
   @Override
-  public WxCpBaseResp delJoinWay(@NonNull String configId) throws WxErrorException {
+  public WxCpBaseResp delJoinWay(String configId) throws WxErrorException {
     JsonObject json = new JsonObject();
     json.addProperty("config_id", configId);
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEL_JOIN_WAY);

+ 0 - 2
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaInternetServiceImpl.java

@@ -9,7 +9,6 @@ import lombok.RequiredArgsConstructor;
 import me.chanjar.weixin.common.enums.WxType;
 import me.chanjar.weixin.common.error.WxError;
 import me.chanjar.weixin.common.error.WxErrorException;
-import org.jetbrains.annotations.NotNull;
 
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
@@ -54,7 +53,6 @@ public class WxMaInternetServiceImpl implements WxMaInternetService {
     return getWxMaInternetResponse(url);
   }
 
-  @NotNull
   private WxMaInternetResponse getWxMaInternetResponse(String url) throws WxErrorException {
     String responseContent = this.wxMaService.post(url, "");
     WxMaInternetResponse response = WxMaGsonBuilder.create().fromJson(responseContent, WxMaInternetResponse.class);

+ 0 - 2
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryEnum.java

@@ -2,7 +2,6 @@ package me.chanjar.weixin.mp.bean.template;
 
 import lombok.AllArgsConstructor;
 import lombok.Getter;
-import org.jetbrains.annotations.Nullable;
 
 import java.util.Objects;
 
@@ -200,7 +199,6 @@ public enum WxMpTemplateIndustryEnum {
    * @param secondClass 副行业名称
    * @return 如果找不到, 返回null
    */
-  @Nullable
   public static WxMpTemplateIndustryEnum findByClass(String firstClass, String secondClass) {
     for (WxMpTemplateIndustryEnum industryEnum : WxMpTemplateIndustryEnum.values()) {
       if (industryEnum.firstClass.equals(firstClass) && industryEnum.secondClass.contains(secondClass)) {

+ 1 - 2
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenComponentService.java

@@ -19,7 +19,6 @@ import me.chanjar.weixin.open.bean.tcb.ShareCloudBaseEnvRequest;
 import me.chanjar.weixin.open.bean.tcb.ShareCloudBaseEnvResponse;
 import me.chanjar.weixin.open.bean.tcbComponent.GetShareCloudBaseEnvResponse;
 import me.chanjar.weixin.open.bean.tcbComponent.GetTcbEnvListResponse;
-import org.jetbrains.annotations.Nullable;
 
 import java.io.File;
 import java.util.List;
@@ -500,7 +499,7 @@ public interface WxOpenComponentService {
    * @return 小程序代码模版列表 (templateId)
    * @throws WxErrorException 获取失败时返回,具体错误码请看此接口的注释文档
    */
-  List<WxOpenMaCodeTemplate> getTemplateList(@Nullable Integer templateType) throws WxErrorException;
+  List<WxOpenMaCodeTemplate> getTemplateList(Integer templateType) throws WxErrorException;
 
   /**
    * 请参考并使用 {@link #addToTemplate(long, int)}.

+ 1 - 2
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaPrivacyService.java

@@ -2,7 +2,6 @@ package me.chanjar.weixin.open.api;
 
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.open.bean.ma.privacy.*;
-import org.jetbrains.annotations.Nullable;
 
 /**
  * 微信第三方平台 小程序用户隐私保护指引接口 / 申请隐私接口(从2022年4月18日开始,部分小程序前端 api 需申请后,方可使用。该接口用于获取“需申请并审核通过”后才可使用的接口列表。)
@@ -47,7 +46,7 @@ public interface WxOpenMaPrivacyService {
    * @return 查询结果
    * @throws WxErrorException 如果出错,抛出此异常
    */
-  GetPrivacySettingResult getPrivacySetting(@Nullable Integer privacyVer) throws WxErrorException;
+  GetPrivacySettingResult getPrivacySetting(Integer privacyVer) throws WxErrorException;
 
 
   /**

+ 1 - 2
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java

@@ -35,7 +35,6 @@ import me.chanjar.weixin.open.bean.tcbComponent.GetShareCloudBaseEnvResponse;
 import me.chanjar.weixin.open.bean.tcbComponent.GetTcbEnvListResponse;
 import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder;
 import org.apache.commons.lang3.StringUtils;
-import org.jetbrains.annotations.Nullable;
 
 import java.io.File;
 import java.math.BigDecimal;
@@ -503,7 +502,7 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
   }
 
   @Override
-  public List<WxOpenMaCodeTemplate> getTemplateList(@Nullable Integer templateType) throws WxErrorException {
+  public List<WxOpenMaCodeTemplate> getTemplateList(Integer templateType) throws WxErrorException {
     String url = GET_TEMPLATE_LIST_URL + (templateType == null ? "" : "?template_type=" + templateType);
     String responseContent = get(url, "access_token");
     JsonObject response = GsonParser.parse(StringUtils.defaultString(responseContent, "{}"));

+ 2 - 3
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaPrivacyServiceImpl.java

@@ -8,7 +8,6 @@ import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.open.api.WxOpenMaPrivacyService;
 import me.chanjar.weixin.open.bean.ma.privacy.*;
 import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder;
-import org.jetbrains.annotations.Nullable;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -26,8 +25,8 @@ public class WxOpenMaPrivacyServiceImpl implements WxOpenMaPrivacyService {
 
 
   @Override
-  public GetPrivacySettingResult getPrivacySetting(@Nullable Integer privacyVer) throws WxErrorException {
-    Map<String, Object> params = new HashMap<>();
+  public GetPrivacySettingResult getPrivacySetting(Integer privacyVer) throws WxErrorException {
+    Map<String, Object> params = new HashMap<>(1);
     if (privacyVer != null) {
       params.put("privacy_ver", privacyVer);
     }

+ 0 - 2
weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/privacy/PrivacyOwnerSetting.java

@@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
-import org.jetbrains.annotations.NotNull;
 
 /**
  * 小程序用户隐私保护指引 收集方(开发者)信息配置
@@ -51,7 +50,6 @@ public class PrivacyOwnerSetting {
   /**
    * 通知方式,指的是当开发者收集信息有变动时,通过该方式通知用户。这里服务商需要按照实际情况填写,例如通过弹窗或者公告或者其他方式。
    */
-  @NotNull
   @SerializedName("notice_method")
   private String noticeMethod;
 

+ 5 - 7
weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/privacy/SetPrivacySetting.java

@@ -5,8 +5,8 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
-import org.jetbrains.annotations.NotNull;
 
+import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -18,7 +18,8 @@ import java.util.List;
 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
-public class SetPrivacySetting {
+public class SetPrivacySetting implements Serializable {
+  private static final long serialVersionUID = -4309547831976480043L;
 
   /**
    * 用户隐私保护指引的版本,1表示现网版本;2表示开发版。默认是2开发版。
@@ -29,14 +30,12 @@ public class SetPrivacySetting {
   /**
    * 收集方(开发者)信息配置
    */
-  @NotNull
   @SerializedName("owner_setting")
   private PrivacyOwnerSetting ownerSetting;
 
   /**
    * 要收集的用户信息配置
    */
-  @NotNull
   @SerializedName("setting_list")
   private List<Setting> settingList;
 
@@ -45,7 +44,8 @@ public class SetPrivacySetting {
   @Builder
   @NoArgsConstructor
   @AllArgsConstructor
-  public static class Setting {
+  public static class Setting implements Serializable {
+    private static final long serialVersionUID = 1141496605788764479L;
 
     /**
      * 官方的可选值参考下方说明;该字段也支持自定义
@@ -53,7 +53,6 @@ public class SetPrivacySetting {
      * @see PrivacyKeyEnum
      * @see PrivacyKeyEnum#getKey()
      */
-    @NotNull
     @SerializedName("privacy_key")
     private String privacyKey;
 
@@ -61,7 +60,6 @@ public class SetPrivacySetting {
      * 请填写收集该信息的用途。例如privacy_key=Location(位置信息),那么privacy_text则填写收集位置信息的用途。
      * 无需再带上“为了”或者“用于”这些字眼,小程序端的显示格式是为了xxx,因此开发者只需要直接填写用途即可。
      */
-    @NotNull
     @SerializedName("privacy_text")
     private String privacyText;
   }