package com.house365.wechat.rest;

import com.house365.beans.vo.Department;
import com.house365.common.searchBeans.CommonSearchResponse;
import com.house365.common.searchBeans.QueryParams;
import com.house365.service.impl.DepartmentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Date: 2016/12/13</p>
 *
 * @author XN
 * @version 1.0
 */
@RestController
@RequestMapping("department")
public class DepartmentController {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public CommonSearchResponse<Department> list(@RequestBody QueryParams queryParams) {
        return departmentService.queryByPage(queryParams);
    }
}
