
const Api = require('../net/Api');

class ArtistTrainApi {

    /**
     * 获取艺人的培养列表
     * @param {int} targetUid 艺人的 uid
     * @param {*} success 
     * @param {*} fail 
     */
    static missionGetTrainings(targetUid, success, fail) {
        
        let url = "/mission/getTrainings.do";

        let data = {
            targetUid: targetUid,
        };

        let requestBody = {
            url: url,
            data: data,
            success: success,
            fail: fail,
            complete: () => {

            }
        };

        Api.httpGet(requestBody);
    }

    /**
     * 艺人培养
     * @param {int} targetUid 艺人的 uid
     * @param {int} missionId 任务id
     * @param {*} success 
     * @param {*} fail 
     */
    static missionTrains(targetUid, missionId, success, fail) {
        
        let url = "/mission/train.do";

        let data = {
            targetUid: targetUid,
            missionId: missionId
        };

        let requestBody = {
            url: url,
            data: data,
            success: success,
            fail: fail,
            complete: () => {

            }
        };

        Api.httpPost(requestBody);
    }

    /**
     * 获取培养成果
     * @param {int} targetUid 艺人的 uid
     * @param {int} missionId 任务id
     * @param {*} success 
     * @param {*} fail 
     */
    static missionGain(targetUid, missionId, success, fail) {
        
        let url = "/mission/gain.do";

        let data = {
            targetUid: targetUid,
            missionId: missionId
        };

        let requestBody = {
            url: url,
            data: data,
            success: success,
            fail: fail,
            complete: () => {

            }
        };

        Api.httpPost(requestBody);
    }

    /**
     * 加速培养任务
     * @param {int} targetUid 艺人的 uid
     * @param {int} missionId 任务id
     * @param {*} success 
     * @param {*} fail 
     */
    static missionSpeedUp(targetUid, missionId, success, fail) {
        
        let url = "/mission/speedUp.do";

        let data = {
            targetUid: targetUid,
            missionId: missionId
        };

        let requestBody = {
            url: url,
            data: data,
            success: success,
            fail: fail,
            complete: () => {

            }
        };

        Api.httpPost(requestBody);
    }
}

module.exports = ArtistTrainApi;