update openapi

This commit is contained in:
Pavel 2024-05-03 12:25:43 +03:00
parent cda118155d
commit 712c44458e
2 changed files with 18 additions and 34 deletions

@ -40,25 +40,14 @@ func (s *Service) SoftDeleteAccount(ctx context.Context, accountID string) error
return nil 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) user, err := s.repository.AmoRepo.GetCurrentAccount(ctx, accountID)
if err != nil { if err != nil {
s.logger.Error("error getting current account in getCurrentAccount service", zap.Error(err)) s.logger.Error("error getting current account in getCurrentAccount service", zap.Error(err))
return nil, err return nil, err
} }
response := model.GetCurrentAccountResp{ return user, nil
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
} }
func (s *Service) ConnectAccount(ctx context.Context, accountID string) (*model.ConnectAccountResp, error) { func (s *Service) ConnectAccount(ctx context.Context, accountID string) (*model.ConnectAccountResp, error) {

@ -49,7 +49,7 @@ paths:
content: content:
'application/json': 'application/json':
schema: schema:
$ref: '#/components/schemas/GetCurrentAccountResp' $ref: '#/components/schemas/User'
'401': '401':
$ref: '#/components/responses/401' $ref: '#/components/responses/401'
'500': '500':
@ -172,7 +172,7 @@ paths:
$ref: '#/components/responses/500' $ref: '#/components/responses/500'
/users: /users:
get: get:
operationId: GettingUserFromCash operationId: GettingUserWithPagination
tags: tags:
- main - main
description: получение списка юзеров, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/users-api#users-list description: получение списка юзеров, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/users-api#users-list
@ -222,7 +222,7 @@ paths:
$ref: '#/components/responses/500' $ref: '#/components/responses/500'
/pipelines: /pipelines:
get: get:
operationId: GettingPipelinesFromCash operationId: GetPipelinesWithPagination
tags: tags:
- main - main
description: получение списка воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines description: получение списка воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines
@ -272,7 +272,7 @@ paths:
$ref: '#/components/responses/500' $ref: '#/components/responses/500'
/steps: /steps:
get: get:
operationId: GettingStepsFromCash operationId: GetStepsWithPagination
tags: tags:
- main - 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 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' $ref: '#/components/responses/500'
/fields: /fields:
get: get:
operationId: GettingFieldsFromCash operationId: GetFieldsWithPagination
tags: tags:
- main - 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 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' $ref: '#/components/responses/500'
/tags: /tags:
get: get:
operationId: GettingTagsFromCash operationId: GetTagsWithPagination
tags: tags:
- main - 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 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 type: string
description: роль пользователя в амо description: роль пользователя в амо
Group: Group:
type: array type: integer
description: группы пользователя в амо description: группа пользователя в амо
items:
$ref: '#/components/schemas/Group'
Deleted: Deleted:
type: boolean type: boolean
description: флаг мягкого удаления description: флаг мягкого удаления
CreatedAt: CreatedAt:
type: integer type: integer
description: таймштамп создания тега в нашей системе description: таймштамп создания тега в нашей системе
Group: Subdomain:
type: object type: string
properties: description: поддомен организации
ID: Amoiserid:
type: integer type: integer
description: ID группы пользователей description: id в amo пользователя который подключал интеграцию
Name: Country:
type: string type: string
description: Название группы пользователей description: страна указанная в настройках аккаунта амо
UUID:
type: string
description: uuid
ConnectAccountResp: ConnectAccountResp:
type: object type: object
properties: properties:
@ -811,7 +806,7 @@ components:
type: array type: array
description: список айдишников utm которые удалить description: список айдишников utm которые удалить
items: items:
type: string type: integer
UserListResp: UserListResp:
type: object type: object
properties: properties: