SkyImageApiController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package platform.modules.api.web;
  2. import com.github.pagehelper.PageInfo;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.util.ObjectUtils;
  5. import org.springframework.web.bind.annotation.*;
  6. import platform.modules.api.dto.SkyImageCount;
  7. import platform.modules.api.dto.Sync;
  8. import platform.modules.api.service.SkyImageApiService;
  9. import platform.modules.api.service.SkyImageCountApiService;
  10. import platform.modules.carrier.dto.CarrierLibraryResult;
  11. import platform.modules.carrier.entity.Building;
  12. import platform.modules.government.entity.User;
  13. import platform.modules.sys.web.ResponseMessage;
  14. import java.util.List;
  15. /**
  16. * @author kevin
  17. * @since 2019/10/30 2:21 PM
  18. */
  19. @RestController
  20. @RequestMapping("skyImage")
  21. public class SkyImageApiController {
  22. @Autowired
  23. private SkyImageApiService skyImageApiService;
  24. @Autowired
  25. private SkyImageCountApiService skyImageCountApiService;
  26. @PostMapping("syncUserInfo")
  27. public ResponseMessage syncSkyImageUserInfo(@RequestBody List<Sync> syncs){
  28. if (!ObjectUtils.isEmpty(syncs)){
  29. return skyImageApiService.syncUserInfo(syncs);
  30. }
  31. else {
  32. ResponseMessage.error("用户不能为空");
  33. }
  34. return ResponseMessage.success("success");
  35. }
  36. @GetMapping("/factoryBuilding")
  37. public ResponseMessage factoryBuilding(){
  38. List<SkyImageCount> counts = skyImageCountApiService.factoryBuilding();
  39. return ResponseMessage.success("success", counts);
  40. }
  41. @GetMapping("parkCount")
  42. public ResponseMessage parkCount(){
  43. return ResponseMessage.success("success", skyImageCountApiService.getParkStatistic());
  44. }
  45. @GetMapping("streetCount")
  46. public ResponseMessage streetCount(){
  47. return ResponseMessage.success("success", skyImageCountApiService.getStreetStatistic());
  48. }
  49. @GetMapping("leaseBuilding")
  50. public ResponseMessage leaseBuilding(String startTime, String endTime){
  51. return ResponseMessage.success("success", skyImageCountApiService.leaseBuilding(startTime, endTime));
  52. }
  53. }