package cn.com.oa.controller;

import cn.com.v2.common.base.BaseController;
import cn.com.v2.common.domain.AjaxResult;
import cn.com.oa.model.Company;
import cn.com.oa.service.ICompanyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/company")
public class CompanyController extends BaseController {
    @Autowired
    private ICompanyService companyService;

    @ApiOperation(value = "获取公司数据", notes = "获取公司数据")
    @GetMapping("/getCompany")
    @ResponseBody
    public AjaxResult getCompany()
    {
        Company company = companyService.getCompany();
        if(company!=null) {
            return AjaxResult.successData(200,company).put("msg","获取成功");
        }
        return AjaxResult.successData(200, null).put("msg","无数据");
    }

}
