Added filtering by message to push notifications
Change-Id: I785939bd07892ec74dd693f1e0a997f62b39cc65
This commit is contained in:
parent
2b41e04669
commit
28a96f33c1
@ -207,7 +207,7 @@ final class OAuth2SummitEventsApiController extends OAuth2ProtectedController
|
|||||||
$summit = SummitFinderStrategyFactory::build($this->getRepository(), $this->getResourceServerContext())->find($summit_id);
|
$summit = SummitFinderStrategyFactory::build($this->getRepository(), $this->getResourceServerContext())->find($summit_id);
|
||||||
if (is_null($summit)) return $this->error404();
|
if (is_null($summit)) return $this->error404();
|
||||||
|
|
||||||
return $this->getAll(
|
return $this->_getAll(
|
||||||
function(){
|
function(){
|
||||||
return [
|
return [
|
||||||
'tag' => ['=@', '=='],
|
'tag' => ['=@', '=='],
|
||||||
@ -247,7 +247,7 @@ final class OAuth2SummitEventsApiController extends OAuth2ProtectedController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return \Illuminate\Http\JsonResponse|mixed
|
||||||
*/
|
*/
|
||||||
public function getAllEvents()
|
public function getAllEvents()
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
**/
|
**/
|
||||||
use App\Http\Utils\BooleanCellFormatter;
|
use App\Http\Utils\BooleanCellFormatter;
|
||||||
use App\Http\Utils\EpochCellFormatter;
|
use App\Http\Utils\EpochCellFormatter;
|
||||||
use App\Http\Utils\PagingConstants;
|
|
||||||
use App\Services\Model\ISummitPushNotificationService;
|
use App\Services\Model\ISummitPushNotificationService;
|
||||||
use models\exceptions\EntityNotFoundException;
|
use models\exceptions\EntityNotFoundException;
|
||||||
use models\exceptions\ValidationException;
|
use models\exceptions\ValidationException;
|
||||||
@ -23,21 +22,22 @@ use models\summit\ISummitNotificationRepository;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Input;
|
use Illuminate\Support\Facades\Input;
|
||||||
use models\summit\ISummitRepository;
|
use models\summit\ISummitRepository;
|
||||||
use models\summit\SummitPushNotificationChannel;
|
|
||||||
use ModelSerializers\SerializerRegistry;
|
use ModelSerializers\SerializerRegistry;
|
||||||
use utils\Filter;
|
use utils\Filter;
|
||||||
use utils\FilterElement;
|
use utils\FilterElement;
|
||||||
use utils\FilterParser;
|
|
||||||
use utils\OrderParser;
|
|
||||||
use utils\PagingInfo;
|
use utils\PagingInfo;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Support\Facades\Request;
|
use Illuminate\Support\Facades\Request;
|
||||||
|
use Exception;
|
||||||
/**
|
/**
|
||||||
* Class OAuth2SummitNotificationsApiController
|
* Class OAuth2SummitNotificationsApiController
|
||||||
* @package App\Http\Controllers
|
* @package App\Http\Controllers
|
||||||
*/
|
*/
|
||||||
class OAuth2SummitNotificationsApiController extends OAuth2ProtectedController
|
class OAuth2SummitNotificationsApiController extends OAuth2ProtectedController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
use ParametrizedGetAll;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ISummitRepository
|
* @var ISummitRepository
|
||||||
*/
|
*/
|
||||||
@ -84,91 +84,60 @@ class OAuth2SummitNotificationsApiController extends OAuth2ProtectedController
|
|||||||
*/
|
*/
|
||||||
public function getAll($summit_id)
|
public function getAll($summit_id)
|
||||||
{
|
{
|
||||||
try
|
$summit = SummitFinderStrategyFactory::build($this->getRepository(), $this->getResourceServerContext())->find($summit_id);
|
||||||
{
|
if (is_null($summit)) return $this->error404();
|
||||||
$summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id);
|
|
||||||
if (is_null($summit)) return $this->error404();
|
|
||||||
|
|
||||||
$values = Input::all();
|
return $this->_getAll(
|
||||||
|
function(){
|
||||||
$rules = [
|
return [
|
||||||
'page' => 'integer|min:1',
|
'message' => ['=@', '=='],
|
||||||
'per_page' => sprintf('required_with:page|integer|min:%s|max:%s', PagingConstants::MinPageSize, PagingConstants::MaxPageSize),
|
|
||||||
];
|
|
||||||
|
|
||||||
$validation = Validator::make($values, $rules);
|
|
||||||
|
|
||||||
if ($validation->fails()) {
|
|
||||||
$ex = new ValidationException();
|
|
||||||
throw $ex->setMessages($validation->messages()->toArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
// default values
|
|
||||||
$page = 1;
|
|
||||||
$per_page = PagingConstants::DefaultPageSize;
|
|
||||||
|
|
||||||
if (Input::has('page')) {
|
|
||||||
$page = intval(Input::get('page'));
|
|
||||||
$per_page = intval(Input::get('per_page'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$filter = null;
|
|
||||||
if (Input::has('filter')) {
|
|
||||||
$filter = FilterParser::parse(Input::get('filter'), [
|
|
||||||
'channel' => ['=='],
|
'channel' => ['=='],
|
||||||
'sent_date' => ['>', '<', '<=', '>=', '=='],
|
'sent_date' => ['>', '<', '<=', '>=', '=='],
|
||||||
'created' => ['>', '<', '<=', '>=', '=='],
|
'created' => ['>', '<', '<=', '>=', '=='],
|
||||||
'is_sent' => ['=='],
|
'is_sent' => ['=='],
|
||||||
'approved' => ['=='],
|
'approved' => ['=='],
|
||||||
'event_id' => ['=='],
|
'event_id' => ['=='],
|
||||||
]);
|
];
|
||||||
}
|
},
|
||||||
|
function(){
|
||||||
if(is_null($filter)) $filter = new Filter();
|
return [
|
||||||
|
'message' => 'sometimes|string',
|
||||||
$filter->validate([
|
'channel' => 'sometimes|in:EVERYONE,SPEAKERS,ATTENDEES,MEMBERS,SUMMIT,EVENT,GROUP',
|
||||||
'channel' => 'sometimes|in:EVERYONE,SPEAKERS,ATTENDEES,MEMBERS,SUMMIT,EVENT,GROUP',
|
'sent_date' => 'sometimes|date_format:U',
|
||||||
'sent_date' => 'sometimes|date_format:U',
|
'created' => 'sometimes|date_format:U',
|
||||||
'created' => 'sometimes|date_format:U',
|
'is_sent' => 'sometimes|boolean',
|
||||||
'is_sent' => 'sometimes|boolean',
|
'approved' => 'sometimes|boolean',
|
||||||
'approved' => 'sometimes|boolean',
|
'event_id' => 'sometimes|integer',
|
||||||
'event_id' => 'sometimes|integer',
|
];
|
||||||
]);
|
},
|
||||||
|
function()
|
||||||
$order = null;
|
|
||||||
|
|
||||||
if (Input::has('order'))
|
|
||||||
{
|
{
|
||||||
$order = OrderParser::parse(Input::get('order'), [
|
return [
|
||||||
|
|
||||||
'sent_date',
|
'sent_date',
|
||||||
'created',
|
'created',
|
||||||
'id',
|
'id',
|
||||||
]);
|
];
|
||||||
}
|
},
|
||||||
|
function($filter) use($summit){
|
||||||
$result = $this->repository->getAllByPageBySummit($summit, new PagingInfo($page, $per_page), $filter, $order);
|
return $filter;
|
||||||
|
},
|
||||||
return $this->ok
|
function(){
|
||||||
(
|
return SerializerRegistry::SerializerType_Public;
|
||||||
$result->toArray(Request::input('expand', ''),[],[],['summit_id' => $summit_id])
|
},
|
||||||
);
|
null,
|
||||||
}
|
null,
|
||||||
catch (EntityNotFoundException $ex1)
|
function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit){
|
||||||
{
|
return $this->repository->getAllByPageBySummit
|
||||||
Log::warning($ex1);
|
(
|
||||||
return $this->error404();
|
$summit,
|
||||||
}
|
new PagingInfo($page, $per_page),
|
||||||
catch (ValidationException $ex2)
|
call_user_func($applyExtraFilters, $filter),
|
||||||
{
|
$order
|
||||||
Log::warning($ex2);
|
);
|
||||||
return $this->error412($ex2->getMessages());
|
},
|
||||||
}
|
['summit_id' => $summit_id]
|
||||||
catch (\Exception $ex)
|
);
|
||||||
{
|
|
||||||
Log::error($ex);
|
|
||||||
return $this->error500($ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -177,89 +146,59 @@ class OAuth2SummitNotificationsApiController extends OAuth2ProtectedController
|
|||||||
* @return \Illuminate\Http\JsonResponse|mixed
|
* @return \Illuminate\Http\JsonResponse|mixed
|
||||||
*/
|
*/
|
||||||
public function getAllApprovedByUser($summit_id){
|
public function getAllApprovedByUser($summit_id){
|
||||||
try
|
|
||||||
{
|
|
||||||
$summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id);
|
|
||||||
if (is_null($summit)) return $this->error404();
|
|
||||||
|
|
||||||
$current_member = $this->resource_server_context->getCurrentUser();
|
$summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id);
|
||||||
$values = Input::all();
|
if (is_null($summit)) return $this->error404();
|
||||||
|
|
||||||
$rules = [
|
$current_member = $this->resource_server_context->getCurrentUser();
|
||||||
'page' => 'integer|min:1',
|
|
||||||
'per_page' => sprintf('required_with:page|integer|min:%s|max:%s', PagingConstants::MinPageSize, PagingConstants::MaxPageSize),
|
|
||||||
];
|
|
||||||
|
|
||||||
$validation = Validator::make($values, $rules);
|
|
||||||
|
|
||||||
if ($validation->fails()) {
|
return $this->_getAll(
|
||||||
$ex = new ValidationException();
|
function(){
|
||||||
throw $ex->setMessages($validation->messages()->toArray());
|
return [
|
||||||
}
|
'message' => ['=@', '=='],
|
||||||
|
|
||||||
// default values
|
|
||||||
$page = 1;
|
|
||||||
$per_page = PagingConstants::DefaultPageSize;
|
|
||||||
|
|
||||||
if (Input::has('page')) {
|
|
||||||
$page = intval(Input::get('page'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Input::has('per_page')) {
|
|
||||||
$per_page = intval(Input::get('per_page'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$filter = null;
|
|
||||||
if (Input::has('filter')) {
|
|
||||||
$filter = FilterParser::parse(Input::get('filter'), [
|
|
||||||
'sent_date' => ['>', '<', '<=', '>=', '=='],
|
'sent_date' => ['>', '<', '<=', '>=', '=='],
|
||||||
'created' => ['>', '<', '<=', '>=', '=='],
|
'created' => ['>', '<', '<=', '>=', '=='],
|
||||||
]);
|
];
|
||||||
}
|
},
|
||||||
|
function(){
|
||||||
if(is_null($filter)) $filter = new Filter();
|
return [
|
||||||
|
'message' => 'sometimes|string',
|
||||||
$filter->validate([
|
'sent_date' => 'sometimes|date_format:U',
|
||||||
'sent_date' => 'sometimes|date_format:U',
|
'created' => 'sometimes|date_format:U',
|
||||||
'created' => 'sometimes|date_format:U',
|
];
|
||||||
]);
|
},
|
||||||
|
function()
|
||||||
$order = null;
|
|
||||||
|
|
||||||
if (Input::has('order'))
|
|
||||||
{
|
{
|
||||||
$order = OrderParser::parse(Input::get('order'), [
|
return [
|
||||||
|
|
||||||
'sent_date',
|
'sent_date',
|
||||||
'created',
|
'created',
|
||||||
'id',
|
'id',
|
||||||
]);
|
];
|
||||||
}
|
},
|
||||||
|
function($filter) use($summit){
|
||||||
$filter->addFilterCondition(FilterElement::makeEqual("is_sent", true));
|
if($filter instanceof Filter) {
|
||||||
|
$filter->addFilterCondition(FilterElement::makeEqual("is_sent", true));
|
||||||
$result = $this->repository->getAllByPageByUserBySummit($current_member, $summit, new PagingInfo($page, $per_page), $filter, $order);
|
}
|
||||||
|
return $filter;
|
||||||
return $this->ok
|
},
|
||||||
(
|
function(){
|
||||||
$result->toArray(Request::input('expand', ''),[],[],['summit_id' => $summit_id])
|
return SerializerRegistry::SerializerType_Public;
|
||||||
);
|
},
|
||||||
}
|
null,
|
||||||
catch (EntityNotFoundException $ex1)
|
null,
|
||||||
{
|
function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($current_member, $summit){
|
||||||
Log::warning($ex1);
|
return $this->repository->getAllByPageByUserBySummit
|
||||||
return $this->error404();
|
(
|
||||||
}
|
$current_member,
|
||||||
catch (ValidationException $ex2)
|
$summit,
|
||||||
{
|
new PagingInfo($page, $per_page),
|
||||||
Log::warning($ex2);
|
call_user_func($applyExtraFilters, $filter),
|
||||||
return $this->error412($ex2->getMessages());
|
$order
|
||||||
}
|
);
|
||||||
catch (\Exception $ex)
|
},
|
||||||
{
|
['summit_id' => $summit_id]
|
||||||
Log::error($ex);
|
);
|
||||||
return $this->error500($ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -268,83 +207,72 @@ class OAuth2SummitNotificationsApiController extends OAuth2ProtectedController
|
|||||||
*/
|
*/
|
||||||
public function getAllCSV($summit_id)
|
public function getAllCSV($summit_id)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
$summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id);
|
|
||||||
if (is_null($summit)) return $this->error404();
|
|
||||||
|
|
||||||
// default values
|
$summit = SummitFinderStrategyFactory::build($this->summit_repository, $this->resource_server_context)->find($summit_id);
|
||||||
$page = 1;
|
if (is_null($summit)) return $this->error404();
|
||||||
$per_page = PHP_INT_MAX;
|
|
||||||
|
|
||||||
|
return $this->_getAllCSV(
|
||||||
$filter = null;
|
function(){
|
||||||
if (Input::has('filter')) {
|
return [
|
||||||
$filter = FilterParser::parse(Input::get('filter'), [
|
'message' => ['=@', '=='],
|
||||||
'channel' => ['=='],
|
'channel' => ['=='],
|
||||||
'sent_date' => ['>', '<', '<=', '>=', '=='],
|
'sent_date' => ['>', '<', '<=', '>=', '=='],
|
||||||
'created' => ['>', '<', '<=', '>=', '=='],
|
'created' => ['>', '<', '<=', '>=', '=='],
|
||||||
'is_sent' => ['=='],
|
'is_sent' => ['=='],
|
||||||
'approved' => ['=='],
|
'approved' => ['=='],
|
||||||
'event_id' => ['=='],
|
'event_id' => ['=='],
|
||||||
]);
|
];
|
||||||
}
|
},
|
||||||
|
function(){
|
||||||
if(is_null($filter)) $filter = new Filter();
|
return [
|
||||||
|
'message' => 'sometimes|string',
|
||||||
$filter->validate([
|
'channel' => 'sometimes|in:EVERYONE,SPEAKERS,ATTENDEES,MEMBERS,SUMMIT,EVENT,GROUP',
|
||||||
'channel' => 'sometimes|in:EVERYONE,SPEAKERS,ATTENDEES,MEMBERS,SUMMIT,EVENT,GROUP',
|
'sent_date' => 'sometimes|date_format:U',
|
||||||
'sent_date' => 'sometimes|date_format:U',
|
'created' => 'sometimes|date_format:U',
|
||||||
'created' => 'sometimes|date_format:U',
|
'is_sent' => 'sometimes|boolean',
|
||||||
'is_sent' => 'sometimes|boolean',
|
'approved' => 'sometimes|boolean',
|
||||||
'approved' => 'sometimes|boolean',
|
'event_id' => 'sometimes|integer',
|
||||||
'event_id' => 'sometimes|integer',
|
];
|
||||||
]);
|
},
|
||||||
|
function()
|
||||||
$order = null;
|
|
||||||
|
|
||||||
if (Input::has('order'))
|
|
||||||
{
|
{
|
||||||
$order = OrderParser::parse(Input::get('order'), [
|
return [
|
||||||
|
|
||||||
'sent_date',
|
'sent_date',
|
||||||
'created',
|
'created',
|
||||||
'id',
|
'id',
|
||||||
]);
|
];
|
||||||
}
|
},
|
||||||
|
function($filter) use($summit){
|
||||||
$data = $this->repository->getAllByPageBySummit($summit, new PagingInfo($page, $per_page), $filter, $order);
|
return $filter;
|
||||||
$filename = "push-notification-" . date('Ymd');
|
},
|
||||||
$list = $data->toArray();
|
function(){
|
||||||
return $this->export
|
return SerializerRegistry::SerializerType_Public;
|
||||||
(
|
},
|
||||||
'csv',
|
function(){
|
||||||
$filename,
|
return [
|
||||||
$list['data'],
|
|
||||||
[
|
|
||||||
'created' => new EpochCellFormatter,
|
'created' => new EpochCellFormatter,
|
||||||
'last_edited' => new EpochCellFormatter,
|
'last_edited' => new EpochCellFormatter,
|
||||||
'sent_date' => new EpochCellFormatter,
|
'sent_date' => new EpochCellFormatter,
|
||||||
'is_sent' => new BooleanCellFormatter,
|
'is_sent' => new BooleanCellFormatter,
|
||||||
'approved' => new BooleanCellFormatter,
|
'approved' => new BooleanCellFormatter,
|
||||||
]
|
];
|
||||||
);
|
},
|
||||||
}
|
function(){
|
||||||
catch (EntityNotFoundException $ex1)
|
return [];
|
||||||
{
|
},
|
||||||
Log::warning($ex1);
|
"push-notification-" . date('Ymd'),
|
||||||
return $this->error404();
|
['summit_id' => $summit_id],
|
||||||
}
|
function ($page, $per_page, $filter, $order, $applyExtraFilters) use ($summit){
|
||||||
catch (ValidationException $ex2)
|
return $this->repository->getAllByPageBySummit
|
||||||
{
|
(
|
||||||
Log::warning($ex2);
|
$summit,
|
||||||
return $this->error412($ex2->getMessages());
|
new PagingInfo($page, $per_page),
|
||||||
}
|
call_user_func($applyExtraFilters, $filter),
|
||||||
catch (\Exception $ex)
|
$order
|
||||||
{
|
);
|
||||||
Log::error($ex);
|
}
|
||||||
return $this->error500($ex);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -483,7 +411,7 @@ class OAuth2SummitNotificationsApiController extends OAuth2ProtectedController
|
|||||||
Log::warning($ex2);
|
Log::warning($ex2);
|
||||||
return $this->error404(['message'=> $ex2->getMessage()]);
|
return $this->error404(['message'=> $ex2->getMessage()]);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex) {
|
catch (Exception $ex) {
|
||||||
Log::error($ex);
|
Log::error($ex);
|
||||||
return $this->error500($ex);
|
return $this->error500($ex);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Input;
|
use Illuminate\Support\Facades\Input;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Request;
|
use Illuminate\Support\Facades\Request;
|
||||||
@ -24,6 +25,7 @@ use utils\OrderParser;
|
|||||||
use utils\PagingInfo;
|
use utils\PagingInfo;
|
||||||
use App\Http\Utils\PagingConstants;
|
use App\Http\Utils\PagingConstants;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trait ParametrizedGetAll
|
* Trait ParametrizedGetAll
|
||||||
* @package App\Http\Controllers
|
* @package App\Http\Controllers
|
||||||
@ -40,8 +42,9 @@ trait ParametrizedGetAll
|
|||||||
* @param callable $applyExtraFilters
|
* @param callable $applyExtraFilters
|
||||||
* @return \utils\PagingResponse
|
* @return \utils\PagingResponse
|
||||||
*/
|
*/
|
||||||
protected function defaultQuery(int $page, int $per_page, Filter $filter, Order $order, callable $applyExtraFilters){
|
protected function defaultQuery(int $page, int $per_page, Filter $filter, Order $order, callable $applyExtraFilters)
|
||||||
return $this->getRepository()->getAllByPage
|
{
|
||||||
|
return $this->getRepository()->getAllByPage
|
||||||
(
|
(
|
||||||
new PagingInfo($page, $per_page),
|
new PagingInfo($page, $per_page),
|
||||||
call_user_func($applyExtraFilters, $filter),
|
call_user_func($applyExtraFilters, $filter),
|
||||||
@ -57,9 +60,11 @@ trait ParametrizedGetAll
|
|||||||
* @param callable $serializerType
|
* @param callable $serializerType
|
||||||
* @param callable|null $defaultOrderRules
|
* @param callable|null $defaultOrderRules
|
||||||
* @param callable|null $defaultPageSize
|
* @param callable|null $defaultPageSize
|
||||||
|
* @param callable|null $queryCallable
|
||||||
|
* @param array $serializerParams
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getAll
|
public function _getAll
|
||||||
(
|
(
|
||||||
callable $getFilterRules,
|
callable $getFilterRules,
|
||||||
callable $getFilterValidatorRules,
|
callable $getFilterValidatorRules,
|
||||||
@ -67,15 +72,16 @@ trait ParametrizedGetAll
|
|||||||
callable $applyExtraFilters,
|
callable $applyExtraFilters,
|
||||||
callable $serializerType,
|
callable $serializerType,
|
||||||
callable $defaultOrderRules = null,
|
callable $defaultOrderRules = null,
|
||||||
callable $defaultPageSize = null,
|
callable $defaultPageSize = null,
|
||||||
callable $queryCallable = null
|
callable $queryCallable = null,
|
||||||
|
array $serializerParams = []
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$values = Input::all();
|
$values = Input::all();
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
|
|
||||||
'page' => 'integer|min:1',
|
'page' => 'integer|min:1',
|
||||||
'per_page' => sprintf('required_with:page|integer|min:%s|max:%s', PagingConstants::MinPageSize, PagingConstants::MaxPageSize),
|
'per_page' => sprintf('required_with:page|integer|min:%s|max:%s', PagingConstants::MinPageSize, PagingConstants::MaxPageSize),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -89,11 +95,11 @@ trait ParametrizedGetAll
|
|||||||
}
|
}
|
||||||
|
|
||||||
// default values
|
// default values
|
||||||
$page = 1;
|
$page = 1;
|
||||||
$per_page = is_null($defaultPageSize) ? PagingConstants::DefaultPageSize : call_user_func($defaultPageSize);
|
$per_page = is_null($defaultPageSize) ? PagingConstants::DefaultPageSize : call_user_func($defaultPageSize);
|
||||||
|
|
||||||
if (Input::has('page')) {
|
if (Input::has('page')) {
|
||||||
$page = intval(Input::get('page'));
|
$page = intval(Input::get('page'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input::has('per_page')) {
|
if (Input::has('per_page')) {
|
||||||
@ -106,26 +112,24 @@ trait ParametrizedGetAll
|
|||||||
$filter = FilterParser::parse(Input::get('filter'), call_user_func($getFilterRules));
|
$filter = FilterParser::parse(Input::get('filter'), call_user_func($getFilterRules));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($filter)) $filter = new Filter();
|
if (is_null($filter)) $filter = new Filter();
|
||||||
|
|
||||||
$filter_validator_rules = call_user_func($getFilterValidatorRules);
|
$filter_validator_rules = call_user_func($getFilterValidatorRules);
|
||||||
if(count($filter_validator_rules)) {
|
if (count($filter_validator_rules)) {
|
||||||
$filter->validate($filter_validator_rules);
|
$filter->validate($filter_validator_rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = null;
|
$order = null;
|
||||||
|
|
||||||
if (Input::has('order'))
|
if (Input::has('order')) {
|
||||||
{
|
|
||||||
$order = OrderParser::parse(Input::get('order'), call_user_func($getOrderRules));
|
$order = OrderParser::parse(Input::get('order'), call_user_func($getOrderRules));
|
||||||
}
|
} else {
|
||||||
else{
|
if (!is_null($defaultOrderRules)) {
|
||||||
if(!is_null($defaultOrderRules)){
|
|
||||||
$order = call_user_func($defaultOrderRules);
|
$order = call_user_func($defaultOrderRules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_null($queryCallable))
|
if (!is_null($queryCallable))
|
||||||
$data = call_user_func($queryCallable,
|
$data = call_user_func($queryCallable,
|
||||||
$page,
|
$page,
|
||||||
$per_page,
|
$per_page,
|
||||||
@ -133,7 +137,7 @@ trait ParametrizedGetAll
|
|||||||
$order,
|
$order,
|
||||||
$applyExtraFilters);
|
$applyExtraFilters);
|
||||||
else
|
else
|
||||||
$data = $this->defaultQuery
|
$data = $this->defaultQuery
|
||||||
(
|
(
|
||||||
$page,
|
$page,
|
||||||
$per_page,
|
$per_page,
|
||||||
@ -142,11 +146,11 @@ trait ParametrizedGetAll
|
|||||||
$applyExtraFilters
|
$applyExtraFilters
|
||||||
);
|
);
|
||||||
|
|
||||||
$fields = Request::input('fields', '');
|
$fields = Request::input('fields', '');
|
||||||
$relations = Request::input('relations', '');
|
$relations = Request::input('relations', '');
|
||||||
|
|
||||||
$relations = !empty($relations) ? explode(',', $relations) : [];
|
$relations = !empty($relations) ? explode(',', $relations) : [];
|
||||||
$fields = !empty($fields) ? explode(',', $fields) : [];
|
$fields = !empty($fields) ? explode(',', $fields) : [];
|
||||||
|
|
||||||
return $this->ok
|
return $this->ok
|
||||||
(
|
(
|
||||||
@ -155,27 +159,20 @@ trait ParametrizedGetAll
|
|||||||
Request::input('expand', ''),
|
Request::input('expand', ''),
|
||||||
$fields,
|
$fields,
|
||||||
$relations,
|
$relations,
|
||||||
[],
|
$serializerParams,
|
||||||
call_user_func($serializerType)
|
call_user_func($serializerType)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
} catch (ValidationException $ex1) {
|
||||||
catch (ValidationException $ex1)
|
|
||||||
{
|
|
||||||
Log::warning($ex1);
|
Log::warning($ex1);
|
||||||
return $this->error412(array($ex1->getMessage()));
|
return $this->error412(array($ex1->getMessage()));
|
||||||
}
|
} catch (EntityNotFoundException $ex2) {
|
||||||
catch (EntityNotFoundException $ex2)
|
|
||||||
{
|
|
||||||
Log::warning($ex2);
|
Log::warning($ex2);
|
||||||
return $this->error404(array('message' => $ex2->getMessage()));
|
return $this->error404(array('message' => $ex2->getMessage()));
|
||||||
}
|
} catch (\HTTP401UnauthorizedException $ex3) {
|
||||||
catch(\HTTP401UnauthorizedException $ex3)
|
|
||||||
{
|
|
||||||
Log::warning($ex3);
|
Log::warning($ex3);
|
||||||
return $this->error401();
|
return $this->error401();
|
||||||
}
|
} catch (Exception $ex) {
|
||||||
catch (Exception $ex) {
|
|
||||||
Log::error($ex);
|
Log::error($ex);
|
||||||
return $this->error500($ex);
|
return $this->error500($ex);
|
||||||
}
|
}
|
||||||
@ -189,11 +186,12 @@ trait ParametrizedGetAll
|
|||||||
* @param callable $serializerType
|
* @param callable $serializerType
|
||||||
* @param callable $getFormatters
|
* @param callable $getFormatters
|
||||||
* @param callable $getColumns
|
* @param callable $getColumns
|
||||||
* @param $file_prefix
|
* @param string $file_prefix
|
||||||
* @param array $serializer_params
|
* @param array $serializerParams
|
||||||
|
* @param callable|null $queryCallable
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getAllCSV
|
public function _getAllCSV
|
||||||
(
|
(
|
||||||
callable $getFilterRules,
|
callable $getFilterRules,
|
||||||
callable $getFilterValidatorRules,
|
callable $getFilterValidatorRules,
|
||||||
@ -202,13 +200,14 @@ trait ParametrizedGetAll
|
|||||||
callable $serializerType,
|
callable $serializerType,
|
||||||
callable $getFormatters,
|
callable $getFormatters,
|
||||||
callable $getColumns,
|
callable $getColumns,
|
||||||
$file_prefix,
|
string $file_prefix = 'file-',
|
||||||
array $serializer_params = []
|
array $serializerParams = [],
|
||||||
|
callable $queryCallable = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$values = Input::all();
|
$values = Input::all();
|
||||||
$rules = [
|
$rules = [
|
||||||
'page' => 'integer|min:1',
|
'page' => 'integer|min:1',
|
||||||
'per_page' => sprintf('required_with:page|integer|min:%s|max:%s', PagingConstants::MinPageSize, PagingConstants::MaxPageSize),
|
'per_page' => sprintf('required_with:page|integer|min:%s|max:%s', PagingConstants::MinPageSize, PagingConstants::MaxPageSize),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -222,11 +221,11 @@ trait ParametrizedGetAll
|
|||||||
}
|
}
|
||||||
|
|
||||||
// default values
|
// default values
|
||||||
$page = 1;
|
$page = 1;
|
||||||
$per_page = PHP_INT_MAX;
|
$per_page = PHP_INT_MAX;
|
||||||
|
|
||||||
if (Input::has('page')) {
|
if (Input::has('page')) {
|
||||||
$page = intval(Input::get('page'));
|
$page = intval(Input::get('page'));
|
||||||
$per_page = intval(Input::get('per_page'));
|
$per_page = intval(Input::get('per_page'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,36 +239,53 @@ trait ParametrizedGetAll
|
|||||||
$filter = FilterParser::parse(Input::get('filter'), call_user_func($getFilterRules));
|
$filter = FilterParser::parse(Input::get('filter'), call_user_func($getFilterRules));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($filter)) $filter = new Filter();
|
if (is_null($filter)) $filter = new Filter();
|
||||||
|
|
||||||
$filter_validator_rules = call_user_func($getFilterValidatorRules);
|
$filter_validator_rules = call_user_func($getFilterValidatorRules);
|
||||||
if(count($filter_validator_rules)) {
|
if (count($filter_validator_rules)) {
|
||||||
$filter->validate($filter_validator_rules);
|
$filter->validate($filter_validator_rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = null;
|
$order = null;
|
||||||
|
|
||||||
if (Input::has('order'))
|
if (Input::has('order')) {
|
||||||
{
|
|
||||||
$order = OrderParser::parse(Input::get('order'), call_user_func($getOrderRules));
|
$order = OrderParser::parse(Input::get('order'), call_user_func($getOrderRules));
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->getRepository()->getAllByPage
|
if (!is_null($queryCallable))
|
||||||
(
|
$data = call_user_func($queryCallable,
|
||||||
new PagingInfo($page, $per_page),
|
$page,
|
||||||
call_user_func($applyExtraFilters, $filter),
|
$per_page,
|
||||||
$order
|
$filter,
|
||||||
);
|
$order,
|
||||||
|
$applyExtraFilters);
|
||||||
|
else
|
||||||
|
$data = $this->defaultQuery
|
||||||
|
(
|
||||||
|
$page,
|
||||||
|
$per_page,
|
||||||
|
$filter,
|
||||||
|
$order,
|
||||||
|
$applyExtraFilters
|
||||||
|
);
|
||||||
|
|
||||||
$filename = $file_prefix . date('Ymd');
|
$filename = $file_prefix . date('Ymd');
|
||||||
$list = $data->toArray
|
|
||||||
|
$fields = Request::input('fields', '');
|
||||||
|
$relations = Request::input('relations', '');
|
||||||
|
|
||||||
|
$relations = !empty($relations) ? explode(',', $relations) : [];
|
||||||
|
$fields = !empty($fields) ? explode(',', $fields) : [];
|
||||||
|
|
||||||
|
$list = $data->toArray
|
||||||
(
|
(
|
||||||
Request::input('expand', ''),
|
Request::input('expand', ''),
|
||||||
[],
|
$fields,
|
||||||
[],
|
$relations,
|
||||||
$serializer_params,
|
$serializerParams,
|
||||||
call_user_func($serializerType)
|
call_user_func($serializerType)
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->export
|
return $this->export
|
||||||
(
|
(
|
||||||
'csv',
|
'csv',
|
||||||
@ -278,23 +294,16 @@ trait ParametrizedGetAll
|
|||||||
call_user_func($getFormatters),
|
call_user_func($getFormatters),
|
||||||
call_user_func($getColumns)
|
call_user_func($getColumns)
|
||||||
);
|
);
|
||||||
}
|
} catch (ValidationException $ex1) {
|
||||||
catch (ValidationException $ex1)
|
|
||||||
{
|
|
||||||
Log::warning($ex1);
|
Log::warning($ex1);
|
||||||
return $this->error412($ex1->getMessages());
|
return $this->error412($ex1->getMessages());
|
||||||
}
|
} catch (EntityNotFoundException $ex2) {
|
||||||
catch (EntityNotFoundException $ex2)
|
|
||||||
{
|
|
||||||
Log::warning($ex2);
|
Log::warning($ex2);
|
||||||
return $this->error404(array('message' => $ex2->getMessage()));
|
return $this->error404(array('message' => $ex2->getMessage()));
|
||||||
}
|
} catch (\HTTP401UnauthorizedException $ex3) {
|
||||||
catch(\HTTP401UnauthorizedException $ex3)
|
|
||||||
{
|
|
||||||
Log::warning($ex3);
|
Log::warning($ex3);
|
||||||
return $this->error401();
|
return $this->error401();
|
||||||
}
|
} catch (Exception $ex) {
|
||||||
catch (Exception $ex) {
|
|
||||||
Log::error($ex);
|
Log::error($ex);
|
||||||
return $this->error500($ex);
|
return $this->error500($ex);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
use Libs\ModelSerializers\AbstractSerializer;
|
||||||
use models\main\PushNotificationMessage;
|
use models\main\PushNotificationMessage;
|
||||||
use ModelSerializers\SerializerRegistry;
|
use ModelSerializers\SerializerRegistry;
|
||||||
use ModelSerializers\SilverStripeSerializer;
|
use ModelSerializers\SilverStripeSerializer;
|
||||||
@ -46,20 +48,20 @@ class PushNotificationMessageSerializer extends SilverStripeSerializer
|
|||||||
$values = parent::serialize($expand, $fields, $relations, $params);
|
$values = parent::serialize($expand, $fields, $relations, $params);
|
||||||
|
|
||||||
if (!empty($expand)) {
|
if (!empty($expand)) {
|
||||||
$exp_expand = explode(',', $expand);
|
foreach (explode(',', $expand) as $relation) {
|
||||||
foreach ($exp_expand as $relation) {
|
$relation = trim($relation);
|
||||||
switch (trim($relation)) {
|
switch ($relation) {
|
||||||
|
|
||||||
case 'owner': {
|
case 'owner': {
|
||||||
if(!$notification->hasOwner()) continue;
|
if(!$notification->hasOwner()) continue;
|
||||||
unset($values['owner_id']);
|
unset($values['owner_id']);
|
||||||
$values['owner'] = SerializerRegistry::getInstance()->getSerializer($notification->getOwner())->serialize();
|
$values['owner'] = SerializerRegistry::getInstance()->getSerializer($notification->getOwner())->serialize(AbstractSerializer::filterExpandByPrefix($relation, $expand));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'approved_by': {
|
case 'approved_by': {
|
||||||
if(!$notification->hasApprovedBy()) continue;
|
if(!$notification->hasApprovedBy()) continue;
|
||||||
unset($values['approved_by_id']);
|
unset($values['approved_by_id']);
|
||||||
$values['approved_by'] = SerializerRegistry::getInstance()->getSerializer($notification->getApprovedBy())->serialize();
|
$values['approved_by'] = SerializerRegistry::getInstance()->getSerializer($notification->getApprovedBy())->serialize(AbstractSerializer::filterExpandByPrefix($relation, $expand));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
use App\ModelSerializers\PushNotificationMessageSerializer;
|
use App\ModelSerializers\PushNotificationMessageSerializer;
|
||||||
|
use Libs\ModelSerializers\AbstractSerializer;
|
||||||
|
use models\main\Member;
|
||||||
use models\summit\SummitPushNotification;
|
use models\summit\SummitPushNotification;
|
||||||
use models\summit\SummitPushNotificationChannel;
|
use models\summit\SummitPushNotificationChannel;
|
||||||
|
|
||||||
@ -41,17 +43,46 @@ final class SummitPushNotificationSerializer extends PushNotificationMessageSeri
|
|||||||
$values = parent::serialize($expand, $fields, $relations, $params);
|
$values = parent::serialize($expand, $fields, $relations, $params);
|
||||||
|
|
||||||
if($notification->getChannel() == SummitPushNotificationChannel::Event){
|
if($notification->getChannel() == SummitPushNotificationChannel::Event){
|
||||||
$values['event'] = SerializerRegistry::getInstance()->getSerializer($notification->getSummitEvent())->serialize();
|
$values['event_id'] = $notification->getSummitEvent()->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($notification->getChannel() == SummitPushNotificationChannel::Group){
|
if($notification->getChannel() == SummitPushNotificationChannel::Group){
|
||||||
$values['group'] = SerializerRegistry::getInstance()->getSerializer($notification->getGroup())->serialize();
|
$values['group_id'] = $notification->getGroup()->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($notification->getChannel() == SummitPushNotificationChannel::Members){
|
if($notification->getChannel() == SummitPushNotificationChannel::Members){
|
||||||
$values['recipients'] = [];
|
$values['recipients'] = [];
|
||||||
foreach ($notification->getRecipients() as $recipient)
|
foreach ($notification->getRecipients() as $recipient) {
|
||||||
$values['recipients'][] = SerializerRegistry::getInstance()->getSerializer($recipient)->serialize();
|
if (!$recipient instanceof Member) continue;
|
||||||
|
$values['recipients'][] = $recipient->getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($expand)) {
|
||||||
|
foreach (explode(',', $expand) as $relation) {
|
||||||
|
$relation = trim($relation);
|
||||||
|
switch ($relation) {
|
||||||
|
case 'event': {
|
||||||
|
if($notification->getChannel() != SummitPushNotificationChannel::Event) continue;
|
||||||
|
unset($values['event_id']);
|
||||||
|
$values['event'] = SerializerRegistry::getInstance()->getSerializer($notification->getSummitEvent())->serialize(AbstractSerializer::filterExpandByPrefix($relation, $expand));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'group': {
|
||||||
|
if($notification->getChannel() != SummitPushNotificationChannel::Group) continue;
|
||||||
|
unset($values['group_id']);
|
||||||
|
$values['group'] = SerializerRegistry::getInstance()->getSerializer($notification->getGroup())->serialize(AbstractSerializer::filterExpandByPrefix($relation, $expand));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'recipients': {
|
||||||
|
if($notification->getChannel() != SummitPushNotificationChannel::Members) continue;
|
||||||
|
$values['recipients'] = [];
|
||||||
|
foreach ($notification->getRecipients() as $recipient)
|
||||||
|
$values['recipients'][] = SerializerRegistry::getInstance()->getSerializer($recipient)->serialize(AbstractSerializer::filterExpandByPrefix($relation, $expand));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
|
@ -172,8 +172,8 @@ final class DoctrineSummitEventRepository
|
|||||||
protected function getOrderMappings()
|
protected function getOrderMappings()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title' => 'e.title',
|
|
||||||
'id' => 'e.id',
|
'id' => 'e.id',
|
||||||
|
'title' => 'e.title',
|
||||||
'start_date' => 'e.start_date',
|
'start_date' => 'e.start_date',
|
||||||
'end_date' => 'e.end_date',
|
'end_date' => 'e.end_date',
|
||||||
'created' => 'e.created',
|
'created' => 'e.created',
|
||||||
@ -211,10 +211,14 @@ final class DoctrineSummitEventRepository
|
|||||||
|
|
||||||
if (!is_null($order)) {
|
if (!is_null($order)) {
|
||||||
$order->apply2Query($query, $this->getOrderMappings());
|
$order->apply2Query($query, $this->getOrderMappings());
|
||||||
|
if(!$order->hasOrder('id')) {
|
||||||
|
$query = $query->addOrderBy("e.id", 'ASC');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//default order
|
//default order
|
||||||
$query = $query->addOrderBy("e.start_date",'ASC');
|
$query = $query->addOrderBy("e.start_date",'ASC');
|
||||||
$query = $query->addOrderBy("e.end_date", 'ASC');
|
$query = $query->addOrderBy("e.end_date", 'ASC');
|
||||||
|
$query = $query->addOrderBy("e.id", 'ASC');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ final class DoctrineSummitNotificationRepository
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'event_id' => 'e.id:json_int',
|
'event_id' => 'e.id:json_int',
|
||||||
|
'message' => 'n.message:json_string',
|
||||||
'channel' => 'n.channel:json_string',
|
'channel' => 'n.channel:json_string',
|
||||||
'sent_date' => 'n.sent_date:datetime_epoch',
|
'sent_date' => 'n.sent_date:datetime_epoch',
|
||||||
'created' => 'n.created:datetime_epoch',
|
'created' => 'n.created:datetime_epoch',
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
convertNoticesToExceptions="true"
|
convertNoticesToExceptions="true"
|
||||||
convertWarningsToExceptions="true"
|
convertWarningsToExceptions="true"
|
||||||
processIsolation="false"
|
processIsolation="false"
|
||||||
stopOnFailure="false"
|
stopOnFailure="false">
|
||||||
syntaxCheck="false">
|
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Application Test Suite">
|
<testsuite name="Application Test Suite">
|
||||||
<directory>./tests/</directory>
|
<directory>./tests/</directory>
|
||||||
|
@ -612,6 +612,10 @@ final class OAuth2SummitEventsApiTest extends ProtectedApiTest
|
|||||||
$this->assertTrue(!is_null($events));
|
$this->assertTrue(!is_null($events));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $summit_id
|
||||||
|
* @param string $level
|
||||||
|
*/
|
||||||
public function testGetScheduledEventsBySummitAndLevel($summit_id = 27, $level = 'N/A')
|
public function testGetScheduledEventsBySummitAndLevel($summit_id = 27, $level = 'N/A')
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
@ -646,6 +650,43 @@ final class OAuth2SummitEventsApiTest extends ProtectedApiTest
|
|||||||
$this->assertTrue(!is_null($events));
|
$this->assertTrue(!is_null($events));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $summit_id
|
||||||
|
*/
|
||||||
|
public function testGetScheduledEventsBySummit($summit_id = 27)
|
||||||
|
{
|
||||||
|
$params = [
|
||||||
|
|
||||||
|
'id' => $summit_id,
|
||||||
|
'expand' => 'type,track,location,location.venue,location.floor',
|
||||||
|
'page' => 2,
|
||||||
|
'per_page' => 100,
|
||||||
|
'order' => '+start_date'
|
||||||
|
];
|
||||||
|
|
||||||
|
$headers = [
|
||||||
|
"HTTP_Authorization" => " Bearer " . $this->access_token,
|
||||||
|
"CONTENT_TYPE" => "application/json"
|
||||||
|
];
|
||||||
|
|
||||||
|
$response = $this->action
|
||||||
|
(
|
||||||
|
"GET",
|
||||||
|
"OAuth2SummitEventsApiController@getScheduledEvents",
|
||||||
|
$params,
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
$headers
|
||||||
|
);
|
||||||
|
|
||||||
|
$content = $response->getContent();
|
||||||
|
$this->assertResponseStatus(200);
|
||||||
|
|
||||||
|
$events = json_decode($content);
|
||||||
|
$this->assertTrue(!is_null($events));
|
||||||
|
}
|
||||||
|
|
||||||
public function testGetScheduledEventsTags($summit_id = 27)
|
public function testGetScheduledEventsTags($summit_id = 27)
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
|
@ -21,7 +21,7 @@ final class OAuth2SummitNotificationsApiControllerTest extends ProtectedApiTest
|
|||||||
* @param int $summit_id
|
* @param int $summit_id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function testGetApprovedSummitNotifications($summit_id = 24)
|
public function testGetApprovedSummitNotifications($summit_id = 27)
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
'id' => $summit_id,
|
'id' => $summit_id,
|
||||||
@ -67,11 +67,12 @@ final class OAuth2SummitNotificationsApiControllerTest extends ProtectedApiTest
|
|||||||
public function testGetSentSummitNotifications($summit_id = 27)
|
public function testGetSentSummitNotifications($summit_id = 27)
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
'id' => $summit_id,
|
'id' => $summit_id,
|
||||||
'page' => 1,
|
'page' => 1,
|
||||||
'per_page' => 15,
|
'per_page' => 15,
|
||||||
'order' => '+sent_date',
|
'order' => '+sent_date',
|
||||||
'expand' => 'owner,approved_by',
|
// 'filter' => 'message=@Shanghai',
|
||||||
|
//'expand' => 'owner,approved_by',
|
||||||
];
|
];
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user