| /** | 
|  * Copyright (c) 2018 人人开源 All rights reserved. | 
|  * <p> | 
|  * https://www.renren.io | 
|  * <p> | 
|  * 版权所有,侵权必究! | 
|  */ | 
|   | 
| package com.zt.modules.sys.controller; | 
|   | 
| import com.alibaba.fastjson.JSONObject; | 
| import com.zt.common.annotation.LogOperation; | 
| import com.zt.common.servlet.Result; | 
| import com.zt.common.utils.CacheUtils; | 
| import com.zt.modules.sys.service.SysParamsService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiOperation; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| /** | 
|  * 参数管理 | 
|  * | 
|  * @author hehz | 
|  * @since 1.0.0 | 
|  */ | 
| @RestController | 
| @RequestMapping("sys/common") | 
| @Api(tags = "参数管理") | 
| public class SysCommonController { | 
|     @Autowired | 
|     private SysParamsService sysParamsService; | 
|   | 
|     @GetMapping("stroke") | 
|     @ApiOperation("获取操作进度") | 
|     @LogOperation("获取操作进度") | 
|     public Result<JSONObject> getStroke(String progressId) { | 
|         JSONObject jsonObject = new JSONObject(); | 
|         jsonObject.put("speed", "0"); | 
|         try { | 
|             if (CacheUtils.get(progressId, "speed") != null) { | 
|                 jsonObject.put("speed", CacheUtils.get(progressId, "speed").toString()); | 
|                 jsonObject.put("text", CacheUtils.get(progressId, "msg").toString()); | 
|                 return Result.ok(jsonObject); | 
|             } else { | 
|                 return Result.ok(jsonObject); | 
|             } | 
|         } catch (Exception e) { | 
|             return Result.ok(jsonObject); | 
|         } | 
|     } | 
|   | 
|     @GetMapping("heartBeat") | 
|     @ApiOperation("获取操作进度") | 
|     @LogOperation("获取操作进度") | 
|     public Result heartBeat() { | 
|         return Result.ok(); | 
|     } | 
| } |