diff --git a/src/main/java/org/hbp/mip/MIPApplication.java b/src/main/java/org/hbp/mip/MIPApplication.java index 20f3a7c641ab548cbaabb670a7575292db90184d..7f4247db8e9a2b69e1449e53169aae401bcbd6b2 100644 --- a/src/main/java/org/hbp/mip/MIPApplication.java +++ b/src/main/java/org/hbp/mip/MIPApplication.java @@ -96,7 +96,7 @@ public class MIPApplication extends WebSecurityConfigurerAdapter { @RequestMapping(value = "/articles", method = RequestMethod.GET) @ResponseBody - public List<Article> getArticles() { + public List<Article> getArticles(@RequestParam(name = "own", required = false) boolean own, @RequestParam(name = "team", required = false) int team, @RequestParam(name = "valid", required = false) boolean valid, @RequestParam(name = "status", required = false) String status) { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); List<Article> articles = session.createQuery("from Article").list(); @@ -130,7 +130,7 @@ public class MIPApplication extends WebSecurityConfigurerAdapter { @RequestMapping(value = "/models", method = RequestMethod.GET) @ResponseBody - public List<Model> getModels() { + public List<Model> getModels(@RequestParam(name = "limit", required = false) boolean limit, @RequestParam(name = "own", required = false) boolean own, @RequestParam(name = "team", required = false) int team, @RequestParam(name = "valid", required = false) boolean valid) { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); List<Model> models = session.createQuery("from Model").list(); diff --git a/src/main/resources/static/frontend/Gruntfile.js b/src/main/resources/static/frontend/Gruntfile.js index 1c586552991ad314e6bb0fdd41445a0d15451165..46040f6dde1e463d99ccfc7af095b470017d62e6 100644 --- a/src/main/resources/static/frontend/Gruntfile.js +++ b/src/main/resources/static/frontend/Gruntfile.js @@ -90,7 +90,7 @@ module.exports = function (grunt) { options: { port: 9002, // Change this to '0.0.0.0' to access the server from outside. - hostname: '155.105.202.21', + hostname: '155.105.202.23', livereload: 35730 }, livereload: { @@ -333,7 +333,7 @@ module.exports = function (grunt) { }, dev: { constants: { - backendUrl: 'http://155.105.202.21:8080', + backendUrl: 'http://155.105.202.23:8080', backendExportChartUrl: '<%= ngconstant.dev.constants.backendUrl %>/exportingChart.php', dropboxAppkey: '7wew0rj0gh2qcik' } diff --git a/src/main/resources/static/frontend/app/scripts/app/app.config.js b/src/main/resources/static/frontend/app/scripts/app/app.config.js index 87be856dfa9962c9f53e09f690f64edf8c7e493d..d7741f9578d63f2afe0a7e66450953c74d929f38 100644 --- a/src/main/resources/static/frontend/app/scripts/app/app.config.js +++ b/src/main/resources/static/frontend/app/scripts/app/app.config.js @@ -1,8 +1,8 @@ angular.module('app.config', []) -.constant('backendUrl', 'http://155.105.202.21:8080') +.constant('backendUrl', 'http://155.105.202.23:8080') -.constant('backendExportChartUrl', 'http://155.105.202.21:8080/exportingChart.php') +.constant('backendExportChartUrl', 'http://155.105.202.23:8080/exportingChart.php') .constant('dropboxAppkey', '7wew0rj0gh2qcik') diff --git a/src/main/resources/static/frontend/app/scripts/app/login/login.html b/src/main/resources/static/frontend/app/scripts/app/login/login.html index b62ffc90c3147bbac7616ffffaa0809af0682827..9cc8e9685df9b5309136457e1076a1a911d1c631 100644 --- a/src/main/resources/static/frontend/app/scripts/app/login/login.html +++ b/src/main/resources/static/frontend/app/scripts/app/login/login.html @@ -6,7 +6,7 @@ <h3> </h3> <h2>Login to HBP</h2> - <button type="button" onclick="location.href='http://155.105.202.21:8080/login/hbp';" class="btn-round"> + <button type="button" onclick="location.href='http://155.105.202.23:8080/login/hbp';" class="btn-round"> <span> <span>{{'login.title' | translate }}</span> <i class="ti ti-arrow-down"></i> diff --git a/swagger-MIP.yaml b/swagger-MIP.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a87300b85c1ac7a9c6aca0284b46ebc481f35e3b --- /dev/null +++ b/swagger-MIP.yaml @@ -0,0 +1,407 @@ +swagger: '2.0' +info: + title: 'MIP API' + description: 'Medical Informatics Platforme' + version: 1.0.0 +host: hbp-mip.chuv.ch +schemes: + - https +basePath: /v1 +produces: + - application/json +paths: + /articles: + get: + summary: 'Get all articles' + tags: + - Articles + responses: + '200': + description: 'An array of articles' + schema: + type: array + items: + $ref: '#/definitions/Article' + post: + summary: 'Create an article' + tags: + - Articles + parameters: + - name: article + in: body + description: 'Article to create' + required: true + schema: + type: object + $ref: "#/definitions/Article" + responses: + '200': + description: 'Article created' + /models: + get: + summary: 'Get all models' + tags: + - Models + responses: + '200': + description: 'An array of models' + schema: + type: array + items: + $ref: '#/definitions/Model' + post: + summary: 'Create a model' + tags: + - Models + parameters: + - name: model + in: body + description: 'Model to create' + required: true + schema: + type: object + $ref: "#/definitions/Model" + responses: + '200': + description: 'Model created' +definitions: + Article: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + status: + type: string + format: '{"draft":"Draft","published":"Published","closed":"Closed"}' + description: 'Status' + title: + type: string + description: Title + slug: + type: string + description: 'Short string identifier' + abstract: + type: string + description: 'Short introduction' + content: + type: string + description: 'Content' + publishedAt: + type: string + format: dateTime + description: 'Publication date' + createdAt: + type: string + format: dateTime + description: 'Creation date' + updatedAt: + type: string + format: dateTime + description: 'Update date' + createdBy: + $ref: "#/definitions/User" + description: 'Author' + updatedBy: + $ref: "#/definitions/User" + description: 'Updater' + tags: + type: array + items: + $ref: "#/definitions/Tag" + User: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + fullname: + type: string + description: 'Fullname' + username: + type: string + description: 'Username' + firstname: + type: string + description: 'Firstname' + lastname: + type: string + description: 'Lastname' + picture: + type: string + description: 'Path to a profile picture' + web: + type: string + description: 'Personnal web site URL' + phone: + type: string + description: 'Phone number' + birthday: + type: string + description: 'Birthday date' + gender: + type: string + description: 'Gender' + city: + type: string + description: 'City' + country: + type: string + description: 'Country' + password: + type: string + description: 'password' + email: + type: string + description: 'E-mail address' + apikey: + type: string + description: 'API key' + team: + type: string + description: 'Team' + isActive: + type: boolean + description: 'Is it active ?' + languages: + type: array + items: + type: string + description: 'Languages' + roles: + type: array + items: + type: string + description: 'Roles' + Tag: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + name: + type: string + description: 'Name' + Chart: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + chartType: + type: string + description: 'Chart type' + xAxis: + type: string + description: 'X axis label' + chartConfigSets: + type: array + items: + $ref: "#/definitions/ChartConfigSet" + description: 'Chart configuration' + ChartConfigSet: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + code: + type: string + description: 'Code' + label: + type: string + description: 'Label' + color: + type: string + description: 'Color' + Dataset: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + code: + type: string + description: 'Code' + date: + type: string + format: dateTime + description: 'Date' + header: + type: array + items: + type: string + description: 'Header' + Filter: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + variable: + type: object + $ref: "#/definitions/Variable" + description: 'Variable' + operator: + type: string + description: 'Operator' + Group: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + code: + type: string + description: 'Code' + label: + type: string + description: 'Label' + groups: + type: array + items: + type: object + $ref: "#/definitions/Group" + description: 'Groups' + Model: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + title: + type: string + description: 'Title' + slug: + type: string + description: 'slug' + description: + type: string + description: 'Description' + query: + type: object + $ref: "#/definitions/Query" + description: 'Query' + dataset: + type: object + $ref: "#/definitions/Dataset" + description: 'Dataset' + valid: + type: boolean + description: 'Is it valid ?' + chart: + type: object + $ref: "#/definitions/Chart" + description: 'Chart' + createdAt: + type: string + format: dateTime + description: 'Creation date' + updatedAt: + type: string + format: dateTime + description: 'Update date' + createdBy: + type: object + $ref: "#/definitions/User" + description: 'Author' + updatedBy: + type: object + $ref: "#/definitions/User" + description: 'Updater' + Query: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + variables: + type: array + items: + type: object + $ref: "#/definitions/Variable" + description: 'Variables' + covariables: + type: array + items: + type: object + $ref: "#/definitions/Variable" + description: 'Covariables' + grouping: + type: array + items: + type: object + $ref: "#/definitions/Variable" + description: 'Grouping' + filters: + type: array + items: + type: object + $ref: "#/definitions/Filter" + description: 'Filters' + request: + type: string + description: 'Request' + Value: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + code: + type: string + description: 'Code' + label: + type: string + description: 'Label' + Variable: + type: object + properties: + id: + type: integer + format: int64 + description: 'Unique identifier' + group: + type: object + $ref: "#/definitions/Group" + description: 'Group' + code: + type: string + description: 'Code' + label: + type: string + description: 'Label' + type: + type: string + description: 'Type' + length: + type: integer + description: 'Length' + isVariable: + type: boolean + description: 'Is it a variable ?' + isGrouping: + type: boolean + description: 'Is it a grouping variable ?' + isVariable: + type: boolean + description: 'Is it a covariable ?' + isFilter: + type: boolean + description: 'Is it a filter ?' + values: + type: array + items: + type: object + $ref: "#/definitions/Value"