package com.ms.biz.spi.timer;

import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService;
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
import com.ms.biz.common.R;
import com.ms.biz.common.Ret;
import com.ms.biz.common.TimerBaseService;
import com.ms.api.dto.ItemDTO;
import com.ms.biz.task.DsMessageMoveBufferTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author elf
 */
@ExtensionService("dsMessageMoveBufferTimer")
@Slf4j
public class DsMessageMoveBufferTimerService extends TimerBaseService implements ExtensionServiceHandler<ItemDTO, Ret> {

    @Autowired
    private DsMessageMoveBufferTaskService dsMessageMoveBufferTaskService;

    @Override
    public BaseResponse<Ret> handle(BaseRequest<ItemDTO> req) {
        dsMessageMoveBufferTaskService.runTask();
        return R.ok(Ret.success());
    }

}
