Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
MP-Tsel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dzulfiqar Ridha
MP-Tsel
Commits
644eeaf7
Commit
644eeaf7
authored
Apr 10, 2019
by
Dzulfqar Ridha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update application controller
parent
efc9e391
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
787 additions
and
49 deletions
+787
-49
ApplicationController.php
app/Http/Controllers/ApplicationController.php
+96
-39
PackageKeyController.php
app/Http/Controllers/PackageKeyController.php
+217
-0
CreateRequest.php
app/Http/Request/Application/CreateRequest.php
+46
-0
DeleteRequest.php
app/Http/Request/Application/DeleteRequest.php
+46
-0
GetByAppIdRequest.php
app/Http/Request/Application/GetByAppIdRequest.php
+46
-0
GetByUserIdRequest.php
app/Http/Request/Application/GetByUserIdRequest.php
+2
-2
UpdateRequest.php
app/Http/Request/Application/UpdateRequest.php
+46
-0
ActivateRequest.php
app/Http/Request/PackageKey/ActivateRequest.php
+45
-0
CreateRequest.php
app/Http/Request/PackageKey/CreateRequest.php
+47
-0
DeleteRequest.php
app/Http/Request/PackageKey/DeleteRequest.php
+46
-0
DisableRequest.php
app/Http/Request/PackageKey/DisableRequest.php
+45
-0
GetByUserRequest.php
app/Http/Request/PackageKey/GetByUserRequest.php
+45
-0
UpdatePlanRequest.php
app/Http/Request/PackageKey/UpdatePlanRequest.php
+46
-0
web.php
routes/web.php
+14
-8
No files found.
app/Http/Controllers/ApplicationController.php
View file @
644eeaf7
...
...
@@ -9,36 +9,23 @@
namespace
App\Http\Controllers
;
use
App\Classes\MResponse
;
use
App\Http\Request\Application\CreateDefaultApplicationRequest
;
use
App\Http\Request\Application\CreateRequest
;
use
App\Http\Request\Application\UpdateRequest
;
class
ApplicationController
extends
BaseController
{
public
function
create
Default
(
CreateDefaultApplication
Request
$request
)
public
function
create
(
Create
Request
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'user
i
d'
)
.
'/applications'
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'user
I
d'
)
.
'/applications'
;
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'POST'
,
$url
,
[
'json'
=>
[
'name'
=>
$request
->
get
(
'marketplace-name'
)
.
'-DefaultApp'
,
'username'
=>
$request
->
get
(
'username'
),
'description'
=>
''
,
'type'
=>
''
,
'commercial'
=>
false
,
'ads'
=>
false
,
'adsSystem'
=>
''
,
'usageModel'
=>
''
,
'tags'
=>
''
,
'notes'
=>
''
,
'howDidYouHear'
=>
''
,
'preferredProtocol'
=>
''
,
'preferredOutput'
=>
''
,
'externalId'
=>
''
,
'uri'
=>
''
,
'oauthRedirectUri'
=>
''
'name'
=>
'WebApp'
,
'username'
=>
$request
->
get
(
'username'
)
]
]);
...
...
@@ -60,32 +47,18 @@ class ApplicationController extends BaseController
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
createApp
(
CreateDefaultApplication
Request
$request
)
public
function
update
(
Update
Request
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'user
id'
)
.
'/applications'
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'user
Id'
)
.
'/applications/'
.
$request
->
get
(
'appId'
)
;
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'P
OS
T'
,
$url
,
[
$response
=
$this
->
masheryClient
()
->
request
(
'P
U
T'
,
$url
,
[
'json'
=>
[
'name'
=>
$request
->
get
(
'marketplace-name'
)
.
'-WebApp'
,
'username'
=>
$request
->
get
(
'username'
),
'description'
=>
''
,
'type'
=>
''
,
'commercial'
=>
false
,
'ads'
=>
false
,
'adsSystem'
=>
''
,
'usageModel'
=>
''
,
'tags'
=>
''
,
'notes'
=>
''
,
'howDidYouHear'
=>
''
,
'preferredProtocol'
=>
''
,
'preferredOutput'
=>
''
,
'externalId'
=>
''
,
'uri'
=>
''
,
'oauthRedirectUri'
=>
''
'name'
=>
'UpdateApp'
,
'description'
=>
'Update'
]
]);
...
...
@@ -106,4 +79,88 @@ class ApplicationController extends BaseController
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
delete
(
DeleteRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'userId'
)
.
'/applications/'
.
$request
->
get
(
'appId'
);
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'DEL'
,
$url
);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
getByUserID
(
GetByUserIdRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'userId'
)
.
'/applications'
;
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'GET'
,
$url
);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
getByAppId
(
GetByAppId
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'userId'
)
.
'/applications/'
.
$request
->
get
(
'appId'
);
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'GET'
,
$url
);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
}
app/Http/Controllers/PackageKeyController.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:24 PM
*/
namespace
App\Http\Controllers
;
use
App\Classes\MResponse
;
use
App\Http\Request\PackageKey\CreateRequest
;
use
App\Http\Request\PackageKey\ActivateRequest
;
use
App\Http\Request\PackageKey\DisableRequest
;
use
App\Http\Request\PackageKey\DeleteRequest
;
use
App\Http\Request\PackageKey\GetByUserRequest
;
use
App\Http\Request\PackageKey\UpdatePlanRequest
;
class
ApplicationController
extends
BaseController
{
public
function
create
(
CreateRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/applications/'
.
$request
->
get
(
'appId'
)
.
'/packageKeys'
;
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'POST'
,
$url
,
[
'json'
=>
[
'apikey'
=>
''
,
'secret'
=>
''
,
'package'
=>
[
'id'
=>
$request
->
get
(
'pkgId'
)
],
'plan'
=>
[
'id'
=>
$request
->
get
(
'planId'
)
]
]
]);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
activate
(
ActivateRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/packageKeys/'
.
$request
->
get
(
'pkgKeyId'
);
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'PUT'
,
$url
,
[
'json'
=>
[
'status'
=>
'active'
]
]);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
disable
(
DisableRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/packageKeys/'
.
$request
->
get
(
'pkgKeyId'
);
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'PUT'
,
$url
,
[
'json'
=>
[
'status'
=>
'disabled'
]
]);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
delete
(
DeleteRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/applications/'
.
$request
->
get
(
'appId'
)
.
'/packageKeys/'
.
$request
->
get
(
'pkgKeyId'
);
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'DEL'
,
$url
);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
getByUser
(
GetByUserRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/members/'
.
$request
->
get
(
'userId'
)
.
'/packageKeys'
;
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'GET'
,
$url
,
[
'query'
=>
[
'fields'
=>
'id,apikey,secret,status,application.id,application.name,application.username,package.id,package.name,plan.id,plan.name'
]
]);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
public
function
updatePlan
(
UpdatePlanRequest
$request
)
{
$mResponse
=
new
MResponse
();
$statusCode
=
200
;
$url
=
'https://api.mashery.com/v3/rest/applications/'
.
$request
->
get
(
'appId'
)
.
'/packageKeys/'
.
$request
->
get
(
'pkgKeyId'
);
try
{
$response
=
$this
->
masheryClient
()
->
request
(
'PUT'
,
$url
,
[
'json'
=>
[
'plan'
=>
[
'id'
=>
$request
->
get
(
'planId'
)
]
]
]);
$resBody
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$response
->
getStatusCode
()
!=
200
)
{
$statusCode
=
$response
->
getStatusCode
();
$mResponse
->
message
=
$resBody
;
}
else
{
$mResponse
->
success
=
true
;
$mResponse
->
message
=
'success'
;
$mResponse
->
data
=
$resBody
;
}
}
catch
(
\Exception
$e
)
{
$statusCode
=
500
;
$mResponse
->
message
=
$e
->
getMessage
();
}
return
response
()
->
json
(
$mResponse
,
$statusCode
);
}
}
app/Http/Request/Application/CreateRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
CreateRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'userId'
=>
'required'
,
'username'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/Application/DeleteRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
DeleteRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'userId'
=>
'required'
,
'appId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/Application/GetByAppIdRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
GetByAppIdRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'userId'
=>
'required'
,
'appId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/Application/
CreateDefaultApplication
Request.php
→
app/Http/Request/Application/
GetByUserId
Request.php
View file @
644eeaf7
...
...
@@ -8,7 +8,7 @@
namespace
App\Http\Request
;
class
CreateDefaultApplicationRequest
extends
FormRequestErrors
class
GetByUserId
extends
FormRequestErrors
{
protected
function
validationData
()
{
...
...
@@ -23,7 +23,7 @@ class CreateDefaultApplicationRequest extends FormRequestErrors
public
function
rules
()
{
return
[
'user
i
d'
=>
'required'
'user
I
d'
=>
'required'
];
}
...
...
app/Http/Request/Application/UpdateRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
UpdateRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'userId'
=>
'required'
,
'appId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/PackageKey/ActivateRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
ActivateRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'pkgKeyId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/PackageKey/CreateRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
CreateRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'appId'
=>
'required'
,
'pkgId'
=>
'required'
,
'planId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/PackageKey/DeleteRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
DeleteRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'appId'
=>
'required'
,
'pkgKeyId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/PackageKey/DisableRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
DisableRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'pkgKeyId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/PackageKey/GetByUserRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
GetByUserRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'userId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
app/Http/Request/PackageKey/UpdatePlanRequest.php
0 → 100644
View file @
644eeaf7
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace
App\Http\Request
;
class
UpdatePlanRequest
extends
FormRequestErrors
{
protected
function
validationData
()
{
return
$this
->
all
();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
return
[
'appId'
=>
'required'
,
'pkgKeyId'
=>
'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public
function
messages
()
{
return
[];
}
protected
function
modifyData
()
{
$data
=
$this
->
validationData
();
return
$data
;
}
}
routes/web.php
View file @
644eeaf7
...
...
@@ -23,25 +23,31 @@ $router->group(['prefix' => 'mashery'], function () use ($router) {
$router
->
group
([
'middleware'
=>
'client.auth'
],
function
()
use
(
$router
)
{
$router
->
group
([
'prefix'
=>
'user'
],
function
()
use
(
$router
)
{
$router
->
get
(
'by-username'
,
'UserController@getByUsername'
);
$router
->
get
(
'by-id'
,
'UserController@getById'
);
$router
->
get
(
'update'
,
'UserController@updateUser'
);
$router
->
post
(
'create'
,
'UserController@createUser'
);
});
$router
->
group
([
'prefix'
=>
'application'
],
function
()
use
(
$router
)
{
$router
->
post
(
'create-default'
,
'ApplicationController@createDefault'
);
$router
->
post
(
'create'
,
'ApplicationController@createApp'
);
$router
->
post
(
'create'
,
'ApplicationController@create'
);
$router
->
post
(
'update'
,
'ApplicationController@update'
);
$router
->
post
(
'delete'
,
'ApplicationController@delete'
);
$router
->
post
(
'by-userid'
,
'ApplicationController@getByUserId'
);
$router
->
post
(
'by-appid'
,
'ApplicationController@getByAppId'
);
});
$router
->
group
([
'prefix'
=>
'package'
],
function
()
use
(
$router
)
{
$router
->
get
(
'package'
,
'PackagePlanController@getPackage'
);
$router
->
get
(
'plan'
,
'PackagePlanController@getPlan'
);
$router
->
get
(
'package-plan'
,
'PackagePlanController@getPackagePlan'
);
});
$router
->
group
([
'prefix'
=>
'packageKey'
],
function
()
use
(
$router
)
{
$router
->
post
(
'create'
,
'PackageKeyController@create'
);
$router
->
post
(
'activate'
,
'PackageKeyController@activate'
);
$router
->
post
(
'disable'
,
'PackageKeyController@disable'
);
$router
->
post
(
'delete'
,
'PackageKeyController@delete'
);
$router
->
post
(
'by-username'
,
'PackageKeyController@getByUser'
);
$router
->
post
(
'update-plan'
,
'PackageKeyController@updatePlan'
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment