代码优化
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
package fun.asgc.neutrino.proxy.server.constant;
|
||||
|
||||
/**
|
||||
* @author: aoshiguchen
|
||||
* @date: 2023/3/18
|
||||
*/
|
||||
public interface Constants {
|
||||
/**
|
||||
* 默认的端口分组ID
|
||||
*/
|
||||
int DEFAULT_PORT_GROUP_ID = 1;
|
||||
}
|
||||
+5
-3
@@ -7,6 +7,8 @@ import fun.asgc.neutrino.proxy.server.base.page.PageInfo;
|
||||
import fun.asgc.neutrino.proxy.server.base.page.PageQuery;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.ServiceException;
|
||||
import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder;
|
||||
import fun.asgc.neutrino.proxy.server.constant.Constants;
|
||||
import fun.asgc.neutrino.proxy.server.constant.EnableStatusEnum;
|
||||
import fun.asgc.neutrino.proxy.server.constant.ExceptionConstant;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.PortGroupCreateReq;
|
||||
import fun.asgc.neutrino.proxy.server.controller.req.PortGroupListReq;
|
||||
@@ -54,7 +56,7 @@ public class PortGroupService {
|
||||
portGroupDO.setName(req.getName());
|
||||
portGroupDO.setPossessorType(req.getPossessorType());
|
||||
portGroupDO.setPossessorId(req.getPossessorId());
|
||||
portGroupDO.setEnable(1);
|
||||
portGroupDO.setEnable(EnableStatusEnum.ENABLE.getStatus());
|
||||
portGroupDO.setCreateTime(now);
|
||||
portGroupDO.setUpdateTime(now);
|
||||
portGroupMapper.insert(portGroupDO);
|
||||
@@ -85,7 +87,7 @@ public class PortGroupService {
|
||||
}
|
||||
|
||||
public void delete(Integer id) {
|
||||
if (id == 1) {
|
||||
if (id == Constants.DEFAULT_PORT_GROUP_ID) {
|
||||
throw ServiceException.create(ExceptionConstant.DEFAULT_GROUP_FORBID_DELETE);
|
||||
}
|
||||
PortGroupDO portGroupDO = portGroupMapper.selectById(id);
|
||||
@@ -96,7 +98,7 @@ public class PortGroupService {
|
||||
//修改绑定此分组的端口到默认分组
|
||||
portPoolMapper.update(null, Wrappers.lambdaUpdate(PortPoolDO.class)
|
||||
.eq(PortPoolDO::getGroupId, portGroupDO.getId())
|
||||
.set(PortPoolDO::getGroupId, 1)
|
||||
.set(PortPoolDO::getGroupId, Constants.DEFAULT_PORT_GROUP_ID)
|
||||
.set(PortPoolDO::getUpdateTime, new Date())
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -33,11 +33,11 @@
|
||||
- 今日流量折线图(上行、下行、总流量,按分钟统计0~24小时)
|
||||
# Bug
|
||||
- windows环境下直接运行发布版的jar包,日志输出乱码
|
||||
- 部份用户windows环境下启动客户端,扫描类个数为0个
|
||||
- ~~部份用户windows环境下启动客户端,扫描类个数为0个~~
|
||||
- 代理mysql时,使用未开启远程访问的账号走代理访问mysql,代理客户端出现断开现象
|
||||
|
||||
# 2.x规划
|
||||
- 全面重构:底层更换为Solon + Mybatis Plus
|
||||
- [x] 全面重构:底层更换为Solon + Mybatis Plus
|
||||
- 规范协议:代理协议规范化,方便后续更好扩展、支持不同语言客户端接入
|
||||
- 端口池优化:支持为license设置独占端口。方便后续开发jetbrains插件、solon插件
|
||||
- 精细化控制:支持针对用户限速、限流
|
||||
|
||||
Reference in New Issue
Block a user