-
Notifications
You must be signed in to change notification settings - Fork 33
/
UserController.js
120 lines (99 loc) · 1.97 KB
/
UserController.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/**
* UserController
*
* @description :: Server-side logic for managing Users
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
/**
* @swagger
* /allActions:
* tags:
* - User
* tags:
* name: Auth Mgt
* description: User management and login
*
* components:
* examples:
* dummy:
* summary: An example example
* value: 3.0
*/
function list2(req, res) {
}
list2.swagger = {
tags: ['User List'],
description: 'Return a user list (alternate)'
}
module.exports = {
login: function (req, res) {
},
/**
* @swagger
*
* /logout:
* summary: Perform Logout
* description: Logout of the application
* tags:
* - Auth Mgt
* parameters:
* - name: example-only
* description: Username to use for logout (dummy for test)
* in: query
* required: true
* schema:
* type: string
* - name: password
* description: User's password (dummy for test)
* in: query
* required: true
* schema:
* type: string
* responses:
* 200:
* description: logout result
*/
logout: function (req, res) {
},
upload: function (req, res) {
},
list: function (req, res) {
},
list2: list2,
// override User blueprint
/**
* @swagger
*
* /create:
* summary: Create User (**)
* tags:
* - User (ORM)
* - User (ORM duplicate)
*/
create: (req, res) => {
return res.json({ in: 'create' });
},
// override User blueprint
destroy: (req, res) => {
return res.json({ in: 'destroy' });
},
roles: function (req, res) {
},
swagger: {
actions: {
list: {
tags: ['User List'],
description: 'Return a user list'
},
},
tags: [
{
name: 'User List',
description: 'Group just for user list operation',
}
],
components: {
parameters: [],
},
},
};