update
This commit is contained in:
parent
94e901d231
commit
b36a3e67b4
@ -17,7 +17,7 @@ type GetCurrentAccountResp struct {
|
|||||||
/* - айдишник пользвателя, который подключал интеграцию*/
|
/* - айдишник пользвателя, который подключал интеграцию*/
|
||||||
Amouserid int `json:"AmoUserID"`
|
Amouserid int `json:"AmoUserID"`
|
||||||
/* - связь с аккаунтом в амо*/
|
/* - связь с аккаунтом в амо*/
|
||||||
Amocrmid int `json:"AmocrmID"`
|
Amocrmid int64 `json:"AmocrmID"`
|
||||||
/* - страна указанная в настройках амо*/
|
/* - страна указанная в настройках амо*/
|
||||||
Country string `json:"Country"`
|
Country string `json:"Country"`
|
||||||
/* - таймштамп создания аккаунта*/
|
/* - таймштамп создания аккаунта*/
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"amocrm/internal/repository"
|
"amocrm/internal/repository"
|
||||||
"amocrm/pkg/amoClient"
|
"amocrm/pkg/amoClient"
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -74,6 +75,17 @@ func (wc *DataUpdater) processTasks(ctx context.Context) {
|
|||||||
wc.logger.Error("error update pipeline steps in mongo:", zap.Error(err))
|
wc.logger.Error("error update pipeline steps in mongo:", zap.Error(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
user, err := wc.repo.GetCurrentAccount(ctx, token.AccountID)
|
||||||
|
if err != nil {
|
||||||
|
wc.logger.Error("error getting user data from mongo")
|
||||||
|
}
|
||||||
|
userInfo, err := wc.amoClient.GetUserByID(token.AccessToken, user.Amocrmid)
|
||||||
|
for _, tipe := range userInfo.Rights.StatusRights {
|
||||||
|
// todo понимать как когда нужно какой тип
|
||||||
|
fmt.Println(tipe)
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user