package com.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.service.impl.DomainServiceImpl;
import com.vo.DomainVo;
@Controller
public class DomainController {
@Autowired
private DomainServiceImpl domainServiceImpl;
@RequestMapping("/findProvice")
public void findProvice(HttpServletResponse response) throws IOException{
List<DomainVo>list=domainServiceImpl.findProvince();
JSONArray arr=JSONArray.fromObject(list);
response.getWriter().print(arr.toString());
}
@RequestMapping("/findCityByPid")
public void findCityByPid(Integer pId,HttpServletResponse response) throws IOException{
if(pId==null){
}else{
List<DomainVo>list=domainServiceImpl.findCityByPid(pId);
JSONArray arr=JSONArray.fromObject(list);
response.getWriter().print(arr.toString());
}
}
@RequestMapping("/findAreaByCid")
public void findAreaByCid(Integer cId,HttpServletResponse response) throws IOException{
if(cId==null){
}else{
List<DomainVo>list=domainServiceImpl.findAreaByCid(cId);
JSONArray arr=JSONArray.fromObject(list);
response.getWriter().print(arr.toString());
}
}
}