|
@@ -132,8 +132,8 @@ func (this *MobileReportController) TradeList() {
|
|
|
// @Title 产业报告分类列表接口
|
|
|
// @Description 获取产业报告分类列表接口
|
|
|
// @Param ChartPermissionId query int true "分类ID"
|
|
|
-// @Param DeepCover query string false "是否选择深度覆盖,1是,0否 不填默认为0"
|
|
|
-// @Param RecommendFocus query string false "是否选择推荐关注,1是,0否 不填默认为0"
|
|
|
+// @Param DeepCover query int false "是否选择深度覆盖,1是,0否 不填默认为0"
|
|
|
+// @Param RecommendFocus query int false "是否选择推荐关注,1是,0否 不填默认为0"
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Success 200 {object} models.IndustrialManagementList
|
|
@@ -323,6 +323,80 @@ func (this *MobileReportController) IndustryList() {
|
|
|
br.Data = resp
|
|
|
}
|
|
|
|
|
|
+// @Title 产业下所关联的文章分类列表
|
|
|
+// @Description 产业下所关联的文章分类列表接口
|
|
|
+// @Param IndustrialManagementId query int true "产业ID"
|
|
|
+// @Success 200 {object} models.IndustrialToArticleCategoryListRep
|
|
|
+// @router /toArticleCategoryList [get]
|
|
|
+func (this *MobileReportController) ArticleCategoryList() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请重新登录"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ uid := user.UserId
|
|
|
+ industrialManagementId, _ := this.GetInt("IndustrialManagementId")
|
|
|
+ if industrialManagementId < 1 {
|
|
|
+ br.Msg = "请输入分类ID"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ detail, err := models.GetIndustrialManagementDetail(industrialManagementId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ list, err := models.IndustrialToArticleCategory(industrialManagementId, detail.ChartPermissionId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for k, v := range list {
|
|
|
+ recordCount, err := models.IndustrialUserRecordArticleCount(uid, industrialManagementId, v.CategoryId)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ Newdetail, err := models.GetNewIndustrialUserRecordArticle(industrialManagementId, v.CategoryId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if recordCount == 0 && user.CreatedTime.Before(utils.StrTimeToTime(Newdetail.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(Newdetail.PublishDate)) {
|
|
|
+ list[k].IsRed = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //标的列表
|
|
|
+ industrialSubjectList, err := models.GetIndustrialSubjectAll(industrialManagementId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.IndustrialToArticleCategoryListRep)
|
|
|
+ resp.List = list
|
|
|
+ resp.ListSubject = industrialSubjectList
|
|
|
+ resp.LayoutTime = utils.TimeRemoveHms(detail.LayoutTime)
|
|
|
+ resp.IndustryName = detail.IndustryName
|
|
|
+ resp.IndustrialManagementId = industrialManagementId
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|
|
|
+
|
|
|
// @Title 根据行业分类获取文章列表
|
|
|
// @Description根据行业分类获取文章列表接口
|
|
|
// @Param PageSize query int true "每页数据条数"
|