Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 16d4677a
authored
May 31, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#20207 Доработка изменения РК
1 parent
57beb8cd
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
83 additions
and
69 deletions
app/Console/Commands/AdGroupsLoadUpdated.php
app/Console/Commands/CampaignsAdd.php
app/Console/Commands/CampaignsCheckChange.php
app/Console/Commands/CampaignsFirstLoad.php
app/Console/Commands/CampaignsLoadGroups.php
app/Console/Commands/CampaignsLoadUpdated.php
app/Console/Commands/CampaignsLoadUpdatedChildrenAdGroups.php
app/Console/Commands/CampaignsResume.php
app/Console/Commands/CampaignsSuspend.php
app/Console/Commands/CampaignsUpdate.php
app/Console/Commands/DictionariesLoad.php
app/Jobs/ProcessCallAPI.php
app/Jobs/ProcessCallLimitedAPI.php
app/Models/Tokens.php
app/Service/Contract/APIRequest.php
app/Service/Contract/Limits.php
app/Service/Limits.php
app/Service/Requests/APIRequest.php
app/Service/Requests/Direct/AddCampaigns.php
app/Service/Requests/Direct/CheckCampaignsChange.php
app/Service/Requests/Direct/CheckChanges.php
app/Service/Requests/Direct/CheckDictionariesChange.php
app/Service/Requests/Direct/GetAdGroups.php
app/Service/Requests/Direct/GetCampaigns.php
app/Service/Requests/Direct/GetDictionaries.php
app/Service/Requests/Direct/ResumeCampaigns.php
app/Service/Requests/Direct/SuspendCampaigns.php
app/Service/Requests/Direct/UpdateCampaigns.php
app/Service/Requests/DirectRequest.php
tests/Unit/AddCampaignsTest.php
app/Console/Commands/AdGroupsLoadUpdated.php
View file @
16d4677
...
...
@@ -58,7 +58,7 @@ class AdGroupsLoadUpdated extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
adg
roups'
,
'get'
)
$factory
->
getRequest
(
'
AdG
roups'
,
'get'
)
->
call
([
'CampaignIds'
=>
$token
->
campaignsAdGroupsForUpdatedSelf
->
pluck
(
'campaign_external_id'
)
->
all
(),
]);
...
...
app/Console/Commands/CampaignsAdd.php
View file @
16d4677
...
...
@@ -56,7 +56,7 @@ class CampaignsAdd extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
ampaigns'
,
'add'
)
$factory
->
getRequest
(
'
C
ampaigns'
,
'add'
)
->
call
([
'dictionaryCampaigns'
=>
$token
->
dictionaryCampaignsEnabledForNotExternal
,
'variables'
=>
Variable
::
all
(),
...
...
app/Console/Commands/CampaignsCheckChange.php
View file @
16d4677
...
...
@@ -46,7 +46,7 @@ class CampaignsCheckChange extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token_main
);
$factory
->
getRequest
(
'
change
'
,
'checkCampaigns'
)
$factory
->
getRequest
(
'
Changes
'
,
'checkCampaigns'
)
->
call
();
}
...
...
@@ -57,7 +57,7 @@ class CampaignsCheckChange extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
change
'
,
'checkCampaigns'
)
$factory
->
getRequest
(
'
Changes
'
,
'checkCampaigns'
)
->
call
();
}
...
...
app/Console/Commands/CampaignsFirstLoad.php
View file @
16d4677
...
...
@@ -48,8 +48,8 @@ class CampaignsFirstLoad extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
change
'
,
'CheckDictionaries'
)
->
call
();
$factory
->
getRequest
(
'
c
ampaigns'
,
'get'
)
->
call
();
$factory
->
getRequest
(
'
Changes
'
,
'CheckDictionaries'
)
->
call
();
$factory
->
getRequest
(
'
C
ampaigns'
,
'get'
)
->
call
();
return
0
;
}
...
...
app/Console/Commands/CampaignsLoadGroups.php
View file @
16d4677
...
...
@@ -56,7 +56,7 @@ class CampaignsLoadGroups extends Command
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
adg
roups'
,
'get'
)
$factory
->
getRequest
(
'
AdG
roups'
,
'get'
)
->
call
([
'CampaignIds'
=>
$campaigns
->
pluck
(
'external_id'
)
->
all
(),
]);
...
...
app/Console/Commands/CampaignsLoadUpdated.php
View file @
16d4677
...
...
@@ -60,7 +60,7 @@ class CampaignsLoadUpdated extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
ampaigns'
,
'get'
)
->
call
([
$factory
->
getRequest
(
'
C
ampaigns'
,
'get'
)
->
call
([
'ids'
=>
$campaigns
->
pluck
(
'external_id'
)
->
all
(),
]);
...
...
@@ -77,7 +77,7 @@ class CampaignsLoadUpdated extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
ampaigns'
,
'get'
)
->
call
([
$factory
->
getRequest
(
'
C
ampaigns'
,
'get'
)
->
call
([
'ids'
=>
$token
->
dictionaryCampaignsEnabledForExternalSynchronizedUpdatedSelf
->
pluck
(
'external_id'
)
->
all
(),
]);
...
...
app/Console/Commands/CampaignsLoadUpdatedChildrenAdGroups.php
View file @
16d4677
...
...
@@ -60,7 +60,7 @@ class CampaignsLoadUpdatedChildrenAdGroups extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
hanges'
,
'check'
)
->
call
([
$factory
->
getRequest
(
'
C
hanges'
,
'check'
)
->
call
([
'CampaignIds'
=>
$campaigns
->
pluck
(
'external_id'
)
->
all
(),
'FieldNames'
=>
[
'AdGroupIds'
,
...
...
@@ -81,7 +81,7 @@ class CampaignsLoadUpdatedChildrenAdGroups extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
hanges'
,
'check'
)
->
call
([
$factory
->
getRequest
(
'
C
hanges'
,
'check'
)
->
call
([
'CampaignIds'
=>
$token
->
dictionaryCampaignsEnabledForExternalSynchronizedUpdatedChildren
->
pluck
(
'external_id'
)
->
all
(),
'FieldNames'
=>
[
...
...
app/Console/Commands/CampaignsResume.php
View file @
16d4677
...
...
@@ -74,7 +74,7 @@ class CampaignsResume extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
ampaigns'
,
'resume'
)
$factory
->
getRequest
(
'
C
ampaigns'
,
'resume'
)
->
call
([
'ids'
=>
$token
->
dictionaryCampaignsEnabledForExternalDisabled
->
pluck
(
'external_id'
)
->
all
(),
]);
...
...
app/Console/Commands/CampaignsSuspend.php
View file @
16d4677
...
...
@@ -73,7 +73,7 @@ class CampaignsSuspend extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
c
ampaigns'
,
'suspend'
)
$factory
->
getRequest
(
'
C
ampaigns'
,
'suspend'
)
->
call
([
'ids'
=>
$token
->
dictionaryCampaignsNotEnabledForExternalNotDisabled
->
pluck
(
'external_id'
)
->
all
(),
]);
...
...
app/Console/Commands/CampaignsUpdate.php
View file @
16d4677
...
...
@@ -58,7 +58,6 @@ class CampaignsUpdate extends Command
$factory
->
getRequest
(
'campaigns'
,
'update'
)
->
call
([
'dictionaryCampaigns'
=>
$token
->
dictionaryCampaignsEnabledForExternalNeedUpdated
,
'variables'
=>
Variable
::
all
(),
]);
}
...
...
app/Console/Commands/DictionariesLoad.php
View file @
16d4677
...
...
@@ -51,7 +51,7 @@ class DictionariesLoad extends Command
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'
d
ictionaries'
,
'get'
)
$factory
->
getRequest
(
'
D
ictionaries'
,
'get'
)
->
call
();
return
0
;
...
...
app/Jobs/ProcessCallAPI.php
View file @
16d4677
...
...
@@ -19,6 +19,7 @@ class ProcessCallAPI implements ShouldQueue
private
$api
;
private
$limitId
;
/**
* Create a new job instance.
*
...
...
@@ -39,21 +40,21 @@ class ProcessCallAPI implements ShouldQueue
{
$limits
=
Limits
::
getInstance
(
$this
->
api
->
getToken
());
try
{
try
{
$api
=
API
::
getInstance
(
$this
->
api
);
//считаем на сколько объектов зарезервировано получение данных
//только их и запрашиваем
$limit
=
\App\Models\Limits
::
find
(
$this
->
limitId
);
//те на которые не хватило баллов помещаем в очередь
if
(
$apiR
=
$this
->
api
->
chunk
(
$limit
->
spent
))
{
dispatch
(
new
ProcessCallLimitedAPI
(
$apiR
));
if
(
$apiR
=
$this
->
api
->
slice
(
$limit
->
spent
))
{
dispatch
(
new
ProcessCallLimitedAPI
(
$apiR
));
}
$response
=
$api
->
execute
();
$limits
->
acceptRezerv
(
$this
->
limitId
,
new
HeaderLimits
(
$response
->
headers
())
);
$limits
->
acceptRezerv
(
$this
->
limitId
,
new
HeaderLimits
(
$response
->
headers
()));
//TODO: обработать результат.
// если не хватило баллов на все что хотели запросить, то в очередь отправляем новый запрос на получение новых данных
AdsHandler
::
getInstance
(
$this
->
api
)
->
handle
(
$response
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
//TODO: надо отдельно выделить ошибки вызовов, за которые списываются баллы
//https://yandex.ru/dev/direct/doc/dg/concepts/errors.html
$limits
->
removeRezerv
(
$this
->
limitId
);
...
...
app/Jobs/ProcessCallLimitedAPI.php
View file @
16d4677
...
...
@@ -48,7 +48,7 @@ class ProcessCallLimitedAPI implements ShouldQueue//, ShouldBeUnique
try
{
//резервируем на это количетсво
$limitId
=
$limits
->
doRezerv
(
$this
->
api
,
$
objects
);
$limitId
=
$limits
->
doRezerv
(
$this
->
api
,
$
limits
->
countObjects
(
$this
->
api
)
);
}
catch
(
\Exception
$e
){
//нет свободных баллов, замораживаем до следующего часа
$this
->
reRunHour
();
...
...
app/Models/Tokens.php
View file @
16d4677
...
...
@@ -80,6 +80,7 @@ class Tokens extends Model
];
protected
$casts
=
[
'limit'
=>
'integer'
,
'check_changes'
=>
'datetime'
,
'check_changes_campaign'
=>
'datetime'
,
'check_changes_ad_group'
=>
'datetime'
,
...
...
app/Service/Contract/APIRequest.php
View file @
16d4677
...
...
@@ -14,7 +14,8 @@ interface APIRequest{
function
getToken
()
:
Tokens
;
function
getApi
()
:
string
;
function
chunk
(
$objects
)
:
?
APIRequest
;
function
getCountObjects
()
:
int
;
function
slice
(
$objects
)
:
?
APIRequest
;
function
call
(
$params
=
null
);
function
handle
(
$response
);
...
...
app/Service/Contract/Limits.php
View file @
16d4677
...
...
@@ -5,6 +5,7 @@ interface Limits{
function
current
()
:
int
;
function
DayLimit
()
:
int
;
function
countObjectsLimit
(
APIRequest
$request
)
:
int
;
function
countObjects
(
APIRequest
$request
)
:
int
;
function
doRezerv
(
APIRequest
$request
,
int
$limit
)
:
int
;
function
removeRezerv
(
int
$id
);
function
updateLimits
(
HeaderLimits
$limits
);
...
...
app/Service/Limits.php
View file @
16d4677
...
...
@@ -53,13 +53,21 @@ class Limits implements \App\Service\Contract\Limits {
$this
->
token
->
save
();
}
function
countObjects
(
\App\Service\Contract\APIRequest
$request
)
:
int
{
return
$request
->
getCountObjects
();
}
function
countObjectsLimit
(
\App\Service\Contract\APIRequest
$request
)
:
int
{
$cost
=
$this
->
limitCosts
->
getCostObject
(
$request
);
if
(
$this
->
limitCosts
->
getCostCall
(
$request
)
>
$this
->
current
()){
$costCall
=
$this
->
limitCosts
->
getCostCall
(
$request
);
if
(
$costCall
>
$this
->
current
())
{
return
0
;
}
return
$cost
>
0
?
floor
((
$this
->
current
()
-
$this
->
limitCosts
->
getCostCall
(
$request
))
/
$cost
)
:
-
1
;
return
$cost
>
0
?
floor
(
$this
->
current
()
-
$this
->
getSpent
(
$this
->
countObjects
(
$request
),
$request
))
:
-
1
;
}
/**
...
...
@@ -91,6 +99,7 @@ class Limits implements \App\Service\Contract\Limits {
$rezerv
->
save
();
$this
->
token
->
limit
-=
$limit
;
$this
->
token
->
save
();
DB
::
commit
();
...
...
app/Service/Requests/APIRequest.php
View file @
16d4677
...
...
@@ -73,7 +73,12 @@ class APIRequest implements \App\Service\Contract\APIRequest {
return
$this
->
token
;
}
function
chunk
(
$count
)
:
?
\App\Service\Contract\APIRequest
function
getCountObjects
()
:
int
{
throw
new
Exception
(
'Я не знаю как считать кол-во объектов'
);
}
function
slice
(
$count
)
:
?
\App\Service\Contract\APIRequest
{
throw
new
Exception
(
'Я не знаю формата запрсов, чтобы его разбить'
);
}
...
...
app/Service/Requests/Direct/AddCampaigns.php
View file @
16d4677
...
...
@@ -9,16 +9,11 @@ use App\Models\Variable;
use
App\Service\Requests\DirectRequest
;
use
App\Service\StrReplaceByVariables
;
use
Carbon\Carbon
;
use
Illuminate\Database\Eloquent\Collection
;
use
Illuminate\Support\Facades\Log
;
class
AddCampaigns
extends
DirectRequest
{
protected
$timestamp
;
/* @var Collection|DictionaryCampaign[] $dictionaryCampaigns */
protected
$dictionaryCampaigns
;
/* @var Collection|Variable[] $dictionaryCampaigns */
protected
$variables
;
public
function
call
(
$params
=
null
)
{
...
...
@@ -35,16 +30,16 @@ class AddCampaigns extends DirectRequest
}
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
$id
=
$add_result
[
'Id'
]
??
''
;
$
external_
id
=
$add_result
[
'Id'
]
??
''
;
if
(
!
$id
)
{
Log
::
debug
(
"AddCampaigns, empty Id
, [dictionary_campaigns.id =
{
$this
->
dictionaryCampaigns
->
get
(
$key
)
->
getKey
()
}
]
"
);
if
(
!
$
external_
id
)
{
Log
::
debug
(
"AddCampaigns, empty Id"
);
Log
::
debug
(
$add_result
);
continue
;
}
$this
->
dictionaryCampaigns
->
get
(
$key
)
->
update
([
'external_id'
=>
$id
,
DictionaryCampaign
::
where
(
'external_id'
,
$external_id
)
->
update
([
'external_id'
=>
$
external_
id
,
'external_upload_at'
=>
Carbon
::
now
(),
]);
}
...
...
@@ -53,22 +48,13 @@ class AddCampaigns extends DirectRequest
}
}
public
function
putParams
(
$params
)
{
$this
->
dictionaryCampaigns
=
$params
[
'dictionaryCampaigns'
];
$this
->
variables
=
$params
[
'variables'
];
}
private
function
requestPrepare
(
$params
)
{
$this
->
setService
(
'
c
ampaigns'
);
$this
->
setService
(
'
C
ampaigns'
);
$this
->
setMethod
(
'add'
);
$this
->
putParams
(
$params
);
$this
->
setParams
([
'Campaigns'
=>
$this
->
dictionaryCampaigns
->
map
(
function
(
$dictionaryCampaign
)
{
/* @var DictionaryCampaign $dictionaryCampaign */
'Campaigns'
=>
$this
[
'dictionaryCampaigns'
]
->
map
(
function
(
DictionaryCampaign
$dictionaryCampaign
)
{
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$dictionaryCampaign
);
...
...
app/Service/Requests/Direct/CheckCampaignsChange.php
View file @
16d4677
...
...
@@ -68,7 +68,7 @@ class CheckCampaignsChange extends DirectRequest
private
function
requestPrepare
(
$params
)
{
$this
->
setService
(
'
c
hanges'
);
$this
->
setService
(
'
C
hanges'
);
$this
->
setMethod
(
'checkCampaigns'
);
$this
->
setParams
([
'Timestamp'
=>
$this
->
getToken
()
->
check_changes_campaign_at
->
toIso8601ZuluString
(),
...
...
app/Service/Requests/Direct/CheckChanges.php
View file @
16d4677
...
...
@@ -78,7 +78,7 @@ class CheckChanges extends DirectRequest
private
function
requestPrepare
(
$params
)
{
$this
->
setService
(
'
c
hanges'
);
$this
->
setService
(
'
C
hanges'
);
$this
->
setMethod
(
'check'
);
$this
->
setParams
(
$params
);
...
...
app/Service/Requests/Direct/CheckDictionariesChange.php
View file @
16d4677
...
...
@@ -15,7 +15,7 @@ class CheckDictionariesChange extends DirectRequest {
}
private
function
requestPrepare
(
$params
){
$this
->
setService
(
'
c
hanges'
);
$this
->
setService
(
'
C
hanges'
);
$this
->
setMethod
(
'checkDictionaries'
);
}
}
app/Service/Requests/Direct/GetAdGroups.php
View file @
16d4677
...
...
@@ -98,7 +98,7 @@ class GetAdGroups extends DirectRequest
private
function
requestPrepare
(
$filter
)
{
$this
->
setService
(
'
adg
roups'
);
$this
->
setService
(
'
AdG
roups'
);
$this
->
setMethod
(
'get'
);
$params
=
[
'SelectionCriteria'
=>
[
...
...
app/Service/Requests/Direct/GetCampaigns.php
View file @
16d4677
...
...
@@ -68,7 +68,7 @@ class GetCampaigns extends DirectRequest
private
function
requestPrepare
(
$filter
)
{
$this
->
setService
(
'
c
ampaigns'
);
$this
->
setService
(
'
C
ampaigns'
);
$this
->
setMethod
(
'get'
);
$params
=
[
'SelectionCriteria'
=>
[
...
...
app/Service/Requests/Direct/GetDictionaries.php
View file @
16d4677
...
...
@@ -46,7 +46,7 @@ class GetDictionaries extends DirectRequest
private
function
requestPrepare
(
$params
)
{
$this
->
setService
(
'
d
ictionaries'
);
$this
->
setService
(
'
D
ictionaries'
);
$this
->
setMethod
(
'get'
);
$params
=
[
'DictionaryNames'
=>
[
...
...
app/Service/Requests/Direct/ResumeCampaigns.php
View file @
16d4677
...
...
@@ -48,7 +48,7 @@ class ResumeCampaigns extends DirectRequest
private
function
requestPrepare
(
$filter
)
{
$this
->
setService
(
'
c
ampaigns'
);
$this
->
setService
(
'
C
ampaigns'
);
$this
->
setMethod
(
'resume'
);
$params
=
[
'SelectionCriteria'
=>
[
...
...
app/Service/Requests/Direct/SuspendCampaigns.php
View file @
16d4677
...
...
@@ -49,7 +49,7 @@ class SuspendCampaigns extends DirectRequest
private
function
requestPrepare
(
$filter
)
{
$this
->
setService
(
'
c
ampaigns'
);
$this
->
setService
(
'
C
ampaigns'
);
$this
->
setMethod
(
'suspend'
);
$params
=
[
'SelectionCriteria'
=>
[
...
...
app/Service/Requests/Direct/UpdateCampaigns.php
View file @
16d4677
...
...
@@ -27,6 +27,23 @@ class UpdateCampaigns extends DirectRequest
dispatch
(
$process
)
->
onQueue
(
'limits'
);
}
function
slice
(
$count
)
:
?
\App\Service\Contract\APIRequest
{
if
(
$count
<
0
)
return
null
;
//для запросов get ничего не разбиваем, т.к. заранее не знаем сколько чего будет
//для них только после выполнения запроса будет известно есть ли кроме $count еще данные
//а текущий запрос просто устанавливается в $count
//а вот для запросов мутаторов будем разбивать. Но тут уже будет зависеть от запроса
//будем под каждый реализовывать делитель
if
(
!
isset
(
$this
->
params
[
'Page'
])){
$this
->
params
[
'Page'
]
=
[];
}
$this
->
params
[
'Page'
][
'Limit'
]
=
$count
;
return
null
;
}
public
function
handle
(
$response
)
{
try
{
...
...
@@ -34,7 +51,7 @@ class UpdateCampaigns extends DirectRequest
$external_id
=
$add_result
[
'Id'
]
??
''
;
if
(
!
$external_id
)
{
Log
::
debug
(
"AddCampaigns, empty Id
, [dictionary_campaigns.id =
{
$this
->
dictionaryCampaigns
->
get
(
$key
)
->
getKey
()
}
]
"
);
Log
::
debug
(
"AddCampaigns, empty Id"
);
Log
::
debug
(
$add_result
);
continue
;
}
...
...
@@ -50,22 +67,13 @@ class UpdateCampaigns extends DirectRequest
}
}
public
function
putParams
(
$params
)
{
$this
->
dictionaryCampaigns
=
$params
[
'dictionaryCampaigns'
];
$this
->
variables
=
$params
[
'variables'
];
}
private
function
requestPrepare
(
$params
)
{
$this
->
setService
(
'
c
ampaigns'
);
$this
->
setService
(
'
C
ampaigns'
);
$this
->
setMethod
(
'update'
);
$this
->
putParams
(
$params
);
$this
->
setParams
([
'Campaigns'
=>
$this
->
dictionaryCampaigns
->
map
(
function
(
$dictionaryCampaign
)
{
/* @var DictionaryCampaign $dictionaryCampaign */
'Campaigns'
=>
$params
[
'dictionaryCampaigns'
]
->
map
(
function
(
DictionaryCampaign
$dictionaryCampaign
)
{
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$dictionaryCampaign
);
...
...
app/Service/Requests/DirectRequest.php
View file @
16d4677
...
...
@@ -20,7 +20,12 @@ class DirectRequest extends APIRequest {
$this
->
url
=
config
(
'api.yandex.url'
);
}
function
chunk
(
$count
)
:
?
\App\Service\Contract\APIRequest
function
getCountObjects
()
:
int
{
return
1
;
}
function
slice
(
$count
)
:
?
\App\Service\Contract\APIRequest
{
return
null
;
if
(
$count
<
0
)
...
...
tests/Unit/AddCampaignsTest.php
View file @
16d4677
...
...
@@ -107,8 +107,6 @@ class AddCampaignsTest extends TestCase
]
];
$this
->
request
->
putParams
(
$this
->
params
);
$this
->
request
->
handle
(
$data
);
$this
->
dictionary
->
campaigns
->
first
()
->
pivot
->
refresh
();
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment