DatabusAdaptImpl.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2017-2020 吴学文 and java110 team.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.java110.job.adapt;
  17. import com.alibaba.fastjson.JSONObject;
  18. import com.java110.core.client.RestTemplate;
  19. import com.java110.entity.order.Business;
  20. import com.java110.job.adapt.hcIot.GetToken;
  21. import com.java110.vo.ResultVo;
  22. import org.springframework.http.HttpHeaders;
  23. import java.util.List;
  24. /**
  25. * @desc add by 吴学文 15:21
  26. */
  27. public abstract class DatabusAdaptImpl implements IDatabusAdapt {
  28. /**
  29. * 封装头信息
  30. *
  31. * @return
  32. */
  33. protected HttpHeaders getHeaders(RestTemplate outRestTemplate) {
  34. HttpHeaders httpHeaders = new HttpHeaders();
  35. httpHeaders.add("access_token", GetToken.get(outRestTemplate,false));
  36. //httpHeaders.add("Content-Type", "application/x-www-form-urlencoded");
  37. return httpHeaders;
  38. }
  39. /**
  40. * 开门
  41. *
  42. * @param paramIn 业务信息
  43. * @return
  44. */
  45. @Override
  46. public ResultVo openDoor(JSONObject paramIn) {
  47. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  48. }
  49. /**
  50. * 重启设备
  51. *
  52. * @param paramIn
  53. * @return
  54. */
  55. @Override
  56. public ResultVo restartMachine(JSONObject paramIn) {
  57. return new ResultVo(ResultVo.CODE_OK, ResultVo.MSG_OK);
  58. }
  59. /**
  60. * 业主处理执行
  61. *
  62. * @param business 当前处理业务
  63. * @param businesses 所有业务信息
  64. */
  65. @Override
  66. public void execute(Business business, List<Business> businesses) {
  67. }
  68. }