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
a26df3e9
Commit
a26df3e9
authored
8 years ago
by
Mirco Nasuti
Browse files
Options
Downloads
Patches
Plain Diff
new json format for simple mining
parent
1f6f2816
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/hbp/mip/controllers/MiningApi.java
+5
-3
5 additions, 3 deletions
src/main/java/org/hbp/mip/controllers/MiningApi.java
src/main/java/org/hbp/mip/model/SimpleMiningQuery.java
+4
-3
4 additions, 3 deletions
src/main/java/org/hbp/mip/model/SimpleMiningQuery.java
with
9 additions
and
6 deletions
src/main/java/org/hbp/mip/controllers/MiningApi.java
+
5
−
3
View file @
a26df3e9
...
@@ -108,7 +108,9 @@ public class MiningApi {
...
@@ -108,7 +108,9 @@ public class MiningApi {
if
(
algo
.
getCode
().
equals
(
algoCode
))
if
(
algo
.
getCode
().
equals
(
algoCode
))
{
{
if
(
algo
.
getSource
().
equals
(
ML_SOURCE
))
{
if
(
algo
.
getSource
().
equals
(
ML_SOURCE
))
{
return
postMipMining
(
algoCode
,
model
);
Algorithm
algorithm
=
new
Gson
().
fromJson
(
new
JsonParser
().
parse
(
query
).
getAsJsonObject
()
.
get
(
"algorithm"
).
getAsJsonObject
(),
Algorithm
.
class
);
return
postMipMining
(
algorithm
,
model
);
}
}
else
if
(
algo
.
getSource
().
equals
(
EXAREME_SOURCE
))
else
if
(
algo
.
getSource
().
equals
(
EXAREME_SOURCE
))
{
{
...
@@ -120,10 +122,10 @@ public class MiningApi {
...
@@ -120,10 +122,10 @@ public class MiningApi {
return
new
ResponseEntity
<>(
HttpStatus
.
BAD_REQUEST
);
return
new
ResponseEntity
<>(
HttpStatus
.
BAD_REQUEST
);
}
}
private
ResponseEntity
<
String
>
postMipMining
(
String
algoCode
,
Model
model
)
throws
Exception
{
private
ResponseEntity
<
String
>
postMipMining
(
Algorithm
algorithm
,
Model
model
)
throws
Exception
{
SimpleMiningQuery
smq
=
new
SimpleMiningQuery
();
SimpleMiningQuery
smq
=
new
SimpleMiningQuery
();
smq
.
setAlgorithm
(
algo
Code
);
smq
.
setAlgorithm
(
algo
rithm
);
LinkedList
<
Map
<
String
,
String
>>
vars
=
new
LinkedList
<>();
LinkedList
<
Map
<
String
,
String
>>
vars
=
new
LinkedList
<>();
for
(
Variable
var
:
model
.
getQuery
().
getVariables
())
for
(
Variable
var
:
model
.
getQuery
().
getVariables
())
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/hbp/mip/model/SimpleMiningQuery.java
+
4
−
3
View file @
a26df3e9
...
@@ -2,6 +2,7 @@ package org.hbp.mip.model;
...
@@ -2,6 +2,7 @@ package org.hbp.mip.model;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
org.hbp.mip.model.algorithm.Algorithm
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -14,7 +15,7 @@ import java.util.Map;
...
@@ -14,7 +15,7 @@ import java.util.Map;
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
SimpleMiningQuery
{
public
class
SimpleMiningQuery
{
private
String
algorithm
;
private
Algorithm
algorithm
;
private
List
<
Map
<
String
,
String
>>
variables
;
private
List
<
Map
<
String
,
String
>>
variables
;
...
@@ -25,11 +26,11 @@ public class SimpleMiningQuery {
...
@@ -25,11 +26,11 @@ public class SimpleMiningQuery {
private
List
<
Map
<
String
,
String
>>
filters
;
private
List
<
Map
<
String
,
String
>>
filters
;
public
String
getAlgorithm
()
{
public
Algorithm
getAlgorithm
()
{
return
algorithm
;
return
algorithm
;
}
}
public
void
setAlgorithm
(
String
algorithm
)
{
public
void
setAlgorithm
(
Algorithm
algorithm
)
{
this
.
algorithm
=
algorithm
;
this
.
algorithm
=
algorithm
;
}
}
...
...
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