diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..91106d3f --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,17 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/src/main/java/cc/moecraft/icq/event/Event.java b/src/main/java/cc/moecraft/icq/event/Event.java index b79c4313..9515cdac 100644 --- a/src/main/java/cc/moecraft/icq/event/Event.java +++ b/src/main/java/cc/moecraft/icq/event/Event.java @@ -21,7 +21,7 @@ public abstract class Event implements ContentComparable { @SerializedName("post_type") @Expose - public String postType; + protected String postType; @SerializedName("self_id") @Expose @@ -29,9 +29,9 @@ public abstract class Event implements ContentComparable @SerializedName("time") @Expose - public Long time; + protected Long time; - public PicqBotX bot; + protected PicqBotX bot; public Event setBot(PicqBotX bot) { diff --git a/src/main/java/cc/moecraft/icq/event/events/local/EventLocal.java b/src/main/java/cc/moecraft/icq/event/events/local/EventLocal.java index 9f28ab12..61f88059 100644 --- a/src/main/java/cc/moecraft/icq/event/events/local/EventLocal.java +++ b/src/main/java/cc/moecraft/icq/event/events/local/EventLocal.java @@ -13,5 +13,5 @@ @NoArgsConstructor public abstract class EventLocal extends Event { - public boolean cancelled = false; -} + protected boolean cancelled = false; +} \ No newline at end of file diff --git a/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpFail.java b/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpFail.java index bbcba53d..b8ef82cf 100644 --- a/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpFail.java +++ b/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpFail.java @@ -13,7 +13,7 @@ @AllArgsConstructor public class EventLocalHttpFail extends EventLocal { - public Reason fail; // 怎样失败的 + protected Reason fail; // 怎样失败的 public enum Reason { diff --git a/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpReceive.java b/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpReceive.java index c78379d9..056de3c6 100644 --- a/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpReceive.java +++ b/src/main/java/cc/moecraft/icq/event/events/local/EventLocalHttpReceive.java @@ -16,15 +16,15 @@ @Data public class EventLocalHttpReceive extends EventLocal { - public String[] info; + protected String[] info; - public ArrayList otherInfo; + protected ArrayList otherInfo; - public String contentType; + protected String contentType; - public String charset; + protected String charset; - public String userAgent; + protected String userAgent; - public String data; + protected String data; } diff --git a/src/main/java/cc/moecraft/icq/event/events/local/EventLocalSendMessage.java b/src/main/java/cc/moecraft/icq/event/events/local/EventLocalSendMessage.java index b7315ba9..49eb6aae 100644 --- a/src/main/java/cc/moecraft/icq/event/events/local/EventLocalSendMessage.java +++ b/src/main/java/cc/moecraft/icq/event/events/local/EventLocalSendMessage.java @@ -13,11 +13,11 @@ @Data public class EventLocalSendMessage extends EventLocal { - public long id; + protected long id; - public String message; + protected String message; - public boolean autoEscape = false; + protected boolean autoEscape = false; public EventLocalSendMessage(long id, String message) { diff --git a/src/main/java/cc/moecraft/icq/event/events/message/EventDiscussMessage.java b/src/main/java/cc/moecraft/icq/event/events/message/EventDiscussMessage.java index b7bf1f65..3de4889a 100644 --- a/src/main/java/cc/moecraft/icq/event/events/message/EventDiscussMessage.java +++ b/src/main/java/cc/moecraft/icq/event/events/message/EventDiscussMessage.java @@ -21,7 +21,7 @@ public class EventDiscussMessage extends EventGroupOrDiscussMessage { @SerializedName("discuss_id") @Expose - public Long discussId; + protected Long discussId; @Override public ReturnData respond(String message, boolean raw) diff --git a/src/main/java/cc/moecraft/icq/event/events/message/EventGroupMessage.java b/src/main/java/cc/moecraft/icq/event/events/message/EventGroupMessage.java index e729100b..ece7aa49 100644 --- a/src/main/java/cc/moecraft/icq/event/events/message/EventGroupMessage.java +++ b/src/main/java/cc/moecraft/icq/event/events/message/EventGroupMessage.java @@ -24,15 +24,15 @@ public class EventGroupMessage extends EventGroupOrDiscussMessage { @SerializedName("anonymous") @Expose - public Anonymous anonymous; + protected Anonymous anonymous; @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @SerializedName("sub_type") @Expose - public String subType; + protected String subType; @Data @Setter(AccessLevel.NONE) @@ -40,15 +40,15 @@ public class Anonymous { @SerializedName("flag") @Expose - public String flag; + protected String flag; @SerializedName("id") @Expose - public Long id; + protected Long id; @SerializedName("name") @Expose - public String name; + protected String name; } @Override diff --git a/src/main/java/cc/moecraft/icq/event/events/message/EventMessage.java b/src/main/java/cc/moecraft/icq/event/events/message/EventMessage.java index 0863eb1b..915376fd 100644 --- a/src/main/java/cc/moecraft/icq/event/events/message/EventMessage.java +++ b/src/main/java/cc/moecraft/icq/event/events/message/EventMessage.java @@ -23,11 +23,11 @@ public abstract class EventMessage extends Event { @SerializedName("message_type") @Expose - public String messageType; + protected String messageType; @SerializedName("font") @Expose - public Long font; + protected Long font; @SerializedName("message") @Expose @@ -35,15 +35,15 @@ public abstract class EventMessage extends Event @SerializedName("message_id") @Expose - public Long messageId; + protected Long messageId; @SerializedName("raw_message") @Expose - public String rawMessage; + protected String rawMessage; @SerializedName("user_id") @Expose - public Long senderId; + protected Long senderId; /** * 回复消息 diff --git a/src/main/java/cc/moecraft/icq/event/events/message/EventPrivateMessage.java b/src/main/java/cc/moecraft/icq/event/events/message/EventPrivateMessage.java index 23adc4e6..43a42e4e 100644 --- a/src/main/java/cc/moecraft/icq/event/events/message/EventPrivateMessage.java +++ b/src/main/java/cc/moecraft/icq/event/events/message/EventPrivateMessage.java @@ -20,7 +20,7 @@ public class EventPrivateMessage extends EventMessage { @SerializedName("sub_type") @Expose - public String subType; + protected String subType; @Override public ReturnData respond(String message, boolean raw) diff --git a/src/main/java/cc/moecraft/icq/event/events/notice/EventNotice.java b/src/main/java/cc/moecraft/icq/event/events/notice/EventNotice.java index 1159e834..99041317 100644 --- a/src/main/java/cc/moecraft/icq/event/events/notice/EventNotice.java +++ b/src/main/java/cc/moecraft/icq/event/events/notice/EventNotice.java @@ -18,11 +18,11 @@ public class EventNotice extends Event { @SerializedName("notice_type") @Expose - public String noticeType; + protected String noticeType; @SerializedName("user_id") @Expose - public Long userId; + protected Long userId; @Override public boolean contentEquals(Object o) diff --git a/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupBan.java b/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupBan.java index 40af7166..8e287712 100644 --- a/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupBan.java +++ b/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupBan.java @@ -22,23 +22,23 @@ public class EventNoticeGroupBan extends EventNotice { @SerializedName("sub_type") @Expose - public BanType type; + protected BanType type; @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @SerializedName("operator_id") @Expose - public Long operatorId; + protected Long operatorId; @SerializedName("user_id") @Expose - public Long userId; + protected Long userId; @SerializedName("duration") @Expose - public Long duration; + protected Long duration; public enum BanType { diff --git a/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupUpload.java b/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupUpload.java index b32cb06f..8f80953f 100644 --- a/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupUpload.java +++ b/src/main/java/cc/moecraft/icq/event/events/notice/EventNoticeGroupUpload.java @@ -19,11 +19,11 @@ public class EventNoticeGroupUpload extends EventNotice { @SerializedName("file") @Expose - public File file; + protected File file; @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @Data @Setter(AccessLevel.NONE) @@ -31,19 +31,19 @@ public class File { @SerializedName("busid") @Expose - public Long busid; + protected Long busid; @SerializedName("id") @Expose - public String id; + protected String id; @SerializedName("name") @Expose - public String name; + protected String name; @SerializedName("size") @Expose - public Long size; + protected Long size; } private GroupEventMethods groupMethods = null; diff --git a/src/main/java/cc/moecraft/icq/event/events/notice/groupadmin/EventNoticeGroupAdminChange.java b/src/main/java/cc/moecraft/icq/event/events/notice/groupadmin/EventNoticeGroupAdminChange.java index 9cc5dcde..808849a9 100644 --- a/src/main/java/cc/moecraft/icq/event/events/notice/groupadmin/EventNoticeGroupAdminChange.java +++ b/src/main/java/cc/moecraft/icq/event/events/notice/groupadmin/EventNoticeGroupAdminChange.java @@ -20,13 +20,13 @@ public class EventNoticeGroupAdminChange extends EventNotice { @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @SerializedName("sub_type") @Expose - public String subType; + protected String subType; - private GroupEventMethods groupMethods = null; + protected GroupEventMethods groupMethods = null; @Override public boolean contentEquals(Object o) diff --git a/src/main/java/cc/moecraft/icq/event/events/notice/groupmember/EventNoticeGroupMemberChange.java b/src/main/java/cc/moecraft/icq/event/events/notice/groupmember/EventNoticeGroupMemberChange.java index 575660e1..a005b932 100644 --- a/src/main/java/cc/moecraft/icq/event/events/notice/groupmember/EventNoticeGroupMemberChange.java +++ b/src/main/java/cc/moecraft/icq/event/events/notice/groupmember/EventNoticeGroupMemberChange.java @@ -20,15 +20,15 @@ public class EventNoticeGroupMemberChange extends EventNotice { @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @SerializedName("operator_id") @Expose - public Long operatorId; + protected Long operatorId; @SerializedName("sub_type") @Expose - public String subType; + protected String subType; private GroupEventMethods groupMethods = null; diff --git a/src/main/java/cc/moecraft/icq/event/events/request/EventGroupAddRequest.java b/src/main/java/cc/moecraft/icq/event/events/request/EventGroupAddRequest.java index ad53190d..4da290e6 100644 --- a/src/main/java/cc/moecraft/icq/event/events/request/EventGroupAddRequest.java +++ b/src/main/java/cc/moecraft/icq/event/events/request/EventGroupAddRequest.java @@ -18,11 +18,11 @@ public class EventGroupAddRequest extends EventRequest { @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @SerializedName("sub_type") @Expose - public String subType; + protected String subType; @Override public void accept() diff --git a/src/main/java/cc/moecraft/icq/event/events/request/EventGroupInviteRequest.java b/src/main/java/cc/moecraft/icq/event/events/request/EventGroupInviteRequest.java index 3e379827..62f3fc7a 100644 --- a/src/main/java/cc/moecraft/icq/event/events/request/EventGroupInviteRequest.java +++ b/src/main/java/cc/moecraft/icq/event/events/request/EventGroupInviteRequest.java @@ -18,11 +18,11 @@ public class EventGroupInviteRequest extends EventRequest { @SerializedName("group_id") @Expose - public Long groupId; + protected Long groupId; @SerializedName("sub_type") @Expose - public String subType; + protected String subType; @Override public void accept() diff --git a/src/main/java/cc/moecraft/icq/event/events/request/EventRequest.java b/src/main/java/cc/moecraft/icq/event/events/request/EventRequest.java index ca2501b2..616f3c75 100644 --- a/src/main/java/cc/moecraft/icq/event/events/request/EventRequest.java +++ b/src/main/java/cc/moecraft/icq/event/events/request/EventRequest.java @@ -18,19 +18,19 @@ public abstract class EventRequest extends Event { @SerializedName("request_type") @Expose - public String requestType; + protected String requestType; @SerializedName("flag") @Expose - public String flag; + protected String flag; @SerializedName("comment") @Expose - public String comment; + protected String comment; @SerializedName("user_id") @Expose - public Long userId; + protected Long userId; /** * 同意申请