Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Platform
Commits
8dc60833
Commit
8dc60833
authored
Jul 12, 2024
by
kbeyro
Browse files
Options
Downloads
Patches
Plain Diff
Add new endpoints
parent
4f6d7828
No related branches found
No related tags found
1 merge request
!12
Add new endpoints
Pipeline
#87573
passed
Jul 12, 2024
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/geant/nmaas/portal/api/market/ApplicationController.java
+28
-5
28 additions, 5 deletions
.../geant/nmaas/portal/api/market/ApplicationController.java
with
28 additions
and
5 deletions
src/main/java/net/geant/nmaas/portal/api/market/ApplicationController.java
+
28
−
5
View file @
8dc60833
...
@@ -47,11 +47,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -47,11 +47,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.security.Principal
;
import
java.security.Principal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@RestController
@RestController
...
@@ -173,6 +169,14 @@ public class ApplicationController extends AppBaseController {
...
@@ -173,6 +169,14 @@ public class ApplicationController extends AppBaseController {
appBaseService
.
deleteAppBase
(
base
);
appBaseService
.
deleteAppBase
(
base
);
}
}
@GetMapping
(
value
=
"/base/{name}"
)
@PreAuthorize
(
"hasRole('ROLE_SYSTEM_ADMIN') || hasRole('ROLE_TOOL_MANAGER')"
)
@Transactional
public
ApplicationBaseView
getApplicationBase
(
@PathVariable
String
name
)
{
ApplicationBaseView
app
=
modelMapper
.
map
(
appBaseService
.
findByName
(
name
),
ApplicationBaseView
.
class
);
return
this
.
setAppRating
(
app
);
}
/*
/*
* Application part
* Application part
*/
*/
...
@@ -203,6 +207,25 @@ public class ApplicationController extends AppBaseController {
...
@@ -203,6 +207,25 @@ public class ApplicationController extends AppBaseController {
);
);
}
}
@GetMapping
(
value
=
"/{name}/version/{version}}"
)
@PreAuthorize
(
"hasRole('ROLE_SYSTEM_ADMIN') || hasRole('ROLE_TOOL_MANAGER')"
)
@Transactional
public
ApplicationDTO
getAppVersionByName
(
@PathVariable
String
name
,
@PathVariable
String
version
)
{
ApplicationBase
base
=
this
.
appBaseService
.
findByName
(
name
);
Optional
<
Application
>
application
=
this
.
applicationService
.
findApplication
(
name
,
version
);
if
(
application
.
isPresent
())
{
return
new
ApplicationDTO
(
modelMapper
.
map
(
base
,
ApplicationBaseView
.
class
),
modelMapper
.
map
(
application
.
get
(),
ApplicationView
.
class
)
);
}
else
{
throw
new
MissingElementException
(
"Application "
+
name
+
" version "
+
version
+
" not found"
);
}
}
@GetMapping
(
value
=
"/{id}"
)
@GetMapping
(
value
=
"/{id}"
)
@Transactional
@Transactional
public
ApplicationDTO
getApplicationDTO
(
@PathVariable
Long
id
)
{
public
ApplicationDTO
getApplicationDTO
(
@PathVariable
Long
id
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment