新增license管理页面对接

This commit is contained in:
aoshiguchen
2022-09-01 17:17:08 +08:00
parent 02867d5b12
commit 767066f70a
16 changed files with 352 additions and 242 deletions
@@ -58,6 +58,10 @@ public class PortMappingListRes {
* 客户端ip
*/
private String clientIp;
/**
* 客户端端口
*/
private Integer clientPort;
/**
* 客户端端口
*/
@@ -63,8 +63,8 @@ public interface LicenseMapper extends SqlMapper {
*/
int add(LicenseDO license);
@Update("update `license` set enable = :enable where id = :id")
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable);
@Update("update `license` set enable = :enable, update_time = :updateTime where id = :id")
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable, @Param("updateTime") Date updateTime);
@Update("update `license` set key = :key,update_time = :updateTime where id = :id")
void reset(@Param("id") Integer id, @Param("key") String key, @Param("updateTime") Date updateTime);
@@ -75,11 +75,11 @@ public interface LicenseMapper extends SqlMapper {
@Select("select * from `license` where id = ?")
LicenseDO findById(Integer id);
@Update("update `license` set name = :name where id = :id")
void update(@Param("id") Integer id, @Param("name") String name);
@Update("update `license` set name = :name, update_time = :updateTime where id = :id")
void update(@Param("id") Integer id, @Param("name") String name, @Param("updateTime") Date updateTime);
@ResultType(LicenseDO.class)
@Select("select * from `license` where in in (:ids)")
@Select("select * from `license` where id in (:ids)")
List<LicenseDO> findByIds(@Param("ids")Set<Integer> ids);
@ResultType(LicenseDO.class)
@@ -30,6 +30,7 @@ import fun.asgc.neutrino.proxy.server.controller.req.PortPoolListReq;
import fun.asgc.neutrino.proxy.server.controller.res.PortPoolListRes;
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
import java.util.Date;
import java.util.List;
/**
@@ -51,8 +52,8 @@ public interface PortPoolMapper extends SqlMapper {
@Insert("insert into port_pool(`port`,`enable`,`create_time`,`update_time`) values(:port,:enable,:createTime,:updateTime)")
void add(PortPoolDO portPool);
@Update("update `port_pool` set enable = :enable where id = :id")
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable);
@Update("update `port_pool` set enable = :enable, update_time = :updateTime where id = :id")
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable, @Param("updateTime") Date updateTime);
@Delete("delete from `port_pool` where id = ?")
void delete(Integer id);
@@ -31,6 +31,7 @@ import fun.asgc.neutrino.proxy.server.controller.res.UserListRes;
import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO;
import fun.asgc.neutrino.proxy.server.dal.entity.UserDO;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -70,17 +71,17 @@ public interface UserMapper extends SqlMapper {
@Select("select * from user where enable = 1")
List<UserListRes> list();
@Update("update `user` set enable = :enable where id = :id")
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable);
@Update("update `user` set enable = :enable,update_time = :updateTime where id = :id")
void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable, @Param("updateTime")Date updateTime);
@Delete("delete from `user` where id = ?")
void delete(Integer id);
@Update("update `user` set name = :name,login_name = :loginName where id = :id")
@Update("update `user` set name = :name,login_name = :loginName,update_time = :updateTime where id = :id")
void update(UserDO userDO);
@Update("update `user` set login_password = :loginPassword where id = :id")
void updateLoginPassword(@Param("id") Integer id, @Param("loginPassword") String loginPassword);
@Update("update `user` set login_password = :loginPassword,update_time = :updateTime where id = :id")
void updateLoginPassword(@Param("id") Integer id, @Param("loginPassword") String loginPassword, @Param("updateTime")Date updateTime);
@Insert("insert into user(`name`,`login_name`,`login_password`,`enable`,`create_time`,`update_time`) values(:name,:loginName,:loginPassword,:enable,:createTime,:updateTime)")
void add(UserDO user);
@@ -125,7 +125,7 @@ public class LicenseService {
LicenseDO licenseCheck = licenseMapper.checkRepeat(oldLicenseDO.getUserId(), req.getName(), Sets.newHashSet(oldLicenseDO.getId()));
ParamCheckUtil.checkExpression(null == licenseCheck, ExceptionConstant.LICENSE_NAME_CANNOT_REPEAT);
licenseMapper.update(req.getId(), req.getName());
licenseMapper.update(req.getId(), req.getName(), new Date());
return new LicenseUpdateRes();
}
@@ -158,7 +158,7 @@ public class LicenseService {
* @return
*/
public LicenseUpdateEnableStatusRes updateEnableStatus(LicenseUpdateEnableStatusReq req) {
licenseMapper.updateEnableStatus(req.getId(), req.getEnable());
licenseMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
return new LicenseUpdateEnableStatusRes();
}
@@ -79,7 +79,7 @@ public class PortPoolService {
public PortPoolUpdateEnableStatusRes updateEnableStatus(PortPoolUpdateEnableStatusReq req) {
portPoolMapper.updateEnableStatus(req.getId(), req.getEnable());
portPoolMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
return new PortPoolUpdateEnableStatusRes();
}
@@ -158,7 +158,7 @@ public class UserService {
}
public UserUpdateEnableStatusRes updateEnableStatus(UserUpdateEnableStatusReq req) {
userMapper.updateEnableStatus(req.getId(), req.getEnable());
userMapper.updateEnableStatus(req.getId(), req.getEnable(), new Date());
return new UserUpdateEnableStatusRes();
}
@@ -191,7 +191,7 @@ public class UserService {
public UserUpdatePasswordRes updatePassword(UserUpdatePasswordReq req) {
String loginPassword = Md5Util.encode(req.getLoginPassword());
userMapper.updateLoginPassword(req.getId(), loginPassword);
userMapper.updateLoginPassword(req.getId(), loginPassword, new Date());
return new UserUpdatePasswordRes();
}