瀏覽代碼

:art: 格式化部分代码

Binary Wang 3 年之前
父節點
當前提交
091d74b6ee
共有 17 個文件被更改,包括 66 次插入92 次删除
  1. 34 68
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java
  2. 1 1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java
  3. 2 2
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayResult.java
  4. 1 1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalContactList.java
  5. 6 6
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java
  6. 2 1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatTransferResp.java
  7. 3 3
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupInfo.java
  8. 3 3
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupList.java
  9. 1 0
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUnassignList.java
  10. 1 0
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUserBehaviorStatistic.java
  11. 1 0
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserTransferResultResp.java
  12. 1 1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserWithExternalPermission.java
  13. 6 2
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpWelcomeMsg.java
  14. 1 1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/FollowedUser.java
  15. 1 1
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/WxCpExternalContactInfo.java
  16. 1 2
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/applydata/ContentValue.java
  17. 1 0
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/OriginNotifyResponse.java

+ 34 - 68
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImpl.java

@@ -40,12 +40,8 @@ public class WxCpOaServiceImpl implements WxCpOaService {
   }
 
   @Override
-  public List<WxCpCheckinData> getCheckinData(Integer openCheckinDataType, Date startTime, Date endTime,
+  public List<WxCpCheckinData> getCheckinData(Integer openCheckinDataType, @NonNull Date startTime, @NonNull Date endTime,
                                               List<String> userIdList) throws WxErrorException {
-    if (startTime == null || endTime == null) {
-      throw new WxRuntimeException("starttime and endtime can't be null");
-    }
-
     if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
       throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
     }
@@ -73,20 +69,14 @@ public class WxCpOaServiceImpl implements WxCpOaService {
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_DATA);
     String responseContent = this.mainService.post(url, jsonObject.toString());
     JsonObject tmpJson = GsonParser.parse(responseContent);
-    return WxCpGsonBuilder.create()
-      .fromJson(
-        tmpJson.get("checkindata"),
-        new TypeToken<List<WxCpCheckinData>>() {
-        }.getType()
-      );
+    return WxCpGsonBuilder.create().fromJson(tmpJson.get("checkindata"),
+      new TypeToken<List<WxCpCheckinData>>() {
+      }.getType()
+    );
   }
 
   @Override
-  public List<WxCpCheckinOption> getCheckinOption(Date datetime, List<String> userIdList) throws WxErrorException {
-    if (datetime == null) {
-      throw new WxRuntimeException("datetime can't be null");
-    }
-
+  public List<WxCpCheckinOption> getCheckinOption(@NonNull Date datetime, List<String> userIdList) throws WxErrorException {
     if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
       throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
     }
@@ -104,34 +94,29 @@ public class WxCpOaServiceImpl implements WxCpOaService {
     String responseContent = this.mainService.post(url, jsonObject.toString());
     JsonObject tmpJson = GsonParser.parse(responseContent);
 
-    return WxCpGsonBuilder.create()
-      .fromJson(
-        tmpJson.get("info"),
-        new TypeToken<List<WxCpCheckinOption>>() {
-        }.getType()
-      );
+    return WxCpGsonBuilder.create().fromJson(tmpJson.get("info"),
+      new TypeToken<List<WxCpCheckinOption>>() {
+      }.getType()
+    );
   }
 
   @Override
   public List<WxCpCropCheckinOption> getCropCheckinOption() throws WxErrorException {
-
     JsonObject jsonObject = new JsonObject();
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_CHECKIN_OPTION);
     String responseContent = this.mainService.post(url, jsonObject.toString());
     JsonObject tmpJson = GsonParser.parse(responseContent);
 
-    return WxCpGsonBuilder.create()
-      .fromJson(
-        tmpJson.get("group"),
-        new TypeToken<List<WxCpCropCheckinOption>>() {
-        }.getType()
-      );
+    return WxCpGsonBuilder.create().fromJson(tmpJson.get("group"),
+      new TypeToken<List<WxCpCropCheckinOption>>() {
+      }.getType()
+    );
   }
 
   @Override
   public WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime,
