|
|
@ -2,7 +2,6 @@ package cn.teammodel.utils;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.teammodel.common.ErrorCode;
|
|
|
|
import cn.teammodel.common.ErrorCode;
|
|
|
|
import cn.teammodel.config.exception.ServiceException;
|
|
|
|
import cn.teammodel.config.exception.ServiceException;
|
|
|
|
import cn.teammodel.model.dto.admin.common.GroupDto;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.fasterxml.jackson.databind.type.TypeFactory;
|
|
|
|
import com.fasterxml.jackson.databind.type.TypeFactory;
|
|
|
|
import org.apache.http.HttpEntity;
|
|
|
|
import org.apache.http.HttpEntity;
|
|
|
@ -13,12 +12,8 @@ import org.apache.http.entity.StringEntity;
|
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
|
|
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
|
|
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
@ -34,7 +29,7 @@ public class GroupUtil {
|
|
|
|
public static Map<String, Object> getGroupId(Object obj, GroupUtil groupUtil, HttpServletRequest request,String url) {
|
|
|
|
public static Map<String, Object> getGroupId(Object obj, GroupUtil groupUtil, HttpServletRequest request,String url) {
|
|
|
|
Map<String, Object> mapper = new HashMap<>();
|
|
|
|
Map<String, Object> mapper = new HashMap<>();
|
|
|
|
String evnStr = groupUtil.env.getProperty("spring.env");
|
|
|
|
String evnStr = groupUtil.env.getProperty("spring.env");
|
|
|
|
String apiUrl = "";
|
|
|
|
String apiUrl;
|
|
|
|
if (evnStr != null && evnStr.equalsIgnoreCase("dev")) {
|
|
|
|
if (evnStr != null && evnStr.equalsIgnoreCase("dev")) {
|
|
|
|
apiUrl = "https://test.teammodel.cn" + url;
|
|
|
|
apiUrl = "https://test.teammodel.cn" + url;
|
|
|
|
|
|
|
|
|
|
|
|