package com.zt.plat.module.base.api.materialinfomation;

import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationPageReqDTO;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationRespDTO;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationSaveReqDTO;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationSimplePageReqDTO;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationSimpleRespDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 物料信息")
public interface MaterialInfomationApi {

    String PREFIX = ApiConstants.PREFIX + "/base/material-infomation";

/*
    @PostMapping(PREFIX + "/create")
    @Operation(summary = "创建物料信息")
    CommonResult<MaterialInfomationRespDTO> createMaterialInfomation(@Valid @RequestBody MaterialInfomationSaveReqDTO createReqDTO);
*/

    @PutMapping(PREFIX + "/update")
    @Operation(summary = "更新物料信息")
    CommonResult<Boolean> updateMaterialInfomation(@Valid @RequestBody MaterialInfomationSaveReqDTO updateReqDTO);

    @DeleteMapping(PREFIX + "/delete")
    @Operation(summary = "删除物料信息")
    CommonResult<Boolean> deleteMaterialInfomation(@RequestParam("id") Long id);

    @DeleteMapping(PREFIX + "/delete-list")
    @Operation(summary = "批量删除物料信息")
    CommonResult<Boolean> deleteMaterialInfomationList(@RequestBody List<Long> ids);

    @GetMapping(PREFIX + "/get")
    @Operation(summary = "获得物料信息")
    CommonResult<MaterialInfomationRespDTO> getMaterialInfomation(@RequestParam("id") Long id);

    @GetMapping(PREFIX + "/list-by-ids")
    @Operation(summary = "按 ID 批量获得物料信息")
    CommonResult<List<MaterialInfomationRespDTO>> getMaterialInfomationListByIds(@RequestParam("ids") List<Long> ids);

    @PostMapping(PREFIX + "/page")
    @Operation(summary = "获得物料信息分页")
    CommonResult<PageResult<MaterialInfomationRespDTO>> getMaterialInfomationPage(@Valid @RequestBody MaterialInfomationPageReqDTO pageReqDTO);

    @PostMapping(PREFIX + "/simple-page")
    @Operation(summary = "获得物料信息精简分页")
    CommonResult<PageResult<MaterialInfomationSimpleRespDTO>> getMaterialInfomationSimplePage(@Valid @RequestBody MaterialInfomationSimplePageReqDTO pageReqDTO);
}