[이민권] 계정 정보 받아오는 함수 수정
This commit is contained in:
@ -546,10 +546,10 @@ func (sh *serviceDescription) linkinfo(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
platformName := "platform"
|
platformName := "platform"
|
||||||
links, err := sh.mongoClient.FindAll(CollectionLink, bson.M{
|
accDocs, err := sh.mongoClient.FindAll(CollectionAccount, bson.M{
|
||||||
"accid": authInfo.Accid,
|
"accid": authInfo.Accid,
|
||||||
}, options.Find().SetLimit(sh.MaximumNumLinkAccount).SetProjection(bson.M{
|
}, options.Find().SetLimit(sh.MaximumNumLinkAccount).SetProjection(bson.M{
|
||||||
platformName: 1,
|
"_id": 1,
|
||||||
}))
|
}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("linkinfo failed. CountDocuments err :", err)
|
logger.Error("linkinfo failed. CountDocuments err :", err)
|
||||||
@ -557,6 +557,17 @@ func (sh *serviceDescription) linkinfo(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ids primitive.A
|
||||||
|
for _, accDoc := range accDocs {
|
||||||
|
ids = append(ids, accDoc["_id"].(primitive.ObjectID))
|
||||||
|
}
|
||||||
|
|
||||||
|
links, err := sh.mongoClient.FindAll(CollectionLink, bson.M{
|
||||||
|
"_id": bson.M{"$in": ids},
|
||||||
|
}, options.Find().SetLimit(sh.MaximumNumLinkAccount).SetProjection(bson.M{
|
||||||
|
platformName: 1,
|
||||||
|
}))
|
||||||
|
|
||||||
var linkstrs []string
|
var linkstrs []string
|
||||||
for _, link := range links {
|
for _, link := range links {
|
||||||
linkstrs = append(linkstrs, link[platformName].(string))
|
linkstrs = append(linkstrs, link[platformName].(string))
|
||||||
|
|||||||
Reference in New Issue
Block a user