package com.qmth.qrzk.web.controller;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.qmth.qrzk.dao.repositories.ProvinceRepo;
import com.qmth.qrzk.supplypaper.model.Province;
import com.qmth.qrzk.supplypaper.service.SupplyService;

/**
 * 供卷省份
 * @author zhengmin
 *
 */
@RestController
@RequestMapping("province")
public class SupplyProvController {

	@Autowired private ProvinceRepo provRepo;
	@Autowired private SupplyService supplySrv;
	
	@RequestMapping
	public Collection<Province> index(){
		return provRepo.findAll();
	}
	@RequestMapping(method=RequestMethod.POST)
	public AjaxResponse save(@RequestBody Province prov){
		supplySrv.saveProvinceInfo(prov);
		return new AjaxResponse(true);
	}
}
