Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Backend Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SpinShare
Backend Server
Commits
68706de9
Commit
68706de9
authored
Feb 23, 2021
by
Laura Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimized client code, added file path to api endpoint
parent
8a886d0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
src/Controller/API/APIClientController.php
src/Controller/API/APIClientController.php
+1
-4
src/Entity/ClientRelease.php
src/Entity/ClientRelease.php
+13
-0
No files found.
src/Controller/API/APIClientController.php
View file @
68706de9
...
...
@@ -31,10 +31,7 @@ class APIClientController extends AbstractController
$data
=
[];
$latestVersion
=
$em
->
getRepository
(
ClientRelease
::
class
)
->
findOneBy
(
array
(
'platform'
=>
$platform
),
array
(
'majorVersion'
=>
'DESC'
,
'minorVersion'
=>
'DESC'
,
'patchVersion'
=>
'DESC'
));
$data
[
'stringVersion'
]
=
$latestVersion
->
getMajorVersion
()
.
"."
.
$latestVersion
->
getMinorVersion
()
.
"."
.
$latestVersion
->
getPatchVersion
();
$data
[
'majorVersion'
]
=
$latestVersion
->
getMajorVersion
();
$data
[
'minorVersion'
]
=
$latestVersion
->
getMinorVersion
();
$data
[
'patchVersion'
]
=
$latestVersion
->
getPatchVersion
();
$data
=
$latestVersion
->
getJSON
();
$response
=
new
JsonResponse
([
'version'
=>
$this
->
getParameter
(
'api_version'
),
'status'
=>
200
,
'data'
=>
$data
]);
return
$response
;
...
...
src/Entity/ClientRelease.php
View file @
68706de9
...
...
@@ -123,4 +123,17 @@ class ClientRelease
return
$this
;
}
public
function
getJSON
()
{
return
array
(
'id'
=>
$this
->
id
,
'uploadDate'
=>
$this
->
uploadDate
,
'stringVersion'
=>
$this
->
majorVersion
.
'.'
.
$this
->
minorVersion
.
'.'
.
$this
->
patchVersion
,
'majorVersion'
=>
$this
->
majorVersion
,
'minorVersion'
=>
$this
->
minorVersion
,
'patchVersion'
=>
$this
->
patchVersion
,
'platform'
=>
$this
->
platform
,
'path'
=>
$_ENV
[
'ASSET_BASE_URL'
]
.
"/"
.
$_ENV
[
'ASSET_CLIENT_FOLDER'
]
.
"/"
.
$this
->
fileReference
,
);
}
}
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