package com.sqx.modules.resumes.controller;

import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.resumes.entity.ShieldCompany;
import com.sqx.modules.resumes.service.ShieldCompanyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@Api(value = "屏蔽公司", tags = {"屏蔽公司"})
@RequestMapping(value = "/shieldCompany")
public class ShieldCompanyController {

    @Autowired
    private ShieldCompanyService shieldCompanyService;

    @PostMapping("/insertShieldCompany")
    @ApiOperation("添加屏蔽公司")
    public Result insertShieldCompany(@RequestBody ShieldCompany shieldCompany){
        shieldCompany.setCreateTime(DateUtils.format(new Date()));
        shieldCompanyService.save(shieldCompany);
        return Result.success();
    }

    @PostMapping("/deleteShieldCompany")
    @ApiOperation("解除屏蔽公司")
    public Result deleteShieldCompany(Long shieldCompanyId){
        shieldCompanyService.removeById(shieldCompanyId);
        return Result.success();
    }

    @GetMapping("/selectShieldList")
    @ApiOperation("查询屏蔽列表")
    public Result selectShieldList(Integer page,Integer limit,Long userId,Long companyId){
        return shieldCompanyService.selectShieldList(page, limit, userId, companyId);
    }




}
