package com.nokia.controller;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.nokia.common.R;
import com.nokia.pojo.City;
import com.nokia.service.CityService;

/*
 * 已弃用代码
 */
@Deprecated
@RestController
@RequestMapping("rest/api/city")
public class CityController {

    private final CityService cityServiceimpl;

    @Autowired
    public CityController(CityService cityServiceimpl) {
        this.cityServiceimpl = cityServiceimpl;
    }

    @PostMapping("list")
    @ResponseBody
    public R list() {
        List<City> cities = cityServiceimpl.list();
        return R.ok().data(cities);
    }
}
