最近的一些修改 #7
@@ -88,7 +88,6 @@ public class WebUpdateInfoServiceImpl implements WebUpdateInfoService {
|
|||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("lastUpdateTime", DateFormatUtil.get(webUpdateInfoMapper.getLastestOne().getUpdateTime()));
|
jsonObject.put("lastUpdateTime", DateFormatUtil.get(webUpdateInfoMapper.getLastestOne().getUpdateTime()));
|
||||||
jsonObject.put("lastUpdateInfo", webUpdateInfoMapper.getLastestOne().getUpdateInfo());
|
jsonObject.put("lastUpdateInfo", webUpdateInfoMapper.getLastestOne().getUpdateInfo());
|
||||||
try {
|
|
||||||
JSONArray array = JSONArray.fromObject(HttpUtil.get("https://api.github.com/repos/xiaohai2271/blog-frontEnd/commits?page=1&per_page=1"));
|
JSONArray array = JSONArray.fromObject(HttpUtil.get("https://api.github.com/repos/xiaohai2271/blog-frontEnd/commits?page=1&per_page=1"));
|
||||||
JSONObject object = array.getJSONObject(0);
|
JSONObject object = array.getJSONObject(0);
|
||||||
JSONObject commit = object.getJSONObject("commit");
|
JSONObject commit = object.getJSONObject("commit");
|
||||||
@@ -98,9 +97,6 @@ public class WebUpdateInfoServiceImpl implements WebUpdateInfoService {
|
|||||||
Instant parse = Instant.parse(commit.getJSONObject("committer").getString("date"));
|
Instant parse = Instant.parse(commit.getJSONObject("committer").getString("date"));
|
||||||
jsonObject.put("committerDate", DateFormatUtil.get(Date.from(parse)));
|
jsonObject.put("committerDate", DateFormatUtil.get(Date.from(parse)));
|
||||||
jsonObject.put("commitUrl", "https://github.com/xiaohai2271/blog-frontEnd/tree/" + object.getString("sha"));
|
jsonObject.put("commitUrl", "https://github.com/xiaohai2271/blog-frontEnd/tree/" + object.getString("sha"));
|
||||||
} catch (IOException e) {
|
|
||||||
log.info("网络请求失败{}", e.getMessage());
|
|
||||||
}
|
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import org.springframework.web.context.WebApplicationContext;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static cn.celess.blog.enmu.ResponseEnum.SUCCESS;
|
import static cn.celess.blog.enmu.ResponseEnum.SUCCESS;
|
||||||
@@ -64,6 +65,8 @@ public class BaseTest {
|
|||||||
};
|
};
|
||||||
protected static final TypeReference<?> OBJECT_TYPE = new TypeReference<Response<String>>() {
|
protected static final TypeReference<?> OBJECT_TYPE = new TypeReference<Response<String>>() {
|
||||||
};
|
};
|
||||||
|
protected static final TypeReference<?> MAP_OBJECT_TYPE = new TypeReference<Response<Map<String, Object>>>() {
|
||||||
|
};
|
||||||
@Autowired
|
@Autowired
|
||||||
private WebApplicationContext wac;
|
private WebApplicationContext wac;
|
||||||
protected MockHttpSession session;
|
protected MockHttpSession session;
|
||||||
|
|||||||
Reference in New Issue
Block a user