Added missing validation rules for presentation
added validation rule for attending_media field Change-Id: I20338e065b45aebcb9b7b0827f2e0ddb6b3867ee
This commit is contained in:
parent
d85afd761a
commit
d316fceb92
@ -331,30 +331,30 @@ final class OAuth2SummitEventsApiController extends OAuth2ProtectedController
|
|||||||
$data = Input::json();
|
$data = Input::json();
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
'title' => 'required|string|max:100',
|
'title' => 'required|string|max:100',
|
||||||
'description' => 'required|string',
|
'description' => 'required|string',
|
||||||
'type_id' => 'required|integer',
|
'type_id' => 'required|integer',
|
||||||
'location_id' => 'sometimes|integer',
|
'location_id' => 'sometimes|integer',
|
||||||
'start_date' => 'sometimes|required|date_format:U',
|
'start_date' => 'sometimes|required|date_format:U',
|
||||||
'end_date' => 'sometimes|required_with:start_date|date_format:U|after:start_date',
|
'end_date' => 'sometimes|required_with:start_date|date_format:U|after:start_date',
|
||||||
'track_id' => 'required|integer',
|
'track_id' => 'required|integer',
|
||||||
'rsvp_link' => 'sometimes|url',
|
'rsvp_link' => 'sometimes|url',
|
||||||
'rsvp_template_id' => 'sometimes|integer',
|
'rsvp_template_id' => 'sometimes|integer',
|
||||||
'rsvp_max_user_number' => 'required_with:rsvp_template_id|integer|min:0',
|
'rsvp_max_user_number' => 'required_with:rsvp_template_id|integer|min:0',
|
||||||
'rsvp_max_user_wait_list_number' => 'required_with:rsvp_template_id|integer|min:0',
|
'rsvp_max_user_wait_list_number' => 'required_with:rsvp_template_id|integer|min:0',
|
||||||
'head_count' => 'sometimes|integer',
|
'head_count' => 'sometimes|integer',
|
||||||
'social_description' => 'sometimes|string|max:100',
|
'social_description' => 'sometimes|string|max:100',
|
||||||
'allow_feedback' => 'sometimes|boolean',
|
'allow_feedback' => 'sometimes|boolean',
|
||||||
'tags' => 'sometimes|string_array',
|
'tags' => 'sometimes|string_array',
|
||||||
'sponsors' => 'sometimes|int_array',
|
'sponsors' => 'sometimes|int_array',
|
||||||
// presentation rules
|
// presentation rules
|
||||||
'attendees_expected_learnt' => 'sometimes|string|max:1000',
|
'attendees_expected_learnt' => 'sometimes|string|max:1000',
|
||||||
'feature_cloud' => 'sometimes|boolean',
|
'attending_media' => 'sometimes|boolean',
|
||||||
'to_record' => 'sometimes|boolean',
|
'to_record' => 'sometimes|boolean',
|
||||||
'speakers' => 'sometimes|int_array',
|
'speakers' => 'sometimes|int_array',
|
||||||
'moderator_speaker_id' => 'sometimes|integer',
|
'moderator_speaker_id' => 'sometimes|integer',
|
||||||
// group event
|
// group event
|
||||||
'groups' => 'sometimes|int_array',
|
'groups' => 'sometimes|int_array',
|
||||||
];
|
];
|
||||||
|
|
||||||
// Creates a Validator instance and validates the data.
|
// Creates a Validator instance and validates the data.
|
||||||
@ -370,7 +370,6 @@ final class OAuth2SummitEventsApiController extends OAuth2ProtectedController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
|
|
||||||
'title',
|
'title',
|
||||||
'description',
|
'description',
|
||||||
'social_summary',
|
'social_summary',
|
||||||
@ -411,30 +410,30 @@ final class OAuth2SummitEventsApiController extends OAuth2ProtectedController
|
|||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
// summit event rules
|
// summit event rules
|
||||||
'title' => 'sometimes|string|max:100',
|
'title' => 'sometimes|string|max:100',
|
||||||
'description' => 'sometimes|string',
|
'description' => 'sometimes|string',
|
||||||
'rsvp_link' => 'sometimes|url',
|
'rsvp_link' => 'sometimes|url',
|
||||||
'rsvp_template_id' => 'sometimes|integer',
|
'rsvp_template_id' => 'sometimes|integer',
|
||||||
'rsvp_max_user_number' => 'required_with:rsvp_template_id|integer|min:0',
|
'rsvp_max_user_number' => 'required_with:rsvp_template_id|integer|min:0',
|
||||||
'rsvp_max_user_wait_list_number' => 'required_with:rsvp_template_id|integer|min:0',
|
'rsvp_max_user_wait_list_number' => 'required_with:rsvp_template_id|integer|min:0',
|
||||||
'head_count' => 'sometimes|integer',
|
'head_count' => 'sometimes|integer',
|
||||||
'social_description' => 'sometimes|string|max:100',
|
'social_description' => 'sometimes|string|max:100',
|
||||||
'location_id' => 'sometimes|integer',
|
'location_id' => 'sometimes|integer',
|
||||||
'start_date' => 'sometimes|date_format:U',
|
'start_date' => 'sometimes|date_format:U',
|
||||||
'end_date' => 'sometimes|required_with:start_date|date_format:U|after:start_date',
|
'end_date' => 'sometimes|required_with:start_date|date_format:U|after:start_date',
|
||||||
'allow_feedback' => 'sometimes|boolean',
|
'allow_feedback' => 'sometimes|boolean',
|
||||||
'type_id' => 'sometimes|required|integer',
|
'type_id' => 'sometimes|required|integer',
|
||||||
'track_id' => 'sometimes|required|integer',
|
'track_id' => 'sometimes|required|integer',
|
||||||
'tags' => 'sometimes|string_array',
|
'tags' => 'sometimes|string_array',
|
||||||
'sponsors' => 'sometimes|int_array',
|
'sponsors' => 'sometimes|int_array',
|
||||||
// presentation rules
|
// presentation rules
|
||||||
'attendees_expected_learnt' => 'sometimes|string|max:1000',
|
'attendees_expected_learnt' => 'sometimes|string|max:1000',
|
||||||
'feature_cloud' => 'sometimes|boolean',
|
'attending_media' => 'sometimes|boolean',
|
||||||
'to_record' => 'sometimes|boolean',
|
'to_record' => 'sometimes|boolean',
|
||||||
'speakers' => 'sometimes|int_array',
|
'speakers' => 'sometimes|int_array',
|
||||||
'moderator_speaker_id' => 'sometimes|integer',
|
'moderator_speaker_id' => 'sometimes|integer',
|
||||||
// group event
|
// group event
|
||||||
'groups' => 'sometimes|int_array',
|
'groups' => 'sometimes|int_array',
|
||||||
];
|
];
|
||||||
|
|
||||||
// Creates a Validator instance and validates the data.
|
// Creates a Validator instance and validates the data.
|
||||||
|
79
app/Http/Routes/public.php
Normal file
79
app/Http/Routes/public.php
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright 2018 OpenStack Foundation
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
**/
|
||||||
|
use Illuminate\Support\Facades\Config;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
// public api ( without AUTHZ [OAUTH2.0])
|
||||||
|
|
||||||
|
Route::group([
|
||||||
|
'namespace' => 'App\Http\Controllers',
|
||||||
|
'prefix' => 'api/public/v1',
|
||||||
|
'before' => [],
|
||||||
|
'after' => [],
|
||||||
|
'middleware' => [
|
||||||
|
'ssl',
|
||||||
|
'rate.limit:1000,1', // 1000 request per minute
|
||||||
|
'etags'
|
||||||
|
]
|
||||||
|
], function(){
|
||||||
|
// members
|
||||||
|
Route::group(['prefix'=>'members'], function() {
|
||||||
|
Route::get('', 'OAuth2MembersApiController@getAll');
|
||||||
|
});
|
||||||
|
|
||||||
|
// summits
|
||||||
|
Route::group(['prefix'=>'summits'], function() {
|
||||||
|
Route::get('', [ 'middleware' => 'cache:'.Config::get('cache_api_response.get_summit_response_lifetime', 600), 'uses' => 'OAuth2SummitApiController@getSummits']);
|
||||||
|
Route::group(['prefix' => '{id}'], function () {
|
||||||
|
// locations
|
||||||
|
Route::group(['prefix' => 'locations'], function () {
|
||||||
|
Route::group(['prefix' => '{location_id}'], function () {
|
||||||
|
Route::get('', 'OAuth2SummitLocationsApiController@getLocation');
|
||||||
|
Route::get('/events/published','OAuth2SummitLocationsApiController@getLocationPublishedEvents');
|
||||||
|
Route::group(['prefix' => 'banners'], function () {
|
||||||
|
Route::get('', 'OAuth2SummitLocationsApiController@getLocationBanners');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// marketplace
|
||||||
|
Route::group(array('prefix' => 'marketplace'), function () {
|
||||||
|
|
||||||
|
Route::group(array('prefix' => 'appliances'), function () {
|
||||||
|
Route::get('', 'AppliancesApiController@getAll');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::group(array('prefix' => 'distros'), function () {
|
||||||
|
Route::get('', 'DistributionsApiController@getAll');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::group(array('prefix' => 'consultants'), function () {
|
||||||
|
Route::get('', 'ConsultantsApiController@getAll');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::group(array('prefix' => 'hosted-private-clouds'), function () {
|
||||||
|
Route::get('', 'PrivateCloudsApiController@getAll');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::group(array('prefix' => 'remotely-managed-private-clouds'), function () {
|
||||||
|
Route::get('', 'RemoteCloudsApiController@getAll');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::group(array('prefix' => 'public-clouds'), function () {
|
||||||
|
Route::get('', 'PublicCloudsApiController@getAll');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -10,70 +10,9 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
use Illuminate\Support\Facades\Config;
|
use Illuminate\Support\Facades\Config;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
// public api ( without AUTHZ [OAUTH2.0])
|
require app_path('Http/Routes/public.php');
|
||||||
|
|
||||||
Route::group([
|
|
||||||
'namespace' => 'App\Http\Controllers',
|
|
||||||
'prefix' => 'api/public/v1',
|
|
||||||
'before' => [],
|
|
||||||
'after' => [],
|
|
||||||
'middleware' => [
|
|
||||||
'ssl',
|
|
||||||
'rate.limit:1000,1', // 1000 request per minute
|
|
||||||
'etags'
|
|
||||||
]
|
|
||||||
], function(){
|
|
||||||
// members
|
|
||||||
Route::group(['prefix'=>'members'], function() {
|
|
||||||
Route::get('', 'OAuth2MembersApiController@getAll');
|
|
||||||
});
|
|
||||||
|
|
||||||
// summits
|
|
||||||
Route::group(['prefix'=>'summits'], function() {
|
|
||||||
Route::get('', [ 'middleware' => 'cache:'.Config::get('cache_api_response.get_summit_response_lifetime', 600), 'uses' => 'OAuth2SummitApiController@getSummits']);
|
|
||||||
Route::group(['prefix' => '{id}'], function () {
|
|
||||||
// locations
|
|
||||||
Route::group(['prefix' => 'locations'], function () {
|
|
||||||
Route::group(['prefix' => '{location_id}'], function () {
|
|
||||||
Route::get('', 'OAuth2SummitLocationsApiController@getLocation');
|
|
||||||
Route::get('/events/published','OAuth2SummitLocationsApiController@getLocationPublishedEvents');
|
|
||||||
Route::group(['prefix' => 'banners'], function () {
|
|
||||||
Route::get('', 'OAuth2SummitLocationsApiController@getLocationBanners');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// marketplace
|
|
||||||
Route::group(array('prefix' => 'marketplace'), function () {
|
|
||||||
|
|
||||||
Route::group(array('prefix' => 'appliances'), function () {
|
|
||||||
Route::get('', 'AppliancesApiController@getAll');
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::group(array('prefix' => 'distros'), function () {
|
|
||||||
Route::get('', 'DistributionsApiController@getAll');
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::group(array('prefix' => 'consultants'), function () {
|
|
||||||
Route::get('', 'ConsultantsApiController@getAll');
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::group(array('prefix' => 'hosted-private-clouds'), function () {
|
|
||||||
Route::get('', 'PrivateCloudsApiController@getAll');
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::group(array('prefix' => 'remotely-managed-private-clouds'), function () {
|
|
||||||
Route::get('', 'RemoteCloudsApiController@getAll');
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::group(array('prefix' => 'public-clouds'), function () {
|
|
||||||
Route::get('', 'PublicCloudsApiController@getAll');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//OAuth2 Protected API
|
//OAuth2 Protected API
|
||||||
Route::group([
|
Route::group([
|
||||||
@ -288,6 +227,7 @@ Route::group([
|
|||||||
Route::get('', 'OAuth2SummitEventsApiController@getUnpublishedEvents');
|
Route::get('', 'OAuth2SummitEventsApiController@getUnpublishedEvents');
|
||||||
//Route::get('{event_id}', 'OAuth2SummitEventsApiController@getUnpublisedEvent');
|
//Route::get('{event_id}', 'OAuth2SummitEventsApiController@getUnpublisedEvent');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group(array('prefix' => 'published'), function () {
|
Route::group(array('prefix' => 'published'), function () {
|
||||||
Route::get('', 'OAuth2SummitEventsApiController@getScheduledEvents');
|
Route::get('', 'OAuth2SummitEventsApiController@getScheduledEvents');
|
||||||
Route::get('/empty-spots', 'OAuth2SummitEventsApiController@getScheduleEmptySpots');
|
Route::get('/empty-spots', 'OAuth2SummitEventsApiController@getScheduleEmptySpots');
|
||||||
@ -309,14 +249,15 @@ Route::group([
|
|||||||
});
|
});
|
||||||
|
|
||||||
// presentations
|
// presentations
|
||||||
Route::group(array('prefix' => 'presentations'), function () {
|
Route::group(['prefix' => 'presentations'], function () {
|
||||||
Route::group(array('prefix' => '{presentation_id}'), function () {
|
Route::group(['prefix' => '{presentation_id}'], function () {
|
||||||
|
|
||||||
|
Route::group(['prefix' => 'videos'], function () {
|
||||||
|
|
||||||
Route::group(array('prefix' => 'videos'), function () {
|
|
||||||
Route::get('', 'OAuth2PresentationApiController@getPresentationVideos');
|
Route::get('', 'OAuth2PresentationApiController@getPresentationVideos');
|
||||||
Route::get('{video_id}', 'OAuth2PresentationApiController@getPresentationVideo');
|
Route::get('{video_id}', 'OAuth2PresentationApiController@getPresentationVideo');
|
||||||
Route::post('', [ 'middleware' => 'auth.user:administrators|video-admins', 'uses' => 'OAuth2PresentationApiController@addVideo' ]);
|
Route::post('', [ 'middleware' => 'auth.user:administrators|video-admins', 'uses' => 'OAuth2PresentationApiController@addVideo' ]);
|
||||||
Route::group(array('prefix' => '{video_id}'), function () {
|
Route::group(['prefix' => '{video_id}'], function () {
|
||||||
Route::put('', [ 'middleware' => 'auth.user:administrators|video-admins', 'uses' => 'OAuth2PresentationApiController@updateVideo' ]);
|
Route::put('', [ 'middleware' => 'auth.user:administrators|video-admins', 'uses' => 'OAuth2PresentationApiController@updateVideo' ]);
|
||||||
Route::delete('', [ 'middleware' => 'auth.user:administrators|video-admins', 'uses' => 'OAuth2PresentationApiController@deleteVideo' ]);
|
Route::delete('', [ 'middleware' => 'auth.user:administrators|video-admins', 'uses' => 'OAuth2PresentationApiController@deleteVideo' ]);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user