Browse Source

no message

xingzai 1 year ago
parent
commit
b0535f2836
4 changed files with 64 additions and 3 deletions
  1. 0 1
      controllers/config.go
  2. 1 0
      controllers/report_selection.go
  3. 62 1
      controllers/user.go
  4. 1 1
      models/user.go

+ 0 - 1
controllers/config.go

@@ -76,7 +76,6 @@ func (this *ConfigController) AboutUsAdd() {
 		return
 	}
 	go services.AddCygxAboutUsVideoHistory(user)
-
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "操作成功!"

+ 1 - 0
controllers/report_selection.go

@@ -77,6 +77,7 @@ func (this *ReportSelectionController) Detail() {
 		br.Ret = 200
 		br.Success = true
 		br.Msg = "获取成功"
+		resp.Detail = detail
 		br.Data = resp
 		return
 	}

+ 62 - 1
controllers/user.go

@@ -295,9 +295,70 @@ func (this *UserController) ApplyTryOut() {
 			return
 		}
 		title = detail.Title
+	} else if tryType == "Activity" {
+		detail, err := models.GetAddActivityInfoById(detailId)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "活动ID错误,不存在activityId:" + strconv.Itoa(detailId)
+			return
+		}
+		title = detail.ActivityName
+	} else if tryType == "MicroAudio" {
+		// 微路演音频
+		microAudio, e := models.GetCygxActivityVoiceById(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "微路演音频信息有误, 不存在的VoiceId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = microAudio.VoiceName
+	} else if tryType == "MicroVideo" {
+		// 微路演视频
+		microVideo, e := models.GetMicroRoadshowVideoById(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "微路演视频信息有误, 不存在的VideoId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = microVideo.VideoName
+	} else if tryType == "Researchsummary" {
+		// 本周研究汇总
+		ResearchSummaryInfo, e := models.GetCygxResearchSummaryInfoById(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "本周研究汇总信息有误, 不存在的detailId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = ResearchSummaryInfo.Title
+	} else if tryType == "Minutessummary" {
+		// 上周纪要汇总
+		MinutesSummaryInfo, e := models.GetCygxMinutesSummaryInfoById(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "上周纪要汇总信息有误, 不存在的detailId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = MinutesSummaryInfo.Title
+	} else if tryType == "ReportSelection" {
+		// 报告精选
+		ReportSelectionInfo, e := models.GetCygxReportSelectionInfoById(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "报告精选信息有误, 不存在的detailId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = ReportSelectionInfo.Title
+	} else if tryType == "ProductInterior" {
+		// 产品内测
+		ProductInteriorDetail, e := models.GetCygxProductInteriorDetail(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "产品内测信息有误, 不存在的detailId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = ProductInteriorDetail.Title
 	}
 
-	fmt.Println(title)
 	//缓存校验
 	cacheKey := fmt.Sprint("xygx:apply_record:add:", uid)
 	ttlTime := utils.Rc.GetRedisTTL(cacheKey)

+ 1 - 1
models/user.go

@@ -159,7 +159,7 @@ type ApplyTryReq struct {
 	RealName        string `description:"姓名"`
 	CompanyName     string `description:"公司名称"`
 	ApplyMethod     int    `description:"1:已付费客户申请试用,2:非客户申请试用,3:非客户申请试用(ficc下,不需要进行数据校验)"`
-	TryType         string `description:"提交类型,Article:文章、Activity:活动"`
+	TryType         string `description:"提交类型,Article:文章、Activity:活动、MicroAudio:微路演音频、MicroVideo:微路演视频、Researchsummary:本周研究汇总、Minutessummary:上周纪要汇总、ReportSelection:报告精选、ProductInterior:产品内测"`
 	DetailId        int    `description:"详情ID"`
 }