Преглед на файлове

feat: 关注项目关注企业送剑鱼币

zhangxinlei1996 преди 1 година
родител
ревизия
b9527df605
променени са 2 файла, в които са добавени 23 реда и са изтрити 7 реда
  1. 9 0
      entniche_new/src/service/customer/customer.go
  2. 14 7
      entniche_new/src/service/follow/project.go

+ 9 - 0
entniche_new/src/service/customer/customer.go

@@ -1291,6 +1291,7 @@ func (this *CustomerAction) CstAtt() {
 	entUserId := qutil.IntAll(this.GetSession("entUserId"))
 	userId := this.GetSession("userId").(string)
 	userName := qutil.ObjToString(this.GetSession("userName"))
+	mgoUserId := this.GetSession("mgoUserId").(string)
 	curUser := VarCurrentUser.EntInfo(ent_id, entUserId)
 	r := func() Result {
 		if this.Method() != "POST" {
@@ -1321,6 +1322,14 @@ func (this *CustomerAction) CstAtt() {
 				}
 				if !cotion.Followoperation(value, ent_id) {
 					fool = false
+				} else {
+					//首次完成关注企业可获得积分
+					jy.Publish(Mgo_Log, config.Config.Nsq, config.Config.Nsq_topic, "task", mgoUserId, jy.Jyweb_node2, map[string]interface{}{"code": 1012, //关注企业
+						"types":      "followEnt",
+						"num":        50,
+						"baseUserId": this.GetSession("base_user_id"),
+						"positionId": this.GetSession("positionId"),
+					})
 				}
 			} else if cotion.Mold == 1 {
 				if !cotion.D {

+ 14 - 7
entniche_new/src/service/follow/project.go

@@ -2,22 +2,20 @@ package follow
 
 import (
 	"encoding/json"
+	"entniche_new/src/config"
 	"entniche_new/src/entity"
 	"errors"
 	"fmt"
 	"log"
 	"strings"
 
-	db "app.yhyue.com/moapp/jypkg/ent/util"
-
-	"app.yhyue.com/moapp/jybase/redis"
-
-	elastic "app.yhyue.com/moapp/jybase/es"
-
 	. "app.yhyue.com/moapp/jybase/api"
 	qutil "app.yhyue.com/moapp/jybase/common"
-
+	elastic "app.yhyue.com/moapp/jybase/es"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	db "app.yhyue.com/moapp/jypkg/ent/util"
 )
 
 // 关注项目接口
@@ -39,6 +37,7 @@ type FollowProject struct {
 // 项目关注
 func (this *FollowProject) AddProject() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	mgoUserId := qutil.ObjToString(this.GetSession("mgoUserId"))
 	rData, errMsg := func() (interface{}, error) {
 		projectFollow, err := entity.CreateProjectFollowManager(userId, this.Session())
 		if err != nil {
@@ -53,6 +52,14 @@ func (this *FollowProject) AddProject() {
 		if err != nil {
 			return nil, err
 		}
+		//	首次完成项目关注可获得积分
+		jy.Publish(db.Mgo_Log, config.Config.Nsq, config.Config.Nsq_topic, "task", mgoUserId, jy.Jyweb_node2, map[string]interface{}{
+			"code":       1013, //关注项目
+			"types":      "followProject",
+			"num":        50,
+			"baseUserId": this.GetSession("base_user_id"),
+			"positionId": this.GetSession("positionId"),
+		})
 		return db.EncodeId(followId), nil
 	}()
 	if errMsg != nil {