package com.tuoheng.admin.service.third.dsp;

import com.tuoheng.admin.entity.request.third.DspCallbackRequest;
import com.tuoheng.admin.entity.request.third.DspRecordingCallbackRequest;
import com.tuoheng.admin.service.third.dsp.callback.DspQuestionCallbackService;
import com.tuoheng.admin.service.third.dsp.callback.DspRecordingCallbackService;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * DSP回调 服务实现类
 *
 * @author WangHaoran
 * @since 2021-09-01
 */
@Slf4j
@Service
public class DspCallbackServiceImpl implements IDspCallbackService {

    @Autowired
    private DspQuestionCallbackService dspQuestionCallbackService;

    @Autowired
    private DspRecordingCallbackService dspRecordingCallbackService;

    /**
     * 保存DSP回调数据
     *
     * @param requestId          请求id
     * @param dspCallbackRequest 回调请求体
     * @return
     */
    @Override
    public JsonResult saveCallbackData(String requestId, DspCallbackRequest dspCallbackRequest) {
        return dspQuestionCallbackService.callback(requestId, dspCallbackRequest);
    }

    @Override
    public JsonResult recordingCallbackData(DspRecordingCallbackRequest request) {
        return dspRecordingCallbackService.callback(request);
    }


}