-                                          Integer cursor, Integer size, List<WxCpApprovalInfoQueryFilter> filters) throws WxErrorException {
-
+                                          Integer cursor, Integer size, List<WxCpApprovalInfoQueryFilter> filters)
+    throws WxErrorException {
     if (cursor == null) {
       cursor = 0;
     }
@@ -171,7 +156,6 @@ public class WxCpOaServiceImpl implements WxCpOaService {
 
   @Override
   public WxCpApprovalDetailResult getApprovalDetail(@NonNull String spNo) throws WxErrorException {
-
     JsonObject jsonObject = new JsonObject();
     jsonObject.addProperty("sp_no", spNo);
 
@@ -198,7 +182,6 @@ public class WxCpOaServiceImpl implements WxCpOaService {
     jsonObject.addProperty("limit", limit);
 
     if (startTime != null && endTime != null) {
-
       long endtimestamp = endTime.getTime() / 1000L;
       long starttimestamp = startTime.getTime() / 1000L;
 
@@ -230,12 +213,8 @@ public class WxCpOaServiceImpl implements WxCpOaService {
   }
 
   @Override
-  public List<WxCpCheckinDayData> getCheckinDayData(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
-
-    if (startTime == null || endTime == null) {
-      throw new WxRuntimeException("starttime and endtime can't be null");
-    }
-
+  public List<WxCpCheckinDayData> getCheckinDayData(@NonNull Date startTime, @NonNull Date endTime, List<String> userIdList)
+    throws WxErrorException {
     if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
       throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
     }
@@ -257,20 +236,15 @@ public class WxCpOaServiceImpl implements WxCpOaService {
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_DAY_DATA);
     String responseContent = this.mainService.post(url, jsonObject.toString());
     JsonObject tmpJson = GsonParser.parse(responseContent);
-    return WxCpGsonBuilder.create()
-      .fromJson(
-        tmpJson.get("datas"),
-        new TypeToken<List<WxCpCheckinDayData>>() {
-        }.getType()
-      );
+    return WxCpGsonBuilder.create().fromJson(tmpJson.get("datas"),
+      new TypeToken<List<WxCpCheckinDayData>>() {
+      }.getType()
+    );
   }
 
   @Override
-  public List<WxCpCheckinMonthData> getCheckinMonthData(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
-    if (startTime == null || endTime == null) {
-      throw new WxRuntimeException("starttime and endtime can't be null");
-    }
-
+  public List<WxCpCheckinMonthData> getCheckinMonthData(@NonNull Date startTime, @NonNull Date endTime, List<String> userIdList)
+    throws WxErrorException {
     if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
       throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
     }
@@ -292,25 +266,19 @@ public class WxCpOaServiceImpl implements WxCpOaService {
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_MONTH_DATA);
     String responseContent = this.mainService.post(url, jsonObject.toString());
     JsonObject tmpJson = GsonParser.parse(responseContent);
-    return WxCpGsonBuilder.create()
-      .fromJson(
-        tmpJson.get("datas"),
-        new TypeToken<List<WxCpCheckinMonthData>>() {
-        }.getType()
-      );
+    return WxCpGsonBuilder.create().fromJson(tmpJson.get("datas"),
+      new TypeToken<List<WxCpCheckinMonthData>>() {
+      }.getType()
+    );
   }
 
   @Override
-  public List<WxCpCheckinSchedule> getCheckinScheduleList(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
-    if (startTime == null || endTime == null) {
-      throw new WxRuntimeException("starttime and endtime can't be null");
-    }
-
+  public List<WxCpCheckinSchedule> getCheckinScheduleList(@NonNull Date startTime, @NonNull Date endTime, List<String> userIdList)
+    throws WxErrorException {
     if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
       throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
     }
 
-
     long endTimestamp = endTime.getTime() / 1000L;
     long startTimestamp = startTime.getTime() / 1000L;
 
@@ -329,12 +297,10 @@ public class WxCpOaServiceImpl implements WxCpOaService {
     final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_SCHEDULE_DATA);
     String responseContent = this.mainService.post(url, jsonObject.toString());
     JsonObject tmpJson = GsonParser.parse(responseContent);
-    return WxCpGsonBuilder.create()
-      .fromJson(
-        tmpJson.get("schedule_list"),
-        new TypeToken<List<WxCpCheckinSchedule>>() {
-        }.getType()
-      );
+    return WxCpGsonBuilder.create().fromJson(tmpJson.get("schedule_list"),
+      new TypeToken<List<WxCpCheckinSchedule>>() {
+      }.getType()
+    );
   }
 
   @Override

+ 1 - 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java

@@ -172,7 +172,7 @@ public class WxCpContactWayInfo implements Serializable {
     @JsonAdapter(WxCpConclusionAdapter.class)
     public static class Conclusion implements Serializable {
       private static final long serialVersionUID = -8697184659526210472L;
-      
+
       private String textContent;
       private String imgMediaId;
       private String imgPicUrl;

+ 2 - 2
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayResult.java

@@ -12,10 +12,10 @@ import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
 public class WxCpContactWayResult extends WxCpBaseResp {
   @SerializedName("config_id")
   private String configId;
-  
+
   @SerializedName("qr_code")
   private String qrCode;
-  
+
   public static WxCpContactWayResult fromJson(String json) {
     return WxCpGsonBuilder.create().fromJson(json, WxCpContactWayResult.class);
   }

+ 1 - 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalContactList.java

@@ -18,7 +18,7 @@ import java.util.List;
  */
 public class WxCpUserExternalContactList implements Serializable {
   private static final long serialVersionUID = -4301684507150486556L;
-  
+
   @SerializedName("errcode")
   @Expose
   private Long errcode;

+ 6 - 6
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatInfo.java

@@ -67,10 +67,10 @@ public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp {
     private Long joinTime;
 
     /**
-    * 外部联系人在微信开放平台的唯一身份标识(微信unionid)
-    * 通过此字段企业可将外部联系人与公众号/小程序用户关联起来
-    * 仅当群成员类型是微信用户(包括企业成员未添加好友),且企业或第三方服务商绑定了微信开发者ID有此字段
-    */
+     * 外部联系人在微信开放平台的唯一身份标识(微信unionid)
+     * 通过此字段企业可将外部联系人与公众号/小程序用户关联起来
+     * 仅当群成员类型是微信用户(包括企业成员未添加好友),且企业或第三方服务商绑定了微信开发者ID有此字段
+     */
     @SerializedName("unionid")
     private String unionId;
 
@@ -106,7 +106,7 @@ public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp {
 
   @Getter
   @Setter
-  public static class Invitor{
+  public static class Invitor {
 
     /**
      * 邀请者的userid
@@ -117,7 +117,7 @@ public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp {
 
   @Getter
   @Setter
-  public static class GroupAdmin{
+  public static class GroupAdmin {
 
     /**
      * 群管理员userid

+ 2 - 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalGroupChatTransferResp.java

@@ -10,6 +10,7 @@ import java.util.List;
 
 /**
  * 分配离职成员的客户群结果
+ *
  * @author pg
  * @date 2021年6月21日
  */
@@ -33,7 +34,7 @@ public class WxCpUserExternalGroupChatTransferResp extends WxCpBaseResp {
 
   @Getter
   @Setter
-  public static class GroupChatFailedTransfer extends WxCpBaseResp  {
+  public static class GroupChatFailedTransfer extends WxCpBaseResp {
     private static final long serialVersionUID = -5836775099634587239L;
     /**
      * 没能成功继承的群ID

+ 3 - 3
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupInfo.java

@@ -64,13 +64,13 @@ public class WxCpUserExternalTagGroupInfo extends WxCpBaseResp {
     private String name;
 
     @SerializedName("create_time")
-    private Long  createTime;
+    private Long createTime;
 
     @SerializedName("order")
-    private Integer  order;
+    private Integer order;
 
     @SerializedName("deleted")
-    private Boolean  deleted;
+    private Boolean deleted;
 
   }
 

+ 3 - 3
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalTagGroupList.java

@@ -60,13 +60,13 @@ public class WxCpUserExternalTagGroupList extends WxCpBaseResp {
       private String name;
 
       @SerializedName("create_time")
-      private Long  createTime;
+      private Long createTime;
 
       @SerializedName("order")
-      private Long  order;
+      private Long order;
 
       @SerializedName("deleted")
-      private Boolean  deleted;
+      private Boolean deleted;
 
     }
   }

+ 1 - 0
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUnassignList.java

@@ -11,6 +11,7 @@ import java.util.List;
 
 /**
  * 离职员工外部联系人列表
+ *
  * @author yqx
  * @date 2020/3/15
  */

+ 1 - 0
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserExternalUserBehaviorStatistic.java

@@ -11,6 +11,7 @@ import java.util.List;
 
 /**
  * 联系客户统计数据
+ *
  * @author yqx
  * @date 2020/3/16
  */

+ 1 - 0
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserTransferResultResp.java

@@ -10,6 +10,7 @@ import java.io.Serializable;
 
 /**
  * 在职成员的客户转接情况
+ *
  * @author pg
  * @date 2021年6月21日
  */

+ 1 - 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpUserWithExternalPermission.java

@@ -14,7 +14,7 @@ import java.util.List;
 @Data
 public class WxCpUserWithExternalPermission implements Serializable {
   private static final long serialVersionUID = -4301684507150486556L;
-  
+
   @SerializedName("errcode")
   @Expose
   private Long errCode;

+ 6 - 2
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpWelcomeMsg.java

@@ -1,8 +1,12 @@
 package me.chanjar.weixin.cp.bean.external;
 
 import com.google.gson.annotations.SerializedName;
-import lombok.*;
-import me.chanjar.weixin.cp.bean.external.msg.*;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.cp.bean.external.msg.Attachment;
+import me.chanjar.weixin.cp.bean.external.msg.Text;
 import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
 
 import java.io.Serializable;

+ 1 - 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/FollowedUser.java

@@ -14,7 +14,7 @@ import java.io.Serializable;
 @Data
 public class FollowedUser implements Serializable {
   private static final long serialVersionUID = -4301684507150486556L;
-  
+
   @SerializedName("userid")
   private String userId;
 

+ 1 - 1
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/WxCpExternalContactInfo.java

@@ -1,7 +1,7 @@
 package me.chanjar.weixin.cp.bean.external.contact;
 
 import com.google.gson.annotations.SerializedName;
-import lombok.*;
+import lombok.Data;
 import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
 
 import java.io.Serializable;

+ 1 - 2
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/applydata/ContentValue.java

@@ -67,8 +67,8 @@ public class ContentValue implements Serializable {
 
   @Data
   public static class Member implements Serializable {
-
     private static final long serialVersionUID = 1316551341955496067L;
+
     @SerializedName("userid")
     private String userId;
     private String name;
@@ -97,7 +97,6 @@ public class ContentValue implements Serializable {
     private List<ApplyDataContent> list;
   }
 
-
   @Data
   public static class Attendance implements Serializable {
     private static final long serialVersionUID = -6627566040706594166L;

+ 1 - 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/OriginNotifyResponse.java

@@ -65,6 +65,7 @@ public class OriginNotifyResponse implements Serializable {
    */
   @SerializedName(value = "summary")
   private String summary;
+
   /**
    * <pre>
    * 字段名:通知数据类型