Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HBP Medical Informatics Platform
portal-backend
Commits
8e08a21a
Commit
8e08a21a
authored
9 years ago
by
Mirco Nasuti
Browse files
Options
Downloads
Patches
Plain Diff
add missing services (just mock)
parent
738c33e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/hbp/mip/MIPApplication.java
+94
-6
94 additions, 6 deletions
src/main/java/org/hbp/mip/MIPApplication.java
with
94 additions
and
6 deletions
src/main/java/org/hbp/mip/MIPApplication.java
+
94
−
6
View file @
8e08a21a
...
...
@@ -33,8 +33,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.hbp.mip.mock.ArticleMock
;
import
org.hbp.mip.mock.ModelMock
;
import
org.hbp.mip.model.Article
;
import
org.hbp.mip.model.Model
;
import
org.hbp.mip.model.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
@@ -43,6 +42,7 @@ import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoT
import
org.springframework.boot.context.embedded.FilterRegistrationBean
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.oauth2.client.OAuth2ClientContext
;
...
...
@@ -58,9 +58,7 @@ import org.springframework.security.web.csrf.CsrfFilter;
import
org.springframework.security.web.csrf.CsrfToken
;
import
org.springframework.security.web.csrf.CsrfTokenRepository
;
import
org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.filter.OncePerRequestFilter
;
import
org.springframework.web.util.WebUtils
;
...
...
@@ -73,25 +71,115 @@ public class MIPApplication extends WebSecurityConfigurerAdapter {
OAuth2ClientContext
oauth2ClientContext
;
@RequestMapping
(
"/user"
)
@ResponseBody
public
Principal
user
(
Principal
principal
)
{
return
principal
;
}
@RequestMapping
(
value
=
"/articles"
,
method
=
RequestMethod
.
GET
)
public
List
<
Article
>
articles
()
{
@ResponseBody
public
List
<
Article
>
getArticles
()
{
List
<
Article
>
articles
=
new
LinkedList
<>();
articles
.
add
(
new
ArticleMock
(
1
));
articles
.
add
(
new
ArticleMock
(
2
));
return
articles
;
}
@RequestMapping
(
value
=
"/articles/{slug}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Article
getArticle
(
@PathVariable
(
"slug"
)
String
slug
)
{
return
new
ArticleMock
(
1
);
}
@RequestMapping
(
value
=
"/datasets/{code}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Dataset
getDatasets
(
@PathVariable
(
"code"
)
String
code
)
{
return
null
;
}
@RequestMapping
(
value
=
"/models"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
List
<
Model
>
getModels
()
{
List
<
Model
>
models
=
new
LinkedList
<>();
models
.
add
(
new
ModelMock
(
1
));
return
models
;
}
@RequestMapping
(
value
=
"/models/{slug}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Model
getModel
(
@PathVariable
(
"slug"
)
String
slug
)
{
return
new
ModelMock
(
1
);
}
@RequestMapping
(
value
=
"/articles"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Article
postArticle
(
@RequestBody
Article
article
)
{
return
new
ArticleMock
(
1
);
}
@RequestMapping
(
value
=
"/models"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Model
postModel
(
@RequestBody
Model
model
)
{
return
new
ModelMock
(
1
);
}
@RequestMapping
(
value
=
"/models/{slug}/copies"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Model
postModelCopies
(
@PathVariable
(
"slug"
)
String
slug
)
{
return
new
ModelMock
(
1
);
}
@RequestMapping
(
value
=
"/queries/requests"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Query
postRequest
(
@RequestBody
Query
query
)
{
return
null
;
}
@RequestMapping
(
value
=
"/articles/{slug}"
,
method
=
RequestMethod
.
PUT
)
@ResponseStatus
(
HttpStatus
.
NO_CONTENT
)
public
void
putArticle
(
@PathVariable
(
"slug"
)
String
slug
)
{
}
@RequestMapping
(
value
=
"/models/{slug}"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
Model
putModel
(
@PathVariable
(
"slug"
)
String
slug
)
{
return
null
;
}
@RequestMapping
(
value
=
"/articles/{slug}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseStatus
(
HttpStatus
.
NO_CONTENT
)
public
void
deleteArticle
(
@PathVariable
(
"slug"
)
String
slug
)
{
}
@RequestMapping
(
value
=
"/models/{slug}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseStatus
(
HttpStatus
.
NO_CONTENT
)
public
void
deleteModel
(
@PathVariable
(
"slug"
)
String
slug
,
@RequestBody
Model
model
)
{
}
@RequestMapping
(
value
=
"/groups"
)
@ResponseBody
public
Group
getGroups
(){
return
null
;
}
@RequestMapping
(
value
=
"/variables"
)
@ResponseBody
public
List
<
Variable
>
getVariables
(){
return
null
;
}
@RequestMapping
(
value
=
"/variables/{code}"
)
@ResponseBody
public
Variable
getVariable
(
@PathVariable
(
"code"
)
String
code
){
return
null
;
}
@RequestMapping
(
value
=
"/variables/{code}/values"
)
@ResponseBody
public
List
<
Value
>
getValues
(
@PathVariable
(
"code"
)
String
code
){
return
null
;
}
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
// @formatter:off
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
register
or
sign in
to comment