Commit d44fb8fe zshaohui

优化指令操作

1 个父辈 f06b450c
......@@ -8,12 +8,16 @@ import com.myproject.webapp.controller.webService.StorageDataController;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RequestMapping("/smf/rest/api")
@RestController
public class CommandController {
@Autowired
private ITaskService taskService;
......@@ -25,7 +29,7 @@ public class CommandController {
* @param command
* @return
*/
@RequestMapping(value = "/opDeviceIo")
@RequestMapping(value = "/opDeviceIo",method = RequestMethod.POST)
public ResultBean opDeviceIo(@RequestBody Command command) {
String cid = command.getCid();
String name = command.getName();
......@@ -33,7 +37,7 @@ public class CommandController {
log.info("{}收到数据为:{}", "opDeviceIo", cid + "--" + "--" + name + "--" + value);
if ("NEED_EMPTY".equals(name) || "TAKE_STATUS".equals(name)
|| "OUT_STATUS".equals(name) || "IN_STATUS".equals(name)) {
return ResultBean.newErrorResult(-1,"No Implementation");
return ResultBean.newErrorResult(-1, "No Implementation");
}
String opValue = "";
if (value == 0) {
......@@ -51,7 +55,7 @@ public class CommandController {
* @param params
* @return
*/
@RequestMapping(value = "/getStatus")
@RequestMapping(value = "/getStatus",method = RequestMethod.POST)
public ResultBean getStatus(@RequestBody Map<String, String> params) {
String cid = params.get("cid");
String name = params.get("name");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!