|
@ -0,0 +1,50 @@
|
|
|
package com.yihu.wlyy.web;
|
|
|
|
|
|
import com.yihu.wlyy.service.specialist.SpecialistService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
|
* Created by 刘文彬 on 2018/9/13.
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/job/specialist", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "后台-任务控制每天8点、16点推送康复计划进展")
|
|
|
public class SpecialistController extends BaseController{
|
|
|
|
|
|
@Autowired
|
|
|
private SpecialistService specialistService;
|
|
|
|
|
|
@RequestMapping(value = "starJob", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "启动每天8点、16点推送康复计划进展")
|
|
|
public String starJob(@ApiParam(name = "type", value = "(1、8点推送,2、16点推送)",required = true)
|
|
|
@RequestParam(value = "type", required = true)Integer type){
|
|
|
try{
|
|
|
specialistService.starJob(type);
|
|
|
return success("启动成功!");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "启动失败:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "stopJob", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "关闭每天8点、16点推送康复计划进展")
|
|
|
public String stopJob(@ApiParam(name = "type", value = "(1、8点推送,2、16点推送)",required = true)
|
|
|
@RequestParam(value = "type", required = true)Integer type){
|
|
|
try{
|
|
|
specialistService.stopJob(type);
|
|
|
return success("关闭成功!");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "关闭失败:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|