|
@@ -13,6 +13,17 @@ type MediaController struct {
|
|
|
controllers.ListController
|
|
|
}
|
|
|
|
|
|
+func isLogin(listType string) bool {
|
|
|
+ if listType == "logout" {
|
|
|
+ logger.Info("当前用户未登录,展示部分详情")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if listType == "login" {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
// Search 搜索报告列表
|
|
|
// @Description 搜索报告列表
|
|
|
// @Success 200 {object}
|
|
@@ -25,6 +36,7 @@ func (m *MediaController) Search(mediaType string, key string) {
|
|
|
m.FailedResult("分页搜索报告列表失败", result)
|
|
|
return
|
|
|
}
|
|
|
+ detailType := m.Data["detailType"].(string)
|
|
|
//if mediaType == "" || !m.CheckMediaType(mediaType) {
|
|
|
// err = exception.New(exception.MediaTypeError)
|
|
|
// m.FailedResult("分页查询媒体列表失败", result)
|
|
@@ -42,7 +54,7 @@ func (m *MediaController) Search(mediaType string, key string) {
|
|
|
pageRes.Total = m.PageInfo.Total
|
|
|
}
|
|
|
pageRes.TotalPage = page.TotalPages(pageRes.Total, pageRes.PageSize)
|
|
|
- list, err := media.SearchMediaList(mediaType, key, m.PageInfo)
|
|
|
+ list, err := media.SearchMediaList(mediaType, key, m.PageInfo, isLogin(detailType))
|
|
|
if err != nil {
|
|
|
m.FailedResult("分页搜索报告列表失败", result)
|
|
|
return
|
|
@@ -78,6 +90,7 @@ func (m *MediaController) List(mediaType string, permissionIds string) {
|
|
|
Current: m.PageInfo.Current,
|
|
|
PageSize: m.PageInfo.PageSize,
|
|
|
}
|
|
|
+ detailType := m.Data["detailType"].(string)
|
|
|
var mediaIds []int
|
|
|
if m.PageInfo.LatestId == 0 {
|
|
|
pageRes.Total, pageRes.LatestId, mediaIds = media.GetTotalPageCountByPermissionIds(mediaType, permissionIdList)
|
|
@@ -88,7 +101,7 @@ func (m *MediaController) List(mediaType string, permissionIds string) {
|
|
|
pageRes.Total = m.PageInfo.Total
|
|
|
}
|
|
|
pageRes.TotalPage = page.TotalPages(pageRes.Total, pageRes.PageSize)
|
|
|
- list, err := media.GetMediaPageByIds(mediaType, m.PageInfo, mediaIds)
|
|
|
+ list, err := media.GetMediaPageByIds(mediaType, m.PageInfo, mediaIds, isLogin(detailType))
|
|
|
if err != nil {
|
|
|
m.FailedResult("分页查询媒体列表失败", result)
|
|
|
return
|