模块化拆分
This commit is contained in:
@@ -18,6 +18,12 @@
|
||||
<version>${blog-common.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.celess</groupId>
|
||||
<artifactId>blog-user</artifactId>
|
||||
<version>${blog-user.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package cn.celess.siteinfo;
|
||||
|
||||
import cn.celess.common.CommonApplication;
|
||||
import cn.celess.user.UserApplication;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(scanBasePackageClasses = {SiteInfoApplication.class, CommonApplication.class, UserApplication.class})
|
||||
public class SiteInfoApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SiteInfoApplication.class, args);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class WebUpdateInfoServiceImpl implements WebUpdateInfoService {
|
||||
map.put("lastUpdateInfo", webUpdateInfoMapper.getLastestOne().getUpdateInfo());
|
||||
try {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String respStr = HttpUtil.get("https://api.github.com/repos/xiaohai2271/blog-frontEnd/commits?page=1&per_page=1");
|
||||
String respStr = HttpUtil.getHttpResponse("https://api.github.com/repos/xiaohai2271/blog-frontEnd/commits?page=1&per_page=1");
|
||||
if (!StringUtils.isEmpty(respStr)) {
|
||||
JsonNode root = mapper.readTree(respStr);
|
||||
Iterator<JsonNode> elements = root.elements();
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package cn.celess.siteinfo;
|
||||
|
||||
import cn.celess.common.test.BaseTest;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@SpringBootTest(classes = SiteInfoApplication.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
public abstract class SiteInfoBaseTest extends BaseTest {
|
||||
}
|
||||
@@ -5,10 +5,9 @@ import cn.celess.common.entity.WebUpdate;
|
||||
import cn.celess.common.entity.vo.PageData;
|
||||
import cn.celess.common.entity.vo.WebUpdateModel;
|
||||
import cn.celess.common.mapper.WebUpdateInfoMapper;
|
||||
import cn.celess.common.test.BaseTest;
|
||||
import cn.celess.siteinfo.SiteInfoBaseTest;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -21,7 +20,7 @@ import static org.junit.Assert.*;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
|
||||
|
||||
@Slf4j
|
||||
public class WebUpdateInfoControllerTest extends BaseTest {
|
||||
public class WebUpdateInfoControllerTest extends SiteInfoBaseTest {
|
||||
private final TypeReference<?> MODAL_TYPE = new TypeReference<Response<WebUpdateModel>>() {
|
||||
};
|
||||
private final TypeReference<?> MODAL_LIST_TYPE = new TypeReference<Response<List<WebUpdateModel>>>() {
|
||||
@@ -126,7 +125,6 @@ public class WebUpdateInfoControllerTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void lastestUpdateTime() throws Exception {
|
||||
getMockData(get("/lastestUpdate")).andDo(result -> assertEquals(SUCCESS.getCode(), getResponse(result).getCode()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user