package com.ruoyi.web.project.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.yanzhu.jh.project.domain.SurProjectChecking;
import com.yanzhu.jh.project.service.ISurProjectCheckingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version : V1.0
 * @ClassName: ProjectCheckingController
 * @Description: 项目举牌验收
 * @Auther: JiangYuQi
 * @Date: 2020/7/7 18:03
 */
@RestController
@RequestMapping("/wechat/projectchecking")
public class ProjectCheckingController extends BaseController {

    @Autowired
    ISurProjectCheckingService surProjectCheckingService;

    /**
     * 查询当前用户举牌验收项目列表
     * @param surProjectChecking
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list(SurProjectChecking surProjectChecking){
        return success(surProjectCheckingService.selectSurProjectCheckingList(surProjectChecking));
    }

    /**
     * 查询举牌验收详情
     * @param id
     * @return
     */
    @GetMapping("/info")
    public AjaxResult info(Long id){
        return success(surProjectCheckingService.selectSurProjectCheckingById(id));
    }

    /**
     * 新增举牌验收
     * @param surProjectChecking
     * @return
     */
    @PostMapping("/add")
    @Log(title = "举牌验收", businessType = BusinessType.INSERT)
    public AjaxResult add(@RequestBody SurProjectChecking surProjectChecking){
        return success(surProjectCheckingService.insertSurProjectChecking(surProjectChecking));
    }

    /**
     * 删除举牌验收
     */
    @Log(title = "举牌验收", businessType = BusinessType.DELETE)
    @GetMapping("/remove")
    public AjaxResult remove(@RequestParam Long id)
    {
        return toAjax(surProjectCheckingService.deleteSurProjectCheckingById(id));
    }

}
