CronWebService.java 文件源码

java
阅读 57 收藏 0 点赞 0 评论 0

项目:openapi 作者:
/**
 * 启动计划任务
 */
@RequestMapping(value = "/start", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public String startCron(String cron_id){
    LOG.info("request /api/v2/cron/start start");
    Map<String,Object>  result = new HashMap<String, Object>();
    result.put("flag", "false");
    if(cron_id.length() != 16){
        result.put("error", Errorcode.ERR403_9.getValue());
        return JSON.toJSONString(result, JsonFilter.filter);
    }
    try{
        Map<String,Object>  mqrequest = new HashMap<String, Object>();
        mqrequest.put("id",cron_id );
        result = messageProducer.call("openapi.cron","startCron", mqrequest, 5000);
    }catch(Exception e){
        result.put("error", Errorcode.ERR500.getValue()+",openapi try/catch:"+ExceptionUtil.getStackTraceAsString(e));
    }
        return JSON.toJSONString(result,JsonFilter.filter);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号