fix 增加poster日志

master
luoyang 6 years ago
parent 25ef91379f
commit 060390ca9d

@ -13,7 +13,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version> <jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.27</docker-image.version> <docker-image.version>1.0.28</docker-image.version>
</properties> </properties>
<dependencies> <dependencies>

@ -2,9 +2,7 @@ package au.com.royalpay.payment.manage.posters.core.impls;
import au.com.royalpay.payment.manage.posters.core.PosterService; import au.com.royalpay.payment.manage.posters.core.PosterService;
import cn.yixblog.platform.http.HttpRequestGenerator; import cn.yixblog.platform.http.HttpRequestGenerator;
import com.alibaba.fastjson.JSONObject; import cn.yixblog.platform.http.HttpRequestResult;
import com.yeepay.shade.org.apache.http.protocol.HTTP;
import org.apache.http.entity.StringEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -21,16 +19,22 @@ import java.net.URISyntaxException;
@Service @Service
public class PosterServiceImpl implements PosterService { public class PosterServiceImpl implements PosterService {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
@Value("${app.cms.host}") @Value("${app.cms.host}")
private String cmsHost; private String cmsHost;
@Override @Override
public void updatePoster(String imgUrl) { public void updatePoster(String imgUrl) {
String url = cmsHost + "/api/statistics/count"; String url = cmsHost + "/api/statistics/count";
HttpRequestGenerator htg = new HttpRequestGenerator(url, RequestMethod.PUT);
try { try {
logger.info("Before : Request CMS service"); HttpRequestResult result = htg.addQueryString("imgUrl", imgUrl).execute();
new HttpRequestGenerator(url, RequestMethod.PUT).addQueryString("imgUrl", imgUrl).execute(); if (result.isSuccess()) {
logger.info("Before : Request CMS service"); int statusCode = result.getStatusCode();
if (statusCode == 200) {
logger.info("CMS request succeeded");
}
}
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
e.printStackTrace(); e.printStackTrace();
} }

Loading…
Cancel
Save