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

import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.base.api.materialhasclasses.dto.MaterialHasClassesPageReqDTO;
import com.zt.plat.module.base.api.materialhasclasses.dto.MaterialHasClassesRespDTO;
import com.zt.plat.module.base.api.materialhasclasses.dto.MaterialHasClassesSaveReqDTO;
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 MaterialHasClassesApi {

    String PREFIX = ApiConstants.PREFIX + "/material-has-classes";

    @PostMapping(PREFIX + "/create")
    @Operation(summary = "创建物料持有分类")
    CommonResult<MaterialHasClassesRespDTO> createMaterialHasClasses(@Valid @RequestBody MaterialHasClassesSaveReqDTO createReqDTO);

    @PutMapping(PREFIX + "/update")
    @Operation(summary = "更新物料持有分类")
    CommonResult<Boolean> updateMaterialHasClasses(@Valid @RequestBody MaterialHasClassesSaveReqDTO updateReqDTO);

    @DeleteMapping(PREFIX + "/delete")
    @Operation(summary = "删除物料持有分类")
    CommonResult<Boolean> deleteMaterialHasClasses(@RequestParam("id") Long id);

    @DeleteMapping(PREFIX + "/delete-list")
    @Operation(summary = "批量删除物料持有分类")
    CommonResult<Boolean> deleteMaterialHasClassesList(@RequestBody List<Long> ids);

    @GetMapping(PREFIX + "/get")
    @Operation(summary = "获得物料持有分类")
    CommonResult<MaterialHasClassesRespDTO> getMaterialHasClasses(@RequestParam("id") Long id);

    @PostMapping(PREFIX + "/page")
    @Operation(summary = "获得物料持有分类分页")
    CommonResult<PageResult<MaterialHasClassesRespDTO>> getMaterialHasClassesPage(@Valid @RequestBody MaterialHasClassesPageReqDTO pageReqDTO);
}
