xingzai 2 rokov pred
rodič
commit
26d1b141e6
2 zmenil súbory, kde vykonal 7 pridanie a 2 odobranie
  1. 1 0
      controllers/article.go
  2. 6 2
      controllers/industry.go

+ 1 - 0
controllers/article.go

@@ -102,6 +102,7 @@ func (this *ArticleController) Detail() {
 				return
 			}
 			for _, v := range industrialList {
+				fmt.Println(v.IndustrialManagementId)
 				if industryUserFollowMap[v.IndustrialManagementId] {
 					detail.IsFollowButton = true
 				}

+ 6 - 2
controllers/industry.go

@@ -32,7 +32,7 @@ func (this *IndustryController) Fllow() {
 	}
 	uid := user.UserId
 	var req models.IndustryFllowArryReq
-
+	resp := new(models.CygxIndustryFllowResp)
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
 	if err != nil {
 		br.Msg = "参数解析异常!"
@@ -42,6 +42,7 @@ func (this *IndustryController) Fllow() {
 	sourceId := req.SourceId
 	source := req.Source
 	doType := req.DoType
+	var status int
 	var condition string
 	var pars []interface{}
 	var industrialIds []int
@@ -86,6 +87,7 @@ func (this *IndustryController) Fllow() {
 	}
 	//批量取关与关注
 	if doType == "add" {
+		status = 1
 		var industryFllowItems []*models.CygxIndustryFllow
 		for _, v := range industrialIds {
 			item := new(models.CygxIndustryFllow)
@@ -103,6 +105,7 @@ func (this *IndustryController) Fllow() {
 		}
 		err = models.AddCygxIndustryFllowMulti(industryFllowItems)
 	} else if doType == "cancel" {
+		status = 2
 		pars = make([]interface{}, 0)
 		condition = ` AND  industrial_management_id IN (` + utils.GetOrmInReplace(lenindustrialIds) + `)`
 		pars = append(pars, industrialIds)
@@ -117,10 +120,11 @@ func (this *IndustryController) Fllow() {
 		br.ErrMsg = "取消关注失败,Err:" + err.Error()
 		return
 	}
+	resp.Status = status
 	//处理是否关注全部赛道字段
 	//go services.IndustryFllowWithTrack(industrialManagementId, count, uid)
 	br.Msg = "操作成功"
 	br.Ret = 200
 	br.Success = true
-	//br.Data = resp
+	br.Data = resp
 }