diff --git a/internal/service/user.go b/internal/service/user.go index f987790..df21df2 100644 --- a/internal/service/user.go +++ b/internal/service/user.go @@ -40,25 +40,14 @@ func (s *Service) SoftDeleteAccount(ctx context.Context, accountID string) error return nil } -func (s *Service) GetCurrentAccount(ctx context.Context, accountID string) (*model.GetCurrentAccountResp, error) { +func (s *Service) GetCurrentAccount(ctx context.Context, accountID string) (*model.User, error) { user, err := s.repository.AmoRepo.GetCurrentAccount(ctx, accountID) if err != nil { s.logger.Error("error getting current account in getCurrentAccount service", zap.Error(err)) return nil, err } - response := model.GetCurrentAccountResp{ - ID: user.ID, - Name: user.Name, - Subdomain: user.Subdomain, - Accountid: user.Accountid, - Amouserid: user.Amouserid, - Amocrmid: user.AmoID, - Country: user.Country, - Createdat: user.Createdat, - } - - return &response, nil + return user, nil } func (s *Service) ConnectAccount(ctx context.Context, accountID string) (*model.ConnectAccountResp, error) { diff --git a/openapi.yaml b/openapi.yaml index f513593..8af8cd4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -49,7 +49,7 @@ paths: content: 'application/json': schema: - $ref: '#/components/schemas/GetCurrentAccountResp' + $ref: '#/components/schemas/User' '401': $ref: '#/components/responses/401' '500': @@ -172,7 +172,7 @@ paths: $ref: '#/components/responses/500' /users: get: - operationId: GettingUserFromCash + operationId: GettingUserWithPagination tags: - main description: получение списка юзеров, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/users-api#users-list @@ -222,7 +222,7 @@ paths: $ref: '#/components/responses/500' /pipelines: get: - operationId: GettingPipelinesFromCash + operationId: GetPipelinesWithPagination tags: - main description: получение списка воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines @@ -272,7 +272,7 @@ paths: $ref: '#/components/responses/500' /steps: get: - operationId: GettingStepsFromCash + operationId: GetStepsWithPagination tags: - main description: получение списка этапов воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines#%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D1%81%D1%82%D0%B0%D1%82%D1%83%D1%81%D0%BE%D0%B2-%D0%B2%D0%BE%D1%80%D0%BE%D0%BD%D0%BA%D0%B8-%D1%81%D0%B4%D0%B5%D0%BB%D0%BE%D0%BA @@ -322,7 +322,7 @@ paths: $ref: '#/components/responses/500' /fields: get: - operationId: GettingFieldsFromCash + operationId: GetFieldsWithPagination tags: - main description: получение списка кастомных полей, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/custom-fields#%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D0%BF%D0%BE%D0%BB%D0%B5%D0%B9-%D1%81%D1%83%D1%89%D0%BD%D0%BE%D1%81%D1%82%D0%B8 @@ -372,7 +372,7 @@ paths: $ref: '#/components/responses/500' /tags: get: - operationId: GettingTagsFromCash + operationId: GetTagsWithPagination tags: - main description: получение списка тегов, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/tags-api#%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D1%82%D0%B5%D0%B3%D0%BE%D0%B2-%D0%B4%D0%BB%D1%8F-%D1%81%D1%83%D1%89%D0%BD%D0%BE%D1%81%D1%82%D0%B8 @@ -722,28 +722,23 @@ components: type: string description: роль пользователя в амо Group: - type: array - description: группы пользователя в амо - items: - $ref: '#/components/schemas/Group' + type: integer + description: группа пользователя в амо Deleted: type: boolean description: флаг мягкого удаления CreatedAt: type: integer description: таймштамп создания тега в нашей системе - Group: - type: object - properties: - ID: + Subdomain: + type: string + description: поддомен организации + Amoiserid: type: integer - description: ID группы пользователей - Name: + description: id в amo пользователя который подключал интеграцию + Country: type: string - description: Название группы пользователей - UUID: - type: string - description: uuid + description: страна указанная в настройках аккаунта амо ConnectAccountResp: type: object properties: @@ -811,7 +806,7 @@ components: type: array description: список айдишников utm которые удалить items: - type: string + type: integer UserListResp: type: object properties: