|
|
@@ -1,3 +1,53 @@
|
|
|
+/**
|
|
|
+ * @swagger
|
|
|
+ *
|
|
|
+ * components:
|
|
|
+ * schemas:
|
|
|
+ * UserGroup:
|
|
|
+ * description: UserGroup
|
|
|
+ * type: object
|
|
|
+ * properties:
|
|
|
+ * __v:
|
|
|
+ * type: number
|
|
|
+ * description: record version
|
|
|
+ * example: 0
|
|
|
+ * _id:
|
|
|
+ * type: string
|
|
|
+ * description: user group ID
|
|
|
+ * example: 5e2d56c1e35da4004ef7e0b0
|
|
|
+ * createdAt:
|
|
|
+ * type: string
|
|
|
+ * description: date created at
|
|
|
+ * example: 2010-01-01T00:00:00.000Z
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * @swagger
|
|
|
+ *
|
|
|
+ * components:
|
|
|
+ * schemas:
|
|
|
+ * UserGroupRelation:
|
|
|
+ * description: UserGroupRelation
|
|
|
+ * type: object
|
|
|
+ * properties:
|
|
|
+ * __v:
|
|
|
+ * type: number
|
|
|
+ * description: record version
|
|
|
+ * example: 0
|
|
|
+ * _id:
|
|
|
+ * type: string
|
|
|
+ * description: user group relation ID
|
|
|
+ * example: 5e2d56cbe35da4004ef7e0b1
|
|
|
+ * relatedGroup:
|
|
|
+ * $ref: '#/components/schemas/UserGroup'
|
|
|
+ * relatedUser:
|
|
|
+ * $ref: '#/components/schemas/User/properties/_id'
|
|
|
+ * createdAt:
|
|
|
+ * type: string
|
|
|
+ * description: date created at
|
|
|
+ * example: 2010-01-01T00:00:00.000Z
|
|
|
+ */
|
|
|
+
|
|
|
module.exports = function(crowi, app) {
|
|
|
const debug = require('debug')('growi:routes:me');
|
|
|
const logger = require('@alias/logger')('growi:routes:me');
|
|
|
@@ -14,6 +64,33 @@ module.exports = function(crowi, app) {
|
|
|
const api = {};
|
|
|
actions.api = api;
|
|
|
|
|
|
+ /**
|
|
|
+ * @swagger
|
|
|
+ *
|
|
|
+ * /_api/me/user-group-relations:
|
|
|
+ * get:
|
|
|
+ * tags: [Me, CrowiCompatibles]
|
|
|
+ * operationId: getUserGroupRelations
|
|
|
+ * summary: /_api/me/user-group-relations
|
|
|
+ * description: Get user group relations
|
|
|
+ * responses:
|
|
|
+ * 200:
|
|
|
+ * description: Succeeded to get user group relations.
|
|
|
+ * content:
|
|
|
+ * application/json:
|
|
|
+ * schema:
|
|
|
+ * properties:
|
|
|
+ * ok:
|
|
|
+ * $ref: '#/components/schemas/V1Response/properties/ok'
|
|
|
+ * userGroupRelations:
|
|
|
+ * type: array
|
|
|
+ * items:
|
|
|
+ * $ref: '#/components/schemas/UserGroupRelation'
|
|
|
+ * 403:
|
|
|
+ * $ref: '#/components/responses/403'
|
|
|
+ * 500:
|
|
|
+ * $ref: '#/components/responses/500'
|
|
|
+ */
|
|
|
/**
|
|
|
* retrieve user-group-relation documents
|
|
|
* @param {object} req
|