Skip to content

Commit 235f9d8

Browse files
authored
Merge pull request #91 from anlingyi/release
1.6.5-beta
2 parents 27bd211 + c4263be commit 235f9d8

File tree

71 files changed

+2212
-551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2212
-551
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# XEChat-Idea
22

3-
> Version 1.6.4-beta
3+
> Version 1.6.5-beta
44
55
> 基于Netty的IDEA即时聊天插件:让你能够在IDEA里实现聊天、下棋、斗地主!(理论上支持JetBrains全系列开发工具🙂)
66
@@ -50,7 +50,7 @@
5050

5151
[了解更多...](https://xeblog.cn/?tag=xechat-idea)
5252

53-
![](https://oss.xeblog.cn/prod/2f78edccf9c947d5827c3be0e8887b94.png)
53+
![](https://oss.xeblog.cn/prod/6382599251dc467380c3b1c1eff6bfa5.png)
5454

5555
![](https://oss.xeblog.cn/prod/87397d4da728467e912450f94e41b2ef.jpg)
5656

@@ -234,7 +234,7 @@ http://plugins.xeblog.cn
234234
version: '3'
235235
services:
236236
xechat:
237-
image: anlingyi/xechat-server:{Version}
237+
image: anlingyi/xechat-server:1.6.5-beta
238238
container_name: xechat-server
239239
restart: always
240240
ports:

xechat-commons/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>cn.xeblog</groupId>
88
<artifactId>xechat-commons</artifactId>
9-
<version>1.6.4-beta</version>
9+
<version>1.6.5-beta</version>
1010
<build>
1111
<plugins>
1212
<plugin>

xechat-commons/src/main/java/cn/xeblog/commons/constants/IpConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public interface IpConstants {
5858
put("香港特别行政区", "港");
5959
put("澳门特别行政区", "澳");
6060
put("台湾省", "台");
61-
put("未知", "-");
61+
put("未知", "中国");
6262
}};
6363

6464
}

xechat-commons/src/main/java/cn/xeblog/commons/entity/LoginDTO.java

+2
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ public class LoginDTO implements Serializable {
2626

2727
private String token;
2828

29+
private String uuid;
30+
2931
}

xechat-commons/src/main/java/cn/xeblog/commons/entity/User.java

+83
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cn.xeblog.commons.entity;
22

3+
import cn.xeblog.commons.enums.Permissions;
34
import cn.xeblog.commons.enums.UserStatus;
45
import io.netty.channel.Channel;
56
import lombok.*;
@@ -17,35 +18,76 @@ public class User implements Serializable {
1718

1819
private static final long serialVersionUID = 1L;
1920

21+
/**
22+
* uuid
23+
*/
24+
@Getter
25+
@Setter
26+
private String uuid;
27+
28+
/**
29+
* 用户ID
30+
*/
2031
@Getter
2132
@Setter
2233
private String id;
2334

35+
/**
36+
* 用户昵称
37+
*/
2438
@Getter
2539
@Setter
2640
private String username;
2741

42+
/**
43+
* 用户状态
44+
*/
2845
@Getter
2946
@Setter
3047
private UserStatus status;
3148

49+
/**
50+
* 用户IP
51+
*/
3252
@Getter
3353
@Setter
3454
private String ip;
3555

56+
/**
57+
* 用户所在区域
58+
*/
3659
@Getter
3760
@Setter
3861
private IpRegion region;
3962

63+
/**
64+
* 用户角色
65+
*/
4066
@Getter
4167
@Setter
4268
private Role role;
4369

70+
/**
71+
* 用户权限
72+
*/
73+
@Getter
74+
@Setter
75+
private int permit;
76+
77+
/**
78+
* 通道
79+
*/
4480
@Getter
4581
private transient Channel channel;
4682

4783
public enum Role {
84+
/**
85+
* 管理员
86+
*/
4887
ADMIN,
88+
/**
89+
* 用户
90+
*/
4991
USER
5092
}
5193

@@ -78,4 +120,45 @@ public boolean equals(Object o) {
78120
public int hashCode() {
79121
return Objects.hash(id);
80122
}
123+
124+
/**
125+
* 添加权限
126+
*
127+
* @param permissions
128+
*/
129+
public void addPermit(Permissions permissions) {
130+
this.permit |= permissions.getValue();
131+
}
132+
133+
/**
134+
* 移除权限
135+
*
136+
* @param permissions
137+
*/
138+
public void removePermit(Permissions permissions) {
139+
if (hasPermit(permissions)) {
140+
this.permit ^= permissions.getValue();
141+
}
142+
}
143+
144+
/**
145+
* 是否存在权限
146+
*
147+
* @param permissions
148+
* @return
149+
*/
150+
public boolean hasPermit(Permissions permissions) {
151+
int value = permissions.getValue();
152+
return (this.permit & value) == value;
153+
}
154+
155+
/**
156+
* 是否是管理员
157+
*
158+
* @return
159+
*/
160+
public boolean isAdmin() {
161+
return this.role == Role.ADMIN;
162+
}
163+
81164
}

xechat-commons/src/main/java/cn/xeblog/commons/entity/game/chess/ChessDTO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ChessDTO extends GameDTO {
2929
public UI currentUI = UI.CLASSIC;
3030

3131
public enum Option {
32-
SURRENDER, UNDO, GAME_OVER, CHECK, DEFAULT
32+
SURRENDER, UNDO, UNDO_CONSENT, UNDO_REJECT, GAME_OVER, CHECK, DEFAULT
3333
}
3434

3535
@Getter
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cn.xeblog.commons.entity.react;
2+
3+
import lombok.Data;
4+
5+
import java.io.Serializable;
6+
7+
/**
8+
* @author anlingyi
9+
* @date 2022/9/19 8:07 AM
10+
*/
11+
@Data
12+
public class BaseReact implements Serializable {
13+
14+
private String id;
15+
16+
private String uid;
17+
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package cn.xeblog.commons.entity.react;
2+
3+
/**
4+
* @author anlingyi
5+
* @date 2022/9/19 8:35 AM
6+
*/
7+
public enum React {
8+
9+
/**
10+
* 上传文件
11+
*/
12+
UPLOAD,
13+
/**
14+
* 下载文件
15+
*/
16+
DOWNLOAD,
17+
/**
18+
* 管控
19+
*/
20+
ADMIN
21+
;
22+
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package cn.xeblog.commons.entity.react.request;
2+
3+
import cn.xeblog.commons.entity.react.BaseReact;
4+
import cn.xeblog.commons.enums.Permissions;
5+
import lombok.AllArgsConstructor;
6+
import lombok.Data;
7+
import lombok.NoArgsConstructor;
8+
9+
/**
10+
* @author anlingyi
11+
* @date 2023/2/18 8:07 PM
12+
*/
13+
@Data
14+
@AllArgsConstructor
15+
@NoArgsConstructor
16+
public class AdminReact extends BaseReact {
17+
18+
/**
19+
* 操作
20+
*/
21+
private Operate operate;
22+
23+
/**
24+
* 权限
25+
*/
26+
private Permissions permissions;
27+
28+
/**
29+
* 用户id
30+
*/
31+
private String uid;
32+
33+
/**
34+
* 配置值
35+
*/
36+
private String value;
37+
38+
public AdminReact(Operate operate, String value) {
39+
this.operate = operate;
40+
this.value = value;
41+
}
42+
43+
public AdminReact(Operate operate, Permissions permissions) {
44+
this.operate = operate;
45+
this.permissions = permissions;
46+
}
47+
48+
public AdminReact(Operate operate, Permissions permissions, String uid) {
49+
this.operate = operate;
50+
this.permissions = permissions;
51+
this.uid = uid;
52+
}
53+
54+
public enum Operate {
55+
/**
56+
* 查询权限
57+
*/
58+
QUERY_PERMIT,
59+
/**
60+
* 全局权限添加
61+
*/
62+
GLOBAL_PERMIT_ADD,
63+
/**
64+
* 全局文件大小限制
65+
*/
66+
GLOBAL_MAX_FILE_SIZE,
67+
/**
68+
* 全局权限移除
69+
*/
70+
GLOBAL_PERMIT_REMOVE,
71+
/**
72+
* 用户权限添加
73+
*/
74+
USER_PERMIT_ADD,
75+
/**
76+
* 用户权限移除
77+
*/
78+
USER_PERMIT_REMOVE
79+
;
80+
}
81+
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cn.xeblog.commons.entity.react.request;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
/**
8+
* @author anlingyi
9+
* @date 2023/2/18 12:17 AM
10+
*/
11+
@AllArgsConstructor
12+
@NoArgsConstructor
13+
@Data
14+
public class DownloadReact {
15+
16+
private String fileName;
17+
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cn.xeblog.commons.entity.react.request;
2+
3+
import cn.xeblog.commons.entity.react.BaseReact;
4+
import cn.xeblog.commons.entity.react.React;
5+
import lombok.Data;
6+
7+
/**
8+
* @author anlingyi
9+
* @date 2022/9/19 8:12 AM
10+
*/
11+
@Data
12+
public class ReactRequest<T> extends BaseReact {
13+
14+
private T body;
15+
16+
private React react;
17+
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package cn.xeblog.commons.entity.react.request;
2+
3+
import lombok.Data;
4+
5+
/**
6+
* @author anlingyi
7+
* @date 2022/9/19 8:54 AM
8+
*/
9+
@Data
10+
public class UploadReact {
11+
12+
private String fileType;
13+
14+
private byte[] bytes;
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package cn.xeblog.commons.entity.react.result;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
/**
8+
* @author anlingyi
9+
* @date 2023/2/18 8:15 PM
10+
*/
11+
@Data
12+
@NoArgsConstructor
13+
@AllArgsConstructor
14+
public class AdminReactResult {
15+
16+
/**
17+
* 全局权限值
18+
*/
19+
private int globalPermit;
20+
21+
/**
22+
* 文件大小限制
23+
*/
24+
private int maxFileSize;
25+
26+
}

0 commit comments

Comments
 (0)