OtaController.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package com.YuyeTech.TPlat.controller;
  2. import com.YuyeTech.TPlat.VO.ResultVO;
  3. import com.YuyeTech.TPlat.dataobject.OtaInfo;
  4. import com.YuyeTech.TPlat.service.OtaInfoService;
  5. import com.YuyeTech.TPlat.utils.ResultVOUtil;
  6. import lombok.extern.slf4j.Slf4j;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RequestParam;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import java.util.HashMap;
  13. import java.util.List;
  14. import java.util.Map;
  15. import static com.YuyeTech.TPlat.enums.ResultEnum.NO_OTA;
  16. /**
  17. * @author:slambb
  18. * @date:2020/1/10
  19. */
  20. @RestController
  21. @RequestMapping("/OTA")
  22. @Slf4j
  23. public class OtaController {
  24. @Autowired
  25. private OtaInfoService otaInfoService;
  26. /**
  27. * 获取游戏分类
  28. * @return
  29. */
  30. @GetMapping("/get_ota")
  31. public ResultVO getFcCategoryByType(@RequestParam(value = "bleType", required = false) Integer bleType){
  32. OtaInfo ota = otaInfoService.findOTAByBLETypeAndStatus(bleType,1);
  33. if(ota == null){
  34. return ResultVOUtil.error(NO_OTA.getCode(), NO_OTA.getMessage());
  35. }
  36. Map otaMap = new HashMap();
  37. otaMap.put("otaName",ota.getOtaName());
  38. otaMap.put("bleName",ota.getBleName());
  39. otaMap.put("otaDownload",ota.getOtaDownload());
  40. return ResultVOUtil.success(otaMap);
  41. }
  42. }