itizawa 6 лет назад
Родитель
Сommit
e4e3059303
1 измененных файлов с 41 добавлено и 0 удалено
  1. 41 0
      src/server/routes/apiv3/users.js

+ 41 - 0
src/server/routes/apiv3/users.js

@@ -37,6 +37,47 @@ module.exports = (crowi) => {
     }),
   ];
 
+  /**
+   * @swagger
+   *
+   *  paths:
+   *    /_api/v3/users/invite:
+   *      post:
+   *        tags: [Users]
+   *        description: Create new users and send Emails
+   *        produces:
+   *          - application/json
+   *        parameters:
+   *          - name: shapedEmailList
+   *            in: query
+   *            description: Invitation emailList
+   *            schema:
+   *              type: array
+   *          - name: sendEmail
+   *            in: query
+   *            description: Whether to send mail
+   *            schema:
+   *              type: boolean
+   *        responses:
+   *          200:
+   *            description: Inviting user success
+   *            content:
+   *              application/json:
+   *                schema:
+   *                  properties:
+   *                    createdUserList:
+   *                      type: array
+   *                      email:
+   *                        type: string
+   *                      password:
+   *                        type: string
+   *                      description: Users successfully created
+   *                    existingEmailList:
+   *                      type: array
+   *                      email:
+   *                        type: string
+   *                      description: Users email that already exists
+   */
   router.post('/invite', loginRequired(), adminRequired, csrf, validator.inviteEmail, ApiV3FormValidator, async(req, res) => {
     try {
       const emailList = await User.createUsersByInvitation(req.body.shapedEmailList, req.body.sendEmail);