package com.aucma.dms.controller;


import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.dms.domain.DmsBillsFaultInstance;
import com.aucma.dms.domain.DmsBillsInspectInstance;
import com.aucma.dms.domain.DmsBillsLubeInstance;
import com.aucma.dms.domain.DmsRepairInstance;
import com.aucma.dms.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName : DmsApiController
 * @Description : zhouhy
 * @Author :
 * @Date: 2024-02-29 16:45
 */
@RestController
@RequestMapping("/dms/api")
public class DmsApiController extends BaseController {

    @Autowired
    private IDmsBillsFaultInstanceService dmsBillsFaultInstanceService;
    @Autowired
    private IDmsRepairInstanceService dmsRepairInstanceService;
    @Autowired
    private IDmsBillsInspectInstanceService dmsBillsInspectInstanceService;
    @Autowired
    private IDmsBillsMaintInstanceService dmsBillsMaintInstanceService;
    @Autowired
    private IDmsBillsLubeInstanceService dmsBillsLubeInstanceService;
//APS-MyPuRz3G6HfBYcH8dw7Y2ai1D6iZRmXX apifox令牌
    /**
     * PDA-报修

     * */
    @PostMapping("/PDAFault")
    @ResponseBody
    public AjaxResult PDAFault(@RequestBody DmsBillsFaultInstance dmsBillsFaultInstance){
    return toAjax(dmsBillsFaultInstanceService.insertDmsBillsFaultInstance(dmsBillsFaultInstance));
    }
    /**
     * PDA-检修
     * */
    @PostMapping("/PDARepair")
    @ResponseBody
    public AjaxResult PDARepair(@RequestBody DmsRepairInstance dmsRepairInstance){
        return toAjax(dmsRepairInstanceService.insertDmsRepairInstance(dmsRepairInstance));
    }

    /**
     * PDA-点巡检
     * */
    @PostMapping("/PDAInspect")
    @ResponseBody
    public AjaxResult PDAInspect(@RequestBody DmsBillsInspectInstance dmsBillsInspectInstance){
        return toAjax(dmsBillsInspectInstanceService.insertDmsBillsInspectInstance(dmsBillsInspectInstance));
    }
//    /**
//     * PDA-保养
//     * */
//    @PostMapping("/PDAMaint")
//    @ResponseBody
//    public AjaxResult PDAMaint(@RequestBody DmsBillsMaintInstance dmsBillsMaintInstance){
//        return toAjax(dmsBillsMaintInstanceService.insertDmsBillsMaintInstance(dmsBillsMaintInstance));
//    }
    /**
     * PDA-润滑
     * */
    @PostMapping("/PDALube")
    @ResponseBody
    public AjaxResult PDALube(@RequestBody DmsBillsLubeInstance dmsBillsLubeInstance){
        return toAjax(dmsBillsLubeInstanceService.insertDmsBillsLubeInstance(dmsBillsLubeInstance));
    }
}
