package com.yem.wm.syn.eas.api.controller;

import com.yem.wm.syn.eas.api.dto.IntebilllogonAuditDTO;
import com.yem.wm.syn.eas.api.service.ICommonAuditService;
import com.yem.wm.syn.eas.api.service.IYZJAuditService;
import com.yem.wm.syn.eas.api.service.impl.CommonAuditServiceImpl;
import com.yem.wm.syn.eas.api.service.impl.YZJAuditServiceImpl;
import kd.bos.openapi.common.custom.annotation.ApiController;
import kd.bos.openapi.common.custom.annotation.ApiParam;
import kd.bos.openapi.common.custom.annotation.ApiPostMapping;
import kd.bos.openapi.common.result.CustomApiResult;
import org.jetbrains.annotations.NotNull;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.IOException;

@ApiController(value = "bos", desc = "")
public class CommonAuditController {
    @ApiPostMapping("/common/audit")
    public CustomApiResult<Object> easaudit(@NotNull @NotBlank @ApiParam(value = "编码",required = true) String number,@NotNull @NotBlank @ApiParam(value = "标识",required = true) String entityName,@ApiParam(value = "审核人编码") String auditor,@NotNull @ApiParam(value = "审批状态",required = true) Boolean status) throws IOException {
        try {
            ICommonAuditService service = new CommonAuditServiceImpl();
            service.addNew(number,entityName,auditor,status);
        } catch (Exception e) {
            CustomApiResult<Object> fail = CustomApiResult.fail("501", e.getMessage());
            return fail;
        }
        CustomApiResult<Object>
                success = CustomApiResult.success("成功");
        return success;
    }
}
