mirror of
https://github.com/dataease/dataease.git
synced 2026-05-22 21:38:32 +08:00
feat: 新增首页导航
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package io.dataease.controller.wizard;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.service.wizard.ReptileService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "首页")
|
||||
@ApiSupport(order = 80)
|
||||
@RestController
|
||||
@RequestMapping("Reptile")
|
||||
public class ReptileController {
|
||||
|
||||
@Resource
|
||||
private ReptileService reptileService;
|
||||
|
||||
@GetMapping("lastActive")
|
||||
@ApiOperation("获取官方Blog最新动态")
|
||||
public Map<String, String> lastActive() {
|
||||
return reptileService.lastActive();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package io.dataease.service.wizard;
|
||||
|
||||
import io.dataease.commons.utils.HttpClientUtil;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Author: wangjiahao
|
||||
* Date: 2022/1/11
|
||||
* Description:
|
||||
*/
|
||||
@Service
|
||||
public class ReptileService {
|
||||
String blogUrl = "https://blog.fit2cloud.com/?cat=321";
|
||||
|
||||
public Map<String, String> lastActive() {
|
||||
Map<String, String> result = new HashMap();
|
||||
try {
|
||||
//爬取最新数据
|
||||
Document doc = Jsoup.parse(HttpClientUtil.get(blogUrl, null));
|
||||
Elements elementsContent = doc.getElementsByAttributeValue("rel", "bookmark");
|
||||
Elements elementsTime = doc.getElementsByTag("time");
|
||||
Element lastInfo = elementsContent.get(0);
|
||||
result.put("title",lastInfo.attr("title"));
|
||||
result.put("href",lastInfo.attr("href"));
|
||||
result.put("time",elementsTime.get(0).childNode(0).outerHtml());
|
||||
} catch (Exception e) {
|
||||
//ignore
|
||||
result.put("title","支持移动端展示,数据源新增对DB2的支持,DataEase开源数据可视化分析平台v1.6.0发布");
|
||||
result.put("href","https://blog.fit2cloud.com/?p=3200");
|
||||
result.put("time","2022年1月10日");
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -223,6 +223,7 @@ authsource_configuration_is_null=Authentication source configuration cannot be e
|
||||
角色表单=Role Form
|
||||
重置密码=Reset Password
|
||||
关于=About Us
|
||||
首页=Home Page
|
||||
i18n_auth_view=View
|
||||
i18n_auth_use=Use
|
||||
i18n_auth_export=Export
|
||||
|
||||
@@ -222,6 +222,7 @@ authsource_configuration_is_null=认证源配置不能为空
|
||||
角色表单=角色表单
|
||||
重置密码=重置密码
|
||||
关于=关于
|
||||
首页=首页
|
||||
i18n_auth_view=查看
|
||||
i18n_auth_use=使用
|
||||
i18n_auth_export=导出
|
||||
|
||||
@@ -225,6 +225,7 @@ authsource_configuration_is_null=認證源配置不能為空
|
||||
角色表单=角色表單
|
||||
重置密码=重置密碼
|
||||
关于=關於
|
||||
首页=首頁
|
||||
i18n_auth_view=查看
|
||||
i18n_auth_use=使用
|
||||
i18n_auth_export=導出
|
||||
|
||||
Reference in New Issue
Block a user