package com.dayou.controller;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RestController;
import com.dayou.controller.BaseController;
import com.dayou.service.IItemStageUserService;
import com.dayou.entity.ItemStageUser;
import com.dayou.common.RestResponse;
import org.springframework.web.bind.annotation.*;
import com.dayou.utils.ConvertUtil;
import com.dayou.utils.HttpKit;
import com.dayou.exception.ErrorCode;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.http.MediaType;
import org.springframework.web.multipart.MultipartFile;
/**
 * 项目人员阶段参与表
 *
 * @author wucl
 * @since 2023-03-03
 */
@RestController
@RequestMapping("itemStageUser")
@Slf4j
public class ItemStageUserController extends BaseController {
    @Autowired
    private IItemStageUserService itemStageUserService;

    /**
    * 项目人员阶段参与表列表
    */
    @GetMapping("")
    public RestResponse<Page<ItemStageUser>> page(ItemStageUser itemStageUser, Page page){
        Page<ItemStageUser> pages=itemStageUserService.selectPage(page,itemStageUser);
        return RestResponse.data(pages);
    }

    /**
     * 项目人员阶段参与表详情
     */
    @GetMapping("/{id}")
    public RestResponse<ItemStageUser> detail(@PathVariable Long id){
        ItemStageUser xItemStageUser =itemStageUserService.detail(id);
        return RestResponse.data(xItemStageUser);
     }

    /**
     * 项目人员阶段参与表新增
     */
    @PostMapping("")
    public RestResponse<Boolean> save(@RequestBody ItemStageUser itemStageUser) {
        Boolean ret = itemStageUserService.add(itemStageUser);
        return RestResponse.data(ret);
    }

    /**
     * 项目人员阶段参与表更新
     */
    @PutMapping("")
    public RestResponse<Boolean> update(@RequestBody ItemStageUser itemStageUser) {
        Boolean ret = itemStageUserService.update(itemStageUser);
        return RestResponse.data(ret);
    }

    /**
     * 项目人员阶段参与表删除
     */
    @DeleteMapping("/{id}")
    public RestResponse<Boolean> delete(@PathVariable Long id) {
        Boolean ret = itemStageUserService.delete(id);
        return RestResponse.data(ret);
    }


}

