CityController.java 913 B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.nokia.controller;
  2. import java.util.List;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.web.bind.annotation.PostMapping;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.ResponseBody;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import com.nokia.common.R;
  9. import com.nokia.pojo.City;
  10. import com.nokia.service.CityService;
  11. /*
  12. * 已弃用代码
  13. */
  14. @Deprecated
  15. @RestController
  16. @RequestMapping("rest/api/city")
  17. public class CityController {
  18. private final CityService cityServiceimpl;
  19. @Autowired
  20. public CityController(CityService cityServiceimpl) {
  21. this.cityServiceimpl = cityServiceimpl;
  22. }
  23. @PostMapping("list")
  24. @ResponseBody
  25. public R list() {
  26. List<City> cities = cityServiceimpl.list();
  27. return R.ok().data(cities);
  28. }
  29. }