package com.dgtis.dorm.manager.wx.web;

import java.util.List;

import com.dgtis.dorm.manager.db.domain.AlumniRegion;
import com.dgtis.dorm.manager.db.service.AlumniRegionService;
import com.dgtis.dorm.manager.db.util.ResponseUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/region")
public class WxRegionController {
    private final Log logger = LogFactory.getLog(WxRegionController.class);

    @Autowired
    private AlumniRegionService regionService;

    @RequestMapping("list")
    public Object list(Integer pid) {
        if(pid == null){
            return ResponseUtil.fail402();
        }

        List<AlumniRegion> regionList = regionService.queryByPid(pid);
        return ResponseUtil.ok(regionList);
    }


}
