百度服务 fib bug
This commit is contained in:
parent
d2882f39b0
commit
a6f53f4535
@ -314,6 +314,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
||||||
<!--本地环境 -->
|
<!--本地环境 -->
|
||||||
<profile>
|
<profile>
|
||||||
<id>local</id>
|
<id>local</id>
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import cn.hutool.json.JSONArray;
|
|||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.suisung.mall.common.exception.ApiException;
|
|
||||||
import com.suisung.mall.common.pojo.dto.BaiduAiBriefDTO;
|
import com.suisung.mall.common.pojo.dto.BaiduAiBriefDTO;
|
||||||
import com.suisung.mall.common.utils.CheckUtil;
|
import com.suisung.mall.common.utils.CheckUtil;
|
||||||
import com.suisung.mall.common.utils.HttpServletUtils;
|
import com.suisung.mall.common.utils.HttpServletUtils;
|
||||||
@ -14,20 +13,26 @@ import com.suisung.mall.shop.config.BaiduConfig;
|
|||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
public class BaiduAi {
|
public class BaiduAi {
|
||||||
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
|
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
|
||||||
private static final Logger log = LoggerFactory.getLogger(BaiduAi.class);
|
private static final Logger log = LoggerFactory.getLogger(BaiduAi.class);
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
@Autowired
|
||||||
|
private BaiduConfig baiduConfig;
|
||||||
|
|
||||||
|
|
||||||
|
public void main(String[] args) {
|
||||||
|
|
||||||
String url = "https://lancerdt.oss-accelerate.aliyuncs.com/mall/images/media/store/10002/20240123d3c27007baf740c9bdc429f850259501.jpg";
|
String url = "https://lancerdt.oss-accelerate.aliyuncs.com/mall/images/media/store/10002/20240123d3c27007baf740c9bdc429f850259501.jpg";
|
||||||
BaiduAiBriefDTO brief = new BaiduAiBriefDTO();
|
BaiduAiBriefDTO brief = new BaiduAiBriefDTO();
|
||||||
@ -67,90 +72,7 @@ public class BaiduAi {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String addProductImg(String url, BaiduAiBriefDTO brief) {
|
public String removeProductImg(String url, String cont_sign) {
|
||||||
Map<String, String> map = new HashMap<>();
|
|
||||||
map.put("url", url);
|
|
||||||
map.put("brief", JSON.toJSONString(brief));
|
|
||||||
|
|
||||||
String par = "";
|
|
||||||
|
|
||||||
try {
|
|
||||||
par = HttpServletUtils.generateParams(map, "utf-8");
|
|
||||||
|
|
||||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
||||||
RequestBody body = RequestBody.create(mediaType, par);
|
|
||||||
Request request = new Request.Builder()
|
|
||||||
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/add?access_token=" + BaiduConfig.getAccessToken())
|
|
||||||
.method("POST", body)
|
|
||||||
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
|
||||||
.addHeader("Accept", "application/json")
|
|
||||||
.build();
|
|
||||||
Response response = HTTP_CLIENT.newCall(request).execute();
|
|
||||||
|
|
||||||
String resultStr = response.body().string();
|
|
||||||
System.out.println(resultStr);
|
|
||||||
|
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(resultStr);
|
|
||||||
Integer errCode = Convert.toInt(jsonObject.get("error_code"));
|
|
||||||
// String errMessage = Convert.toStr(jsonObject.get("error_msg"));
|
|
||||||
String contSign = Convert.toStr(jsonObject.get("cont_sign"));
|
|
||||||
|
|
||||||
if (CheckUtil.isNotEmpty(errCode)) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return contSign;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Baidu Ai 添加图片异常", e.getMessage());
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String editProductImg(String url, BaiduAiBriefDTO brief) {
|
|
||||||
Map<String, String> map = new HashMap<>();
|
|
||||||
map.put("url", url);
|
|
||||||
map.put("brief", JSON.toJSONString(brief));
|
|
||||||
|
|
||||||
String par = "";
|
|
||||||
|
|
||||||
try {
|
|
||||||
par = HttpServletUtils.generateParams(map, "utf-8");
|
|
||||||
|
|
||||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
|
||||||
RequestBody body = RequestBody.create(mediaType, par);
|
|
||||||
Request request = new Request.Builder()
|
|
||||||
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/update?access_token=" + BaiduConfig.getAccessToken())
|
|
||||||
.method("POST", body)
|
|
||||||
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
|
||||||
.addHeader("Accept", "application/json")
|
|
||||||
.build();
|
|
||||||
Response response = HTTP_CLIENT.newCall(request).execute();
|
|
||||||
|
|
||||||
String resultStr = response.body().string();
|
|
||||||
System.out.println(resultStr);
|
|
||||||
|
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(resultStr);
|
|
||||||
|
|
||||||
Integer errCode = Convert.toInt(jsonObject.get("error_code"));
|
|
||||||
String errMessage = Convert.toStr(jsonObject.get("error_msg"));
|
|
||||||
String contSign = Convert.toStr(jsonObject.get("cont_sign"));
|
|
||||||
|
|
||||||
if (CheckUtil.isEmpty(errCode)) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return contSign;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Baidu Ai 编辑图片异常", e.getMessage());
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String removeProductImg(String url, String cont_sign) {
|
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
if (CheckUtil.isNotEmpty(url)) {
|
if (CheckUtil.isNotEmpty(url)) {
|
||||||
@ -169,7 +91,7 @@ public class BaiduAi {
|
|||||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
RequestBody body = RequestBody.create(mediaType, par);
|
RequestBody body = RequestBody.create(mediaType, par);
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/delete?access_token=" + BaiduConfig.getAccessToken())
|
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/delete?access_token=" + baiduConfig.getAccessToken())
|
||||||
.method("POST", body)
|
.method("POST", body)
|
||||||
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||||
.addHeader("Accept", "application/json")
|
.addHeader("Accept", "application/json")
|
||||||
@ -195,7 +117,7 @@ public class BaiduAi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Map> searchProductImg(String url, Integer pn, Integer rn) {
|
public List<Map> searchProductImg(String url, Integer pn, Integer rn) {
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put("url", url);
|
map.put("url", url);
|
||||||
|
|
||||||
@ -216,7 +138,7 @@ public class BaiduAi {
|
|||||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
RequestBody body = RequestBody.create(mediaType, par);
|
RequestBody body = RequestBody.create(mediaType, par);
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/search?access_token=" + BaiduConfig.getAccessToken())
|
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/search?access_token=" + baiduConfig.getAccessToken())
|
||||||
.method("POST", body)
|
.method("POST", body)
|
||||||
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||||
.addHeader("Accept", "application/json")
|
.addHeader("Accept", "application/json")
|
||||||
@ -254,4 +176,85 @@ public class BaiduAi {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String addProductImg(String url, BaiduAiBriefDTO brief) {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("url", url);
|
||||||
|
map.put("brief", JSON.toJSONString(brief));
|
||||||
|
|
||||||
|
String par = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
par = HttpServletUtils.generateParams(map, "utf-8");
|
||||||
|
|
||||||
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
|
RequestBody body = RequestBody.create(mediaType, par);
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/add?access_token=" + baiduConfig.getAccessToken())
|
||||||
|
.method("POST", body)
|
||||||
|
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
.addHeader("Accept", "application/json")
|
||||||
|
.build();
|
||||||
|
Response response = HTTP_CLIENT.newCall(request).execute();
|
||||||
|
|
||||||
|
String resultStr = response.body().string();
|
||||||
|
System.out.println(resultStr);
|
||||||
|
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(resultStr);
|
||||||
|
Integer errCode = Convert.toInt(jsonObject.get("error_code"));
|
||||||
|
// String errMessage = Convert.toStr(jsonObject.get("error_msg"));
|
||||||
|
String contSign = Convert.toStr(jsonObject.get("cont_sign"));
|
||||||
|
|
||||||
|
if (CheckUtil.isNotEmpty(errCode)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return contSign;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Baidu Ai 添加图片异常", e.getMessage());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String editProductImg(String url, BaiduAiBriefDTO brief) {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("url", url);
|
||||||
|
map.put("brief", JSON.toJSONString(brief));
|
||||||
|
|
||||||
|
String par = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
par = HttpServletUtils.generateParams(map, "utf-8");
|
||||||
|
|
||||||
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
|
RequestBody body = RequestBody.create(mediaType, par);
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url("https://aip.baidubce.com/rest/2.0/image-classify/v1/realtime_search/product/update?access_token=" + baiduConfig.getAccessToken())
|
||||||
|
.method("POST", body)
|
||||||
|
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
.addHeader("Accept", "application/json")
|
||||||
|
.build();
|
||||||
|
Response response = HTTP_CLIENT.newCall(request).execute();
|
||||||
|
|
||||||
|
String resultStr = response.body().string();
|
||||||
|
System.out.println(resultStr);
|
||||||
|
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(resultStr);
|
||||||
|
|
||||||
|
Integer errCode = Convert.toInt(jsonObject.get("error_code"));
|
||||||
|
String errMessage = Convert.toStr(jsonObject.get("error_msg"));
|
||||||
|
String contSign = Convert.toStr(jsonObject.get("cont_sign"));
|
||||||
|
|
||||||
|
if (CheckUtil.isEmpty(errCode)) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return contSign;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Baidu Ai 编辑图片异常", e.getMessage());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,9 +1,7 @@
|
|||||||
package com.suisung.mall.shop.config;
|
package com.suisung.mall.shop.config;
|
||||||
|
|
||||||
import com.suisung.mall.shop.base.service.AccountBaseConfigService;
|
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@ -13,26 +11,20 @@ import java.io.IOException;
|
|||||||
* OSS对象存储相关配置
|
* OSS对象存储相关配置
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
//@Service
|
||||||
public class BaiduConfig {
|
public class BaiduConfig {
|
||||||
@Autowired
|
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
|
||||||
static private AccountBaseConfigService accountBaseConfigService;
|
|
||||||
|
|
||||||
@Value("#{accountBaseConfigService.getConfig('baidu_app_id')}")
|
@Value("#{accountBaseConfigService.getConfig('baidu_app_id')}")
|
||||||
static private String appId;
|
private String appId;
|
||||||
|
|
||||||
@Value("#{accountBaseConfigService.getConfig('baidu_secret_id')}")
|
@Value("#{accountBaseConfigService.getConfig('baidu_secret_id')}")
|
||||||
static private String apiKey;
|
private String apiKey;
|
||||||
|
|
||||||
@Value("#{accountBaseConfigService.getConfig('baidu_secret_key')}")
|
@Value("#{accountBaseConfigService.getConfig('baidu_secret_key')}")
|
||||||
static private String secretKey;
|
private String secretKey;
|
||||||
|
|
||||||
@Value("#{accountBaseConfigService.getConfig('baidu_translate_app_id')}")
|
@Value("#{accountBaseConfigService.getConfig('baidu_translate_app_id')}")
|
||||||
static private String translateAppId;
|
private String translateAppId;
|
||||||
|
|
||||||
@Value("#{accountBaseConfigService.getConfig('baidu_translate_app_key')}")
|
@Value("#{accountBaseConfigService.getConfig('baidu_translate_app_key')}")
|
||||||
static private String translateAppKey;
|
private String translateAppKey;
|
||||||
|
|
||||||
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从用户的AK,SK生成鉴权签名(Access Token)
|
* 从用户的AK,SK生成鉴权签名(Access Token)
|
||||||
@ -40,7 +32,7 @@ public class BaiduConfig {
|
|||||||
* @return 鉴权签名(Access Token)
|
* @return 鉴权签名(Access Token)
|
||||||
* @throws IOException IO异常
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
public static String getAccessToken() throws IOException {
|
public String getAccessToken() throws IOException {
|
||||||
|
|
||||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
RequestBody body = RequestBody.create(mediaType, "grant_type=client_credentials&client_id=" + apiKey
|
RequestBody body = RequestBody.create(mediaType, "grant_type=client_credentials&client_id=" + apiKey
|
||||||
|
|||||||
@ -25,7 +25,6 @@ import com.suisung.mall.common.constant.CommonConstant;
|
|||||||
import com.suisung.mall.common.constant.ConfigConstant;
|
import com.suisung.mall.common.constant.ConfigConstant;
|
||||||
import com.suisung.mall.common.constant.MqConstant;
|
import com.suisung.mall.common.constant.MqConstant;
|
||||||
import com.suisung.mall.common.domain.UserDto;
|
import com.suisung.mall.common.domain.UserDto;
|
||||||
import com.suisung.mall.common.enums.DicEnum;
|
|
||||||
import com.suisung.mall.common.exception.ApiException;
|
import com.suisung.mall.common.exception.ApiException;
|
||||||
import com.suisung.mall.common.feignService.EduService;
|
import com.suisung.mall.common.feignService.EduService;
|
||||||
import com.suisung.mall.common.feignService.SearchService;
|
import com.suisung.mall.common.feignService.SearchService;
|
||||||
@ -49,7 +48,6 @@ import com.suisung.mall.common.utils.CSVUtils;
|
|||||||
import com.suisung.mall.common.utils.CheckUtil;
|
import com.suisung.mall.common.utils.CheckUtil;
|
||||||
import com.suisung.mall.common.utils.CommonUtil;
|
import com.suisung.mall.common.utils.CommonUtil;
|
||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import com.suisung.mall.core.web.service.RedisService;
|
|
||||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||||
import com.suisung.mall.shop.activity.service.ShopActivityGroupbookingService;
|
import com.suisung.mall.shop.activity.service.ShopActivityGroupbookingService;
|
||||||
import com.suisung.mall.shop.base.service.*;
|
import com.suisung.mall.shop.base.service.*;
|
||||||
@ -65,8 +63,6 @@ import com.suisung.mall.shop.product.pojo.vo.ProductVo;
|
|||||||
import com.suisung.mall.shop.product.service.*;
|
import com.suisung.mall.shop.product.service.*;
|
||||||
import com.suisung.mall.shop.sixun.service.SxSyncGoodsService;
|
import com.suisung.mall.shop.sixun.service.SxSyncGoodsService;
|
||||||
import com.suisung.mall.shop.store.service.*;
|
import com.suisung.mall.shop.store.service.*;
|
||||||
import com.suisung.mall.shop.sync.service.ProductMappingService;
|
|
||||||
import com.suisung.mall.shop.sync.service.StoreDbConfigService;
|
|
||||||
import com.suisung.mall.shop.user.service.*;
|
import com.suisung.mall.shop.user.service.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -106,6 +102,7 @@ import static io.seata.common.util.LambdaUtils.distinctByKey;
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Service
|
@Service
|
||||||
public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseMapper, ShopProductBase> implements ShopProductBaseService {
|
public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseMapper, ShopProductBase> implements ShopProductBaseService {
|
||||||
|
private final static int delate_batch_limit = 100;//删除最大限制
|
||||||
private final Logger logger = LoggerFactory.getLogger(ShopProductBaseServiceImpl.class);
|
private final Logger logger = LoggerFactory.getLogger(ShopProductBaseServiceImpl.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopBaseProductCategoryService shopBaseProductCategoryService;
|
private ShopBaseProductCategoryService shopBaseProductCategoryService;
|
||||||
@ -201,15 +198,10 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
|
|||||||
private ShopBaseLangMetaService shopBaseLangMetaService;
|
private ShopBaseLangMetaService shopBaseLangMetaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SxSyncGoodsService sxSyncGoodsService;
|
private SxSyncGoodsService sxSyncGoodsService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlatformTransactionManager transactionManager;
|
private PlatformTransactionManager transactionManager;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProductMappingService productMappingService;
|
private BaiduAi BaiduAi;
|
||||||
|
|
||||||
|
|
||||||
private final static int delate_batch_limit=100;//删除最大限制
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean trySaveProduct(String productObj, String productItems) {
|
public boolean trySaveProduct(String productObj, String productItems) {
|
||||||
@ -6272,6 +6264,7 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计商品的库存
|
* 统计商品的库存
|
||||||
|
*
|
||||||
* @param items
|
* @param items
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
29
pom.xml
29
pom.xml
@ -31,7 +31,7 @@
|
|||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<skipTests>true</skipTests>
|
<skipTests>true</skipTests>
|
||||||
<!-- Docker 远程管理地址全局-->
|
<!-- Docker 远程管理地址全局-->
|
||||||
<!-- <docker.host>https://42.194.196.179:2375</docker.host>-->
|
<!-- <docker.host>https://159.75.249.163:2275</docker.host>-->
|
||||||
<docker.maven.plugin.version>1.2.2</docker.maven.plugin.version>
|
<docker.maven.plugin.version>1.2.2</docker.maven.plugin.version>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<spring-cloud.version>Hoxton.SR5</spring-cloud.version>
|
<spring-cloud.version>Hoxton.SR5</spring-cloud.version>
|
||||||
@ -76,12 +76,12 @@
|
|||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.springframework.boot</groupId>
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<!-- <artifactId>spring-boot-devtools</artifactId>-->
|
||||||
<scope>runtime</scope>
|
<!-- <scope>runtime</scope>-->
|
||||||
<optional>true</optional>
|
<!-- <optional>true</optional>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
@ -296,7 +296,10 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
|
|
||||||
<!-- 本地环境 -->
|
<!-- 本地环境 -->
|
||||||
<id>local</id>
|
<id>local</id>
|
||||||
<properties>
|
<properties>
|
||||||
@ -323,7 +326,7 @@
|
|||||||
<mysql.user>web_dev</mysql.user>
|
<mysql.user>web_dev</mysql.user>
|
||||||
<mysql.pwd>Abc654321$^</mysql.pwd>
|
<mysql.pwd>Abc654321$^</mysql.pwd>
|
||||||
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
||||||
<!-- <mysql.host>42.194.196.179</mysql.host>-->
|
<!-- <mysql.host>159.75.249.163</mysql.host>-->
|
||||||
<!-- <mysql.port>3306</mysql.port>-->
|
<!-- <mysql.port>3306</mysql.port>-->
|
||||||
<!-- <mysql.db>mall_prod</mysql.db>-->
|
<!-- <mysql.db>mall_prod</mysql.db>-->
|
||||||
<!-- <mysql.user>root</mysql.user>-->
|
<!-- <mysql.user>root</mysql.user>-->
|
||||||
@ -334,7 +337,7 @@
|
|||||||
<redis.database>15</redis.database>
|
<redis.database>15</redis.database>
|
||||||
<redis.port>6379</redis.port>
|
<redis.port>6379</redis.port>
|
||||||
<redis.password>Gpff654321</redis.password>
|
<redis.password>Gpff654321</redis.password>
|
||||||
<!-- <redis.host>42.194.196.179</redis.host>-->
|
<!-- <redis.host>159.75.249.163</redis.host>-->
|
||||||
<!-- <redis.database>15</redis.database>-->
|
<!-- <redis.database>15</redis.database>-->
|
||||||
<!-- <redis.port>6480</redis.port>-->
|
<!-- <redis.port>6480</redis.port>-->
|
||||||
<!-- <redis.password>hwe9EgqgMAwY</redis.password>-->
|
<!-- <redis.password>hwe9EgqgMAwY</redis.password>-->
|
||||||
@ -462,7 +465,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<spring.profile>prod</spring.profile>
|
<spring.profile>prod</spring.profile>
|
||||||
<!-- Docker 远程管理地址全局-->
|
<!-- Docker 远程管理地址全局-->
|
||||||
<docker.host>https://42.194.196.179:2275</docker.host>
|
<docker.host>https://159.75.249.163:2275</docker.host>
|
||||||
<docker.ca>/Users/panjunjie/code/docker_registry_ca_prod</docker.ca>
|
<docker.ca>/Users/panjunjie/code/docker_registry_ca_prod</docker.ca>
|
||||||
<!-- nacos配置 -->
|
<!-- nacos配置 -->
|
||||||
<nacos.server.address>172.16.0.11:8848</nacos.server.address>
|
<nacos.server.address>172.16.0.11:8848</nacos.server.address>
|
||||||
@ -513,7 +516,11 @@
|
|||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
<build>
|
<build>
|
||||||
|
|
||||||
|
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
|
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@ -545,7 +552,7 @@
|
|||||||
<!--定义基础镜像-->
|
<!--定义基础镜像-->
|
||||||
<baseImage>java:8</baseImage>
|
<baseImage>java:8</baseImage>
|
||||||
<!--定义容器启动命令,注意不能换行-->
|
<!--定义容器启动命令,注意不能换行-->
|
||||||
<entryPoint>["java", "-jar", "-Xms128m", "-Xmx512m", "-XX:PermSize=64M", "-XX:MaxPermSize=512M", "-Dspring.profiles.active=${spring.profile}", "-Duser.timezone=Asia/Shanghai", "/${project.build.finalName}.jar"]
|
<entryPoint>["java", "-jar", "-Xms256m", "-Xmx512m", "-XX:PermSize=64M", "-XX:MaxPermSize=512M", "-Dspring.profiles.active=${spring.profile}", "-Duser.timezone=Asia/Shanghai", "/${project.build.finalName}.jar"]
|
||||||
</entryPoint>
|
</entryPoint>
|
||||||
<!--推送镜像仓库校验安全证书,无安全证书无法推送-->
|
<!--推送镜像仓库校验安全证书,无安全证书无法推送-->
|
||||||
<dockerCertPath>${docker.ca}</dockerCertPath>
|
<dockerCertPath>${docker.ca}</dockerCertPath>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user