async createInvitation (uid) {
    const code = randomString.generate(24)
    const groupInfo = await permission.getUserPermissionGroupInfo(uid)

    await db('invitations').insert({
      creator: uid,
      code,
      permission_group: groupInfo.rule.invitationGroup,
      createTime: (new Date()).getTime()
    })

    return code
  }
Create invitation code

@param {Int} uid user id

@returns {String} invitation code