async createUserUseInvitation (code, username, password) {
    const codeStatus = await this.verifyInvitation(code)
    if (!codeStatus) {
      return {
        code: -1,
        msg: 'Code invalid',
        data: {}
      }
    }

    const codeInfo = await this.getInvitationInfo(code)
    const group = codeInfo.permission_group
    const uid = await user.createUser(username, password, group, 'Using invitation', 'invitation code')
    if (uid === -1) {
      return {
        code: -2,
        msg: 'Username exists',
        data: {}
      }
    }
    await this.useInvitation(uid, code)

    return {
      code: 0,
      msg: 'Success',
      data: {
        uid
      }
    }
  }
Create user using invitation code

@param {String} code invitation code
@param {String} username username
@param {String} password password