diff --git a/pom.xml b/pom.xml index 0f67578..d6bd0fc 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,12 @@ javase 3.3.3 - + + + org.projectlombok + lombok + 1.16.20 + diff --git a/src/main/java/com/hotlcc/wechat4j/model/AppInfo.java b/src/main/java/com/hotlcc/wechat4j/model/AppInfo.java index 4a1649b..780f828 100644 --- a/src/main/java/com/hotlcc/wechat4j/model/AppInfo.java +++ b/src/main/java/com/hotlcc/wechat4j/model/AppInfo.java @@ -3,10 +3,12 @@ package com.hotlcc.wechat4j.model; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; +import lombok.Getter; import java.util.ArrayList; import java.util.List; +@Getter public final class AppInfo { private AppInfo() { } @@ -16,14 +18,6 @@ public final class AppInfo { @JSONField(name = "AppID") private String appID; - public Integer getType() { - return type; - } - - public String getAppID() { - return appID; - } - public static AppInfo valueOf(JSONObject info) { if (info == null) { return null; diff --git a/src/main/java/com/hotlcc/wechat4j/model/BaseRequest.java b/src/main/java/com/hotlcc/wechat4j/model/BaseRequest.java index 9a609b0..9f77c74 100644 --- a/src/main/java/com/hotlcc/wechat4j/model/BaseRequest.java +++ b/src/main/java/com/hotlcc/wechat4j/model/BaseRequest.java @@ -2,10 +2,14 @@ package com.hotlcc.wechat4j.model; import com.alibaba.fastjson.annotation.JSONField; import com.hotlcc.wechat4j.util.WechatUtil; +import lombok.Getter; +import lombok.Setter; /** * 基本请求模型 */ +@Getter +@Setter public class BaseRequest { public BaseRequest() { } @@ -29,36 +33,4 @@ public class BaseRequest { private String skey; @JSONField(name = "Uin") private String uin; - - public String getDeviceID() { - return deviceID; - } - - public void setDeviceID(String deviceID) { - deviceID = deviceID; - } - - public String getSid() { - return sid; - } - - public void setSid(String sid) { - sid = sid; - } - - public String getSkey() { - return skey; - } - - public void setSkey(String skey) { - skey = skey; - } - - public String getUin() { - return uin; - } - - public void setUin(String uin) { - uin = uin; - } } diff --git a/src/main/java/com/hotlcc/wechat4j/model/ReceivedMsg.java b/src/main/java/com/hotlcc/wechat4j/model/ReceivedMsg.java index 3a83100..d5d56be 100644 --- a/src/main/java/com/hotlcc/wechat4j/model/ReceivedMsg.java +++ b/src/main/java/com/hotlcc/wechat4j/model/ReceivedMsg.java @@ -3,10 +3,12 @@ package com.hotlcc.wechat4j.model; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; +import lombok.Getter; import java.util.ArrayList; import java.util.List; +@Getter public final class ReceivedMsg { private ReceivedMsg() { } @@ -68,118 +70,6 @@ public final class ReceivedMsg { @JSONField(name = "FileSize") private String fileSize; - public Integer getSubMsgType() { - return subMsgType; - } - - public Long getVoiceLength() { - return voiceLength; - } - - public String getFileName() { - return fileName; - } - - public Long getImgHeight() { - return imgHeight; - } - - public String getToUserName() { - return toUserName; - } - - public Long getHasProductId() { - return hasProductId; - } - - public Integer getImgStatus() { - return imgStatus; - } - - public String getUrl() { - return url; - } - - public Integer getImgWidth() { - return imgWidth; - } - - public Integer getForwardFlag() { - return forwardFlag; - } - - public Integer getStatus() { - return status; - } - - public String getTicket() { - return ticket; - } - - public com.hotlcc.wechat4j.model.RecommendInfo getRecommendInfo() { - return recommendInfo; - } - - public Long getCreateTime() { - return createTime; - } - - public Long getNewMsgId() { - return newMsgId; - } - - public Integer getMsgType() { - return msgType; - } - - public String getEncryFileName() { - return encryFileName; - } - - public String getMsgId() { - return msgId; - } - - public Integer getStatusNotifyCode() { - return statusNotifyCode; - } - - public AppInfo getAppInfo() { - return appInfo; - } - - public Integer getAppMsgType() { - return appMsgType; - } - - public Long getPlayLength() { - return playLength; - } - - public String getMediaId() { - return mediaId; - } - - public String getContent() { - return content; - } - - public String getStatusNotifyUserName() { - return statusNotifyUserName; - } - - public String getFromUserName() { - return fromUserName; - } - - public String getOriContent() { - return oriContent; - } - - public String getFileSize() { - return fileSize; - } - public static ReceivedMsg valueOf(JSONObject msg) { if (msg == null) { return null; diff --git a/src/main/java/com/hotlcc/wechat4j/model/RecommendInfo.java b/src/main/java/com/hotlcc/wechat4j/model/RecommendInfo.java index 1cf5296..bbc177d 100644 --- a/src/main/java/com/hotlcc/wechat4j/model/RecommendInfo.java +++ b/src/main/java/com/hotlcc/wechat4j/model/RecommendInfo.java @@ -3,10 +3,12 @@ package com.hotlcc.wechat4j.model; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; +import lombok.Getter; import java.util.ArrayList; import java.util.List; +@Getter public final class RecommendInfo { private RecommendInfo() { } @@ -40,62 +42,6 @@ public final class RecommendInfo { @JSONField(name = "VerifyFlag") private Integer verifyFlag; - public String getTicket() { - return ticket; - } - - public String getUserName() { - return userName; - } - - public Integer getSex() { - return sex; - } - - public Integer getAttrStatus() { - return attrStatus; - } - - public String getCity() { - return city; - } - - public String getNickName() { - return nickName; - } - - public Integer getScene() { - return scene; - } - - public String getProvince() { - return province; - } - - public String getContent() { - return content; - } - - public String getAlias() { - return alias; - } - - public String getSignature() { - return signature; - } - - public Integer getOpCode() { - return opCode; - } - - public Long getQQNum() { - return qqNum; - } - - public Integer getVerifyFlag() { - return verifyFlag; - } - public static RecommendInfo valueOf(JSONObject info) { if (info == null) { return null; diff --git a/src/main/java/com/hotlcc/wechat4j/model/UserInfo.java b/src/main/java/com/hotlcc/wechat4j/model/UserInfo.java index 8f716a5..6eba56a 100644 --- a/src/main/java/com/hotlcc/wechat4j/model/UserInfo.java +++ b/src/main/java/com/hotlcc/wechat4j/model/UserInfo.java @@ -3,6 +3,7 @@ package com.hotlcc.wechat4j.model; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; +import lombok.Getter; import java.util.ArrayList; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; /** * 微信用户信息 */ +@Getter public final class UserInfo { private UserInfo() { } @@ -77,130 +79,6 @@ public final class UserInfo { @JSONField(name = "UserName") private String userName; - public Long getUin() { - return uin; - } - - public String getNickName() { - return nickName; - } - - public String getHeadImgUrl() { - return headImgUrl; - } - - public Integer getContactFlag() { - return contactFlag; - } - - public Integer getMemberCount() { - return memberCount; - } - - public List getMemberList() { - return memberList; - } - - public String getRemarkName() { - return remarkName; - } - - public Integer getHideInputBarFlag() { - return hideInputBarFlag; - } - - public Integer getSex() { - return sex; - } - - public String getSignature() { - return signature; - } - - public Integer getVerifyFlag() { - return verifyFlag; - } - - public Long getOwnerUin() { - return ownerUin; - } - - public String getPYInitial() { - return pyInitial; - } - - public String getPYQuanPin() { - return pyQuanPin; - } - - public String getRemarkPYInitial() { - return remarkPYInitial; - } - - public String getRemarkPYQuanPin() { - return remarkPYQuanPin; - } - - public Integer getStarFriend() { - return starFriend; - } - - public Integer getAppAccountFlag() { - return appAccountFlag; - } - - public Integer getStatues() { - return statues; - } - - public Integer getAttrStatus() { - return attrStatus; - } - - public String getProvince() { - return province; - } - - public String getCity() { - return city; - } - - public String getAlias() { - return alias; - } - - public Integer getSnsFlag() { - return snsFlag; - } - - public Integer getUniFriend() { - return uniFriend; - } - - public String getDisplayName() { - return displayName; - } - - public Long getChatRoomId() { - return chatRoomId; - } - - public String getKeyWord() { - return keyWord; - } - - public String getEncryChatRoomId() { - return encryChatRoomId; - } - - public Integer getIsOwner() { - return isOwner; - } - - public String getUserName() { - return userName; - } - public static UserInfo valueOf(JSONObject info) { if (info == null) { return null; diff --git a/src/main/java/com/hotlcc/wechat4j/model/WxMessage.java b/src/main/java/com/hotlcc/wechat4j/model/WxMessage.java index 8f275a6..05db641 100644 --- a/src/main/java/com/hotlcc/wechat4j/model/WxMessage.java +++ b/src/main/java/com/hotlcc/wechat4j/model/WxMessage.java @@ -1,10 +1,14 @@ package com.hotlcc.wechat4j.model; import com.alibaba.fastjson.annotation.JSONField; +import lombok.Getter; +import lombok.Setter; /** * 要发送的消息 */ +@Getter +@Setter public class WxMessage { @JSONField(name = "ClientMsgId") private String clientMsgId; @@ -18,52 +22,4 @@ public class WxMessage { private String toUserName; @JSONField(name = "Type") private Integer type; - - public String getClientMsgId() { - return clientMsgId; - } - - public void setClientMsgId(String clientMsgId) { - this.clientMsgId = clientMsgId; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getFromUserName() { - return fromUserName; - } - - public void setFromUserName(String fromUserName) { - this.fromUserName = fromUserName; - } - - public String getLocalID() { - return localID; - } - - public void setLocalID(String localID) { - this.localID = localID; - } - - public String getToUserName() { - return toUserName; - } - - public void setToUserName(String toUserName) { - this.toUserName = toUserName; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } }