|
@@ -13,6 +13,7 @@ import (
|
|
|
type FollowEnt struct {
|
|
|
*xweb.Action
|
|
|
association xweb.Mapper `xweb:"/follow/ent/association"` //搜索企业联想
|
|
|
+ followCheck xweb.Mapper `xweb:"/follow/ent/followCheck"` //企业是否关注
|
|
|
list xweb.Mapper `xweb:"/follow/ent/list"` //关注企业列表
|
|
|
addFollow xweb.Mapper `xweb:"/follow/ent/addFollow"` //添加关注标企业
|
|
|
delFollow xweb.Mapper `xweb:"/follow/ent/delFollow"` //取消关注标企业
|
|
@@ -43,6 +44,29 @@ func (this *FollowEnt) Association() {
|
|
|
this.ServeJson(NewResult(rData, errMsg))
|
|
|
}
|
|
|
|
|
|
+//企业是否关注
|
|
|
+func (this *FollowEnt) FollowCheck() {
|
|
|
+ userId := qutil.ObjToString(this.GetSession("userId"))
|
|
|
+ rData, errMsg := func() (interface{}, error) {
|
|
|
+ followEntManager, err := entity.CreateEntFollowManager(userId)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ entName := this.GetString("entName")
|
|
|
+ followed, err := followEntManager.CheckEntFollowed(entName)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return map[string]interface{}{
|
|
|
+ "followed": followed,
|
|
|
+ }, nil
|
|
|
+ }()
|
|
|
+ if errMsg != nil {
|
|
|
+ log.Printf("%s 企业关注联想出错查询是否关注出错:%s\n", userId, errMsg.Error())
|
|
|
+ }
|
|
|
+ this.ServeJson(NewResult(rData, errMsg))
|
|
|
+}
|
|
|
+
|
|
|
//关注中标企业列表
|
|
|
func (this *FollowEnt) List() {
|
|
|
userId := qutil.ObjToString(this.GetSession("userId"))
|