const API = require('../../../../lib/API.js')
const mqNames = require('../../../../plugin/mq/jkesMqNames.js')
const { executeLepaoTokenUpdate } = require('../../../../plugin/jkes/updateAccountCore.js')

class UpdateAccountiPhone extends API {
    constructor() {
        super()

        this.messageQueue = mqNames.queueNotify

        this.noEncrypt()
        this.setPath('/Lepao/UpdateAccountiPhone')
        this.setMethod('POST')
    }

    async onRequest(req, res) {
        await executeLepaoTokenUpdate(
            { logger: this.logger, messageQueue: this.messageQueue },
            req,
            res
        )
    }
}

module.exports.UpdateAccountiPhone = UpdateAccountiPhone
