You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
906 B
46 lines
906 B
package dao |
|
|
|
import ( |
|
"context" |
|
"go-common/app/service/bbq/recsys/model" |
|
"go-common/app/service/bbq/user/api" |
|
"go-common/library/log" |
|
) |
|
|
|
//GetUserFollow ... |
|
func (d *Dao) GetUserFollow(c context.Context, mid int64, u *model.UserProfile) (err error) { |
|
|
|
if mid == 0 { |
|
return |
|
} |
|
|
|
relationReq := &api.ListRelationReq{Mid: mid} |
|
listRelationReply, err := d.UserClient.ListFollow(c, relationReq) |
|
if err != nil { |
|
log.Errorv(c) |
|
return |
|
} |
|
for _, MID := range listRelationReply.List { |
|
u.BBQFollow[MID] = 1 |
|
} |
|
return |
|
} |
|
|
|
//GetUserBlack ... |
|
func (d *Dao) GetUserBlack(c context.Context, mid int64, u *model.UserProfile) (err error) { |
|
|
|
if mid == 0 { |
|
return |
|
} |
|
|
|
relationReq := &api.ListRelationReq{Mid: mid} |
|
listRelationReply, err := d.UserClient.ListBlack(c, relationReq) |
|
if err != nil { |
|
log.Errorv(c) |
|
return |
|
} |
|
for _, MID := range listRelationReply.List { |
|
u.BBQBlack[MID] = 1 |
|
} |
|
return |
|
}
|
|
|