test:(测试)

dev
zhang xu 2024-06-01 20:25:36 +08:00
parent ced68c06c0
commit a06d845b7a
6 changed files with 47 additions and 25 deletions

View File

@ -102,6 +102,19 @@ public class SysUser extends BaseEntity {
@Excel(name = "最后登录IP", type = Type.EXPORT) @Excel(name = "最后登录IP", type = Type.EXPORT)
private String loginIp; private String loginIp;
/**
* id
* */
private Long entId;
public Long getEntId() {
return entId;
}
public void setEntId(Long entId) {
this.entId = entId;
}
/** /**
* *
*/ */

View File

@ -22,9 +22,7 @@ import java.util.HashMap;
*/ */
@Log4j2 @Log4j2
public class Test { public class Test {
public static void main(String[] args) { public static void main(String[] args) {
// 测试 // 测试
String url="http://115.159.67.205:10006/webhook/%E5%A2%9E%E5%80%BC%E6%9C%8D%E5%8A%A1"; String url="http://115.159.67.205:10006/webhook/%E5%A2%9E%E5%80%BC%E6%9C%8D%E5%8A%A1";
HashMap<String, String> hashMap = new HashMap<>(); HashMap<String, String> hashMap = new HashMap<>();
@ -33,7 +31,6 @@ public class Test {
String json = JSON.toJSONString(hashMap); String json = JSON.toJSONString(hashMap);
// 创建连接与设置连接参数 // 创建连接与设置连接参数
URL urlObj=null; URL urlObj=null;
try { try {
URL postMan = new URL(url); URL postMan = new URL(url);
HttpURLConnection httpConn = (HttpURLConnection) urlObj.openConnection(); HttpURLConnection httpConn = (HttpURLConnection) urlObj.openConnection();
@ -57,8 +54,5 @@ public class Test {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
} }

View File

@ -1,6 +1,7 @@
package com.muyu.networking.mapper; package com.muyu.networking.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.domain.Information; import com.muyu.domain.Information;
import java.util.List; import java.util.List;
@ -11,7 +12,7 @@ import java.util.List;
* @author ruoyi * @author ruoyi
* @date 2024-05-27 * @date 2024-05-27
*/ */
public interface InformationMapper public interface InformationMapper extends BaseMapper<Information>
{ {
/** /**
* *

View File

@ -1,4 +1,5 @@
package com.muyu.networking.service; package com.muyu.networking.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.domain.Enterprise; import com.muyu.domain.Enterprise;
import java.util.List; import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
* @author ruoyi * @author ruoyi
* @date 2024-05-25 * @date 2024-05-25
*/ */
public interface EnterpriseService public interface EnterpriseService extends IService<Enterprise>
{ {
/** /**
* *

View File

@ -7,12 +7,15 @@ package com.muyu.networking.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.DateUtils; import com.muyu.common.core.utils.DateUtils;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.SysUser; import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.remote.RemoteUserService; import com.muyu.common.system.remote.RemoteUserService;
import com.muyu.domain.Enterprise; import com.muyu.domain.Enterprise;
import com.muyu.networking.mapper.EnterpriseMapper; import com.muyu.networking.mapper.EnterpriseMapper;
import com.muyu.networking.service.EnterpriseService; import com.muyu.networking.service.EnterpriseService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -20,19 +23,6 @@ import org.springframework.stereotype.Service;
import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.CreateContainerCmd;
import com.github.dockerjava.api.command.CreateContainerResponse;
import com.github.dockerjava.api.command.ExecCreateCmdResponse;
import com.github.dockerjava.api.command.InspectContainerResponse;
import com.github.dockerjava.core.DefaultDockerClientConfig;
import com.github.dockerjava.core.DockerClientBuilder;
import com.github.dockerjava.core.command.ExecStartResultCallback;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -45,7 +35,7 @@ import java.util.UUID;
* @date 2024-05-25 * @date 2024-05-25
*/ */
@Service @Service
public class EnterpriseServiceImpl implements EnterpriseService public class EnterpriseServiceImpl extends ServiceImpl<EnterpriseMapper,Enterprise> implements EnterpriseService
{ {
@Autowired @Autowired
private EnterpriseMapper enterpriseMapper; private EnterpriseMapper enterpriseMapper;
@ -71,8 +61,24 @@ public class EnterpriseServiceImpl implements EnterpriseService
@Override @Override
public List<Enterprise> selectEnterpriseList(Enterprise enterprise) public List<Enterprise> selectEnterpriseList(Enterprise enterprise)
{ {
//
// SysUser sysUser = SysUser.builder()
// .entId(enterprise.getId())
// .build();
SysUser sysUser = new SysUser();
sysUser.setUserName("admin");
if (sysUser.getUserName().equals("admin")){
return enterpriseMapper.selectEnterpriseList(enterprise); return enterpriseMapper.selectEnterpriseList(enterprise);
} }
LambdaQueryWrapper<Enterprise> lambdaQueryWrapper = new LambdaQueryWrapper<>() {{
eq(Enterprise::getId, enterprise.getId());
}};
return enterpriseMapper.selectList(lambdaQueryWrapper);
}
@Autowired @Autowired
private RemoteUserService remoteUserService; private RemoteUserService remoteUserService;
/** /**
@ -90,8 +96,10 @@ public class EnterpriseServiceImpl implements EnterpriseService
enterprise.setStatus("1"); enterprise.setStatus("1");
enterprise.setCertification("1"); enterprise.setCertification("1");
enterprise.setOpenAdd("0"); enterprise.setOpenAdd("0");
SysUser sysUser = SysUser.builder().userName(enterprise.getEnterpriseName()) SysUser sysUser = SysUser.builder().userName(
enterprise.getEnterpriseName())
.password("admin") .password("admin")
.entId(enterprise.getId())
.nickName(enterprise.getEnterpriseName()). .nickName(enterprise.getEnterpriseName()).
userType(String.valueOf(enterprise.getId())) userType(String.valueOf(enterprise.getId()))
.build(); .build();

View File

@ -1,6 +1,9 @@
package com.muyu.networking.service.impl; package com.muyu.networking.service.impl;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.DateUtils; import com.muyu.common.core.utils.DateUtils;
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory; import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
import com.muyu.domain.Information; import com.muyu.domain.Information;
@ -17,7 +20,7 @@ import org.springframework.stereotype.Service;
* @date 2024-05-27 * @date 2024-05-27
*/ */
@Service @Service
public class InformationServiceImpl implements IInformationService public class InformationServiceImpl extends ServiceImpl<InformationMapper, Information> implements IInformationService
{ {
@Autowired @Autowired
private InformationMapper informationMapper; private InformationMapper informationMapper;
@ -45,6 +48,8 @@ public class InformationServiceImpl implements IInformationService
@Override @Override
public List<Information> selectInformationList(Information information) public List<Information> selectInformationList(Information information)
{ {
return informationMapper.selectInformationList(information); return informationMapper.selectInformationList(information);
} }