package com.yida.data.form.apply.controller;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.customForm.dto.apply.ApprovalRemindDTO;
import com.yida.data.customForm.vo.apply.ApprovalRemindInfoVO;
import com.yida.data.form.apply.service.CoreApprovalRemindService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;


/**
 * 审核提醒策略 Controller
 *
 * @author ZYJ
 * @date 2023/12/21
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/remind")
@Api(tags = "后台--审核提醒策略")
public class CoreApprovalRemindController {

    private final CoreApprovalRemindService coreApprovalRemindService;

    @ApiOperation("查询审核提醒策略详情")
    @GetMapping("/getApprovalRemindInfo")
    public ResultBean<ApprovalRemindInfoVO> getApprovalRemindInfo() {
        return ResultBean.buildSuccess(coreApprovalRemindService.getApprovalRemindInfo());
    }

    @ApiOperation(value = "保存审核提醒策略", consumes = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/saveApprovalRemind", consumes = MediaType.APPLICATION_JSON_VALUE)
    public ResultBean<String> saveApprovalRemind(@RequestBody ApprovalRemindDTO dto) {
        coreApprovalRemindService.saveApprovalRemind(dto);
        return ResultBean.buildSuccess();
    }
}
