package com.sckw.company.controller;

import com.sckw.company.entity.req.KwBusinessCompanyListReq;
import com.sckw.company.entity.req.KwBusinessDeptListReq;
import com.sckw.company.entity.res.KwBusinessCompanyListRes;
import com.sckw.company.entity.res.KwBusinessDeptListRes;
import com.sckw.company.service.CompanyService;
import com.sckw.core.model.page.PageRes;
import com.sckw.core.web.response.HttpResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc:
 * @author: Lt
 * @date: 2024-05-06
 */
@RestController
@RequestMapping("/company")
public class CompanyController {

    @Autowired
    CompanyService companyService;

    @PostMapping("/findList")
    public HttpResult companyList(@RequestBody(required = false) KwBusinessCompanyListReq params)
    {
        PageRes<KwBusinessCompanyListRes> list = companyService.findList(params);
        return HttpResult.ok(list);
    }

    @PostMapping("/deptList")
    public HttpResult deptList(@RequestBody(required = false) KwBusinessDeptListReq params)
    {
        PageRes<KwBusinessDeptListRes> list = companyService.deptList(params);
        return HttpResult.ok(list);
    }

}
