From 18477706d12a1e6a5f3519ff9ff635101e385500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=B5=B7?= Date: Thu, 23 Apr 2020 17:30:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0github=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blog/service/serviceimpl/WebUpdateInfoServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/celess/blog/service/serviceimpl/WebUpdateInfoServiceImpl.java b/src/main/java/cn/celess/blog/service/serviceimpl/WebUpdateInfoServiceImpl.java index b8aac47..eee1da1 100644 --- a/src/main/java/cn/celess/blog/service/serviceimpl/WebUpdateInfoServiceImpl.java +++ b/src/main/java/cn/celess/blog/service/serviceimpl/WebUpdateInfoServiceImpl.java @@ -10,6 +10,7 @@ import cn.celess.blog.util.DateFormatUtil; import cn.celess.blog.util.HttpUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; @@ -27,6 +28,7 @@ import java.util.List; * @date : 2019/05/12 11:43 */ @Service +@Slf4j public class WebUpdateInfoServiceImpl implements WebUpdateInfoService { @Autowired WebUpdateInfoMapper webUpdateInfoMapper; @@ -99,8 +101,9 @@ public class WebUpdateInfoServiceImpl implements WebUpdateInfoService { SimpleDateFormat sdf = new SimpleDateFormat(); Instant parse = Instant.parse(commit.getJSONObject("committer").getString("date")); jsonObject.put("committerDate", DateFormatUtil.get(Date.from(parse))); + jsonObject.put("commitUrl", "https://github.com/xiaohai2271/blog-frontEnd/tree/"+object.getString("sha")); } catch (IOException e) { - jsonObject.put("lastCommit", null); + log.info("网络请求失败{}", e.getMessage()); } return jsonObject; }