mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
🎨 格式化部分代码
This commit is contained in:
parent
622b838005
commit
091d74b6ee
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 离职员工外部联系人列表
|
||||
*
|
||||
* @author yqx
|
||||
* @date 2020/3/15
|
||||
*/
|
||||
|
@ -11,6 +11,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 联系客户统计数据
|
||||
*
|
||||
* @author yqx
|
||||
* @date 2020/3/16
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 在职成员的客户转接情况
|
||||
*
|
||||
* @author pg
|
||||
* @date 2021年6月21日
|
||||
*/
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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,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;
|
||||
|
@ -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;
|
||||
|
@ -65,6 +65,7 @@ public class OriginNotifyResponse implements Serializable {
|
||||
*/
|
||||
@SerializedName(value = "summary")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 字段名:通知数据类型
|
||||
|
Loading…
Reference in New Issue
Block a user