MachineApi.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.java110.common.api;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.java110.common.bmo.attrValue.IDeleteAttrValueBMO;
  4. import com.java110.common.bmo.attrValue.IGetAttrValueBMO;
  5. import com.java110.common.bmo.attrValue.ISaveAttrValueBMO;
  6. import com.java110.common.bmo.attrValue.IUpdateAttrValueBMO;
  7. import com.java110.common.bmo.machine.IMachineOpenDoorBMO;
  8. import com.java110.po.attrValue.AttrValuePo;
  9. import com.java110.utils.util.Assert;
  10. import com.java110.utils.util.BeanConvertUtil;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.http.ResponseEntity;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RequestMethod;
  16. import org.springframework.web.bind.annotation.RestController;
  17. @RestController
  18. @RequestMapping(value = "/machine")
  19. public class MachineApi {
  20. @Autowired
  21. private IMachineOpenDoorBMO machineOpenDoorBMOImpl;
  22. /**
  23. * 微信保存消息模板
  24. *
  25. * @param reqJson
  26. * @return
  27. * @serviceCode /machine/openDoor
  28. * @path /app/machine/openDoor
  29. */
  30. @RequestMapping(value = "/openDoor", method = RequestMethod.POST)
  31. public ResponseEntity<String> openDoor(@RequestBody JSONObject reqJson) {
  32. Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含小区信息");
  33. Assert.hasKeyAndValue(reqJson, "machineCode", "请求报文中未包含设备信息");
  34. Assert.hasKeyAndValue(reqJson, "userType", "请求报文中未包含用户类型");
  35. Assert.hasKeyAndValue(reqJson, "userId", "请求报文中未包含用户信息");
  36. return machineOpenDoorBMOImpl.openDoor(reqJson);
  37. }
  38. }