package cn.iocoder.yudao.module.chain.api.operatedetail;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.chain.api.operatedetail.dto.OperateDetailSaveReqDTO;
import cn.iocoder.yudao.module.chain.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Api(tags = "RPC 服务 - 区块上链操作具体上链信息")
public interface OperateDetailApi {

    String PREFIX = ApiConstants.PREFIX + "/operate-detail";

    @PostMapping(PREFIX + "/createOperateDetailBatch")
    @ApiOperation("批量新增区块上链操作具体上链信息")
    @OperateLog(enable = false) // 不记录操作日志
    CommonResult<List<Long>> createOperateDetailBatch(@Valid @RequestBody List<OperateDetailSaveReqDTO> operateDetails);


    @DeleteMapping(PREFIX + "/deleteOperateDetailBatch")
    @ApiOperation("批量删除区块上链操作具体上链信息")
    @ApiImplicitParam(name = "ids", value = "id集合", required = true, dataTypeClass = List.class)
    @OperateLog(enable = false) // 不记录操作日志
    CommonResult<Boolean> deleteOperateDetailBatch(@RequestParam("ids") List<Long> ids);
}
