package com.jwipc.sys.logic;

import com.dtflys.forest.annotation.Body;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Query;
import com.jwipc.sys.dto.JobAddDTO;
import com.jwipc.sys.dto.JobListDTO;
import org.springframework.http.ResponseEntity;

import java.util.List;

/**
 * <p> </p>
 *
 * @author BOGON
 * @version 1.0
 * @since JDK 1.8
 */
public interface JobLogic {
    @Get("#{sys.job-host}job/jobs")
    List<JobListDTO> list();

    @Get("#{sys.job-host}job/job")
    JobListDTO get(@Query("jobName") String jobName);

    @Post("#{sys.job-host}job/schedule")
    ResponseEntity add(@Body JobAddDTO jobName);

    @Post("#{sys.job-host}job/update")
    ResponseEntity update(@Body JobAddDTO jobName);

    @Post("#{sys.job-host}job/start")
    ResponseEntity run(@Body("jobName") String jobName);

    @Post("#{sys.job-host}job/stop")
    ResponseEntity stop(@Body("jobName") String jobName);

    @Post("#{sys.job-host}job/pause")
    ResponseEntity pause(@Body("jobName") String jobName);

    @Post("#{sys.job-host}job/resume")
    ResponseEntity resume(@Body("jobName") String jobName);

    @Post("#{sys.job-host}job/delete")
    ResponseEntity remove(@Body("jobName") String jobName);
}