package com.chushang.inspection.work.controller;
import com.chushang.common.core.web.AjaxResult;
import com.chushang.common.log.annotation.SysLog;
import com.chushang.common.log.enums.BusinessType;
import com.chushang.inspection.project.dto.AuditDTO;
import com.chushang.inspection.project.service.WrkAuditService;
import com.chushang.inspection.work.service.WrkInfoAuditService;
import com.chushang.inspection.work.service.WrkInfoService;
import com.chushang.security.annotation.RequiresPermissions;
import lombok.extern.java.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
* 工单审核表(wrk_info_audit)表控制层
* 工单审核相关接口
* @author xxxxx
*/
@RestController
@RequestMapping("/wrk/audit")
public class WrkInfoAuditController {

    @Resource
    private WrkInfoService wrkInfoService;


    /**
     * 工单审核
     */
    @PostMapping ("/audit")
    @RequiresPermissions("wrk:info:audit")
    @SysLog(value = "工单审核", businessType = BusinessType.AUDIT)
    public AjaxResult audit(@Validated @RequestBody AuditDTO audit) {
        wrkInfoService.audit(audit);
        return AjaxResult.success();
    }
}
