|
@@ -9,9 +9,6 @@ import (
|
|
|
knowledgeServ "eta_gn/eta_api/services/knowledge"
|
|
|
"eta_gn/eta_api/utils"
|
|
|
"fmt"
|
|
|
- "github.com/h2non/filetype"
|
|
|
- "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
- "github.com/tealeg/xlsx"
|
|
|
"html"
|
|
|
"io/ioutil"
|
|
|
"os"
|
|
@@ -19,6 +16,10 @@ import (
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/h2non/filetype"
|
|
|
+ "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
+ "github.com/tealeg/xlsx"
|
|
|
)
|
|
|
|
|
|
// 分类
|
|
@@ -42,6 +43,8 @@ type ResourceController struct {
|
|
|
// @Param KeyWord query string true "搜索关键词"
|
|
|
// @Param PublishSort query string true "desc:降序,asc 升序(预留)"
|
|
|
// @Param FilterReportType query string true "筛选事件类型,1:公共研报,2:共享研报,3:我的研报"
|
|
|
+// @Param IncludeFile query string true "是否包含文件, no:不包含"
|
|
|
+// @Param IsShowMe query string true "只看我, false:全部, true:只看我"
|
|
|
// @Success 200 {object} knowledge.KnowledgeResourceListResp
|
|
|
// @router /resource/list [get]
|
|
|
func (this *ResourceController) List() {
|
|
@@ -64,6 +67,10 @@ func (this *ResourceController) List() {
|
|
|
|
|
|
sourceFrom := this.GetString("SourceFrom")
|
|
|
|
|
|
+ includeFile := this.GetString("IncludeFile")
|
|
|
+
|
|
|
+ IsShowMe, _ := this.GetBool("IsShowMe")
|
|
|
+
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
@@ -79,6 +86,15 @@ func (this *ResourceController) List() {
|
|
|
condition += ` AND resource_type = ? `
|
|
|
pars = append(pars, resourceType)
|
|
|
|
|
|
+ if includeFile == "no" {
|
|
|
+ condition += ` AND is_file = ? `
|
|
|
+ pars = append(pars, 0)
|
|
|
+ }
|
|
|
+ if IsShowMe {
|
|
|
+ condition += ` AND admin_id = ? `
|
|
|
+ pars = append(pars, this.SysUser.AdminId)
|
|
|
+ }
|
|
|
+
|
|
|
if keyWord != "" {
|
|
|
//按照空格划分为关键词数组
|
|
|
keyWordArr := strings.Split(keyWord, " ")
|
|
@@ -1185,3 +1201,38 @@ func (this *ResourceController) TemplateDownload() {
|
|
|
br.Success = true
|
|
|
br.Msg = "下载成功"
|
|
|
}
|
|
|
+
|
|
|
+// BiDashboardResourceList
|
|
|
+// @Title 获取bi看报中的知识资源列表
|
|
|
+// @Description 获取bi看报中的知识资源列表
|
|
|
+// @Success 200 {object} models.EdbdataClassifyResp
|
|
|
+// @Param ResourceType query int true "资源库类型:0:事件库 1:政策库 2:观点库;3:知识库"
|
|
|
+// @Param BiDashboardDetailId query int true "bi看板详情ID"
|
|
|
+// @router /resource/bi_dashboard/list [get]
|
|
|
+func (this *ResourceController) BiDashboardResourceList() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+
|
|
|
+ biDashboardDetailId, _ := this.GetInt("BiDashboardDetailId")
|
|
|
+ resourceType, _ := this.GetInt("ResourceType")
|
|
|
+ currentIndex, _ := this.GetInt("currentIndex")
|
|
|
+ pageSize, _ := this.GetInt("PageSize")
|
|
|
+
|
|
|
+ resp, msg, err := knowledgeServ.GetKnowledgeResourceList(biDashboardDetailId, resourceType, currentIndex, pageSize)
|
|
|
+ if err != nil {
|
|
|
+ if msg == "" {
|
|
|
+ msg = "获取数据失败"
|
|
|
+ }
|
|
|
+ br.Msg = msg
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|