From a8781b606073dcbf9d8a35c900ca6e127bd6f911 Mon Sep 17 00:00:00 2001 From: Sithira Munasinghe Date: Sat, 30 Jun 2018 21:22:39 +0530 Subject: [PATCH] Updated Readme --- README.md | 3 +++ app/Controllers/Http/ProjectController.js | 1 + app/Models/User.js | 20 +++++++++++++++++++- config/swagger.js | 6 +++--- docs/controllers/Project.yml | 2 +- docs/controllers/User.js | 21 +++++++++++++++++++++ 6 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 docs/controllers/User.js diff --git a/README.md b/README.md index 281ffc8..b3b7788 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,7 @@ adonis serve --dev adonis test ``` +### Angular 6 Client +[Client for APMS-BackEnd](https://github.com/Sithira/APMS-Client) + _AAF Assesment 2018 SHU - Sithira Munasinghe (27045236)_ diff --git a/app/Controllers/Http/ProjectController.js b/app/Controllers/Http/ProjectController.js index 7e355a5..99b0ec3 100644 --- a/app/Controllers/Http/ProjectController.js +++ b/app/Controllers/Http/ProjectController.js @@ -8,6 +8,7 @@ class ProjectController /** * Get all the projects * + * * @param request * @param response * @returns {Promise<*|{limit, strict, types}|Promise>} diff --git a/app/Models/User.js b/app/Models/User.js index f460585..003528a 100644 --- a/app/Models/User.js +++ b/app/Models/User.js @@ -4,7 +4,25 @@ const Hash = use('Hash'), Model = use('Model'), Team = use('App/Models/Team'); - +/** + * @swagger + * definitions: + * User: + * type: object + * properties: + * id: + * type: uint + * username: + * type: string + * email: + * type: string + * password: + * type: string + * required: + * - username + * - email + * - password + */ class User extends Model { diff --git a/config/swagger.js b/config/swagger.js index beeb60c..c81b04d 100644 --- a/config/swagger.js +++ b/config/swagger.js @@ -19,8 +19,8 @@ module.exports = { // security definition config securityDefinitions: { ApiKey: { - description: 'ApiKey description', - name: 'Authorization' + description: 'JWT Token', + name: 'Bearer ' }, // OAuth2 configuration @@ -49,6 +49,6 @@ module.exports = { ], definitions: [ - 'docs/models/*.yml' + ] }; \ No newline at end of file diff --git a/docs/controllers/Project.yml b/docs/controllers/Project.yml index 17999bf..e8792be 100644 --- a/docs/controllers/Project.yml +++ b/docs/controllers/Project.yml @@ -25,4 +25,4 @@ 200: description: users schema: - $ref: '#/definitions/Project' \ No newline at end of file + $ref: '#/definition/Project.yml' \ No newline at end of file diff --git a/docs/controllers/User.js b/docs/controllers/User.js new file mode 100644 index 0000000..8162dc6 --- /dev/null +++ b/docs/controllers/User.js @@ -0,0 +1,21 @@ +/** + * @swagger + * /users: + * post: + * description: Creates a user + * produces: + * - application/json + * parameters: + * - name: user + * description: User object + * in: body + * required: true + * type: string + * schema: + * $ref: '#/definitions/NewUser' + * responses: + * 200: + * description: users + * schema: + * $ref: '#/definitions/User' + */ \ No newline at end of file