package com.cpop.oam.business.controller.backstage;

import com.cpop.core.base.entity.R;
import com.cpop.oam.business.bo.PutOffAuditBo;
import com.cpop.oam.business.service.CluePutOffService;
import com.cpop.oam.business.vo.PutOffAuditPageVo;
import com.mybatisflex.core.paginate.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author DB
 * @version 1.0.0
 * @since 2024-02-21 13:40
 */
@Tag(name = "延期审核接口")
@RestController
@RequestMapping("/backstage/putOff")
public class BackstagePutOffController {

    @Autowired
    private CluePutOffService cluePutOffService;

    /**
     * 延期审核分页
     * @author DB
     * @since 2024/2/19
     * @return R<Page<SignGoalPageVo>>
     */
    @Operation(summary = "延期审核分页")
    @GetMapping("/getPutOffAuditPage")
    public R<Page<PutOffAuditPageVo>> getPutOffAuditPage() {
        Page<PutOffAuditPageVo> pageVo = cluePutOffService.getPutOffAuditPage();
        return R.ok(pageVo);
    }

    /**
     * 延期审核选择
     * @author DB
     * @since 2024/2/21
     * @param bo 通过与驳回
     * @return R<Void>
     */
    @Operation(summary = "延期审核选择")
    @PutMapping("/putOffAuditSelect")
    public R<Void> putOffAuditSelect(@RequestBody @Validated PutOffAuditBo bo) {
        cluePutOffService.putOffAuditSelect(bo);
        return R.ok();
    }
}
