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.TestTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@ExtensionService("testTimer")
@Slf4j
public class TestTimerService extends TimerBaseService implements ExtensionServiceHandler<ItemDTO, Ret> {

    @Autowired
    TestTaskService testTaskService;

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

}
