|
|
@@ -117,7 +117,11 @@ public class IpTokenInterfaceServiceImpl implements IpTokenInterfaceService {
|
|
|
throw new RuntimeException("记录不存在");
|
|
|
}
|
|
|
IpTokenInterfacePO ipTokenInterfacePO = optional.get();
|
|
|
-
|
|
|
+ Long iid = ipTokenInterfacePO.getIid();
|
|
|
+ IpInterfacePO ipInterfacePO = ipInterfaceRepository.findById(iid).get();
|
|
|
+ if ("delete".equals(ipInterfacePO.getStatus()) && "normal".equals(switchStatusParam.getStatus())) {
|
|
|
+ throw new RuntimeException("接口已被删除,无法启用");
|
|
|
+ }
|
|
|
ipTokenInterfacePO.setStatus(switchStatusParam.getStatus());
|
|
|
ipTokenInterfaceRepository.save(ipTokenInterfacePO);
|
|
|
return true;
|
|
|
@@ -286,6 +290,7 @@ public class IpTokenInterfaceServiceImpl implements IpTokenInterfaceService {
|
|
|
ipTokenPO.setAddUserName(user.getUsername());
|
|
|
ipTokenPO.setAid(param.getAccountId());
|
|
|
ipTokenPO.setId(SnowflakeIdWorker.nextId());
|
|
|
+ ipTokenPO.setAddTime(new Date());
|
|
|
ipTokenInterfacePO.setTid(ipTokenPO.getId());
|
|
|
}
|
|
|
ipTokenPO.setRemark(param.getRemark());
|