
package com.tmerclub.cloud.order.controller.multishop;

import com.tmerclub.cloud.common.constant.SysTypeEnum;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.common.security.AuthUserContext;
import com.tmerclub.cloud.order.dto.OrderRefundInterventionDTO;
import com.tmerclub.cloud.order.service.OrderRefundInterventionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单退款介入记录信息
 *
 * @author tmerclub
 * @date 2023-08-25 10:45:35
 */
@RestController("multishopOrderRefundInterventionController")
@RequestMapping("/m/order_refund_intervention")
@Tag(name = "订单退款介入记录信息")
public class OrderRefundInterventionController {

    @Autowired
    private OrderRefundInterventionService orderRefundInterventionService;

    /**
     * 添加介入凭证
     */
    @PutMapping("/save_intervention_voucher")
    @Operation(summary = "添加介入凭证")
    public ServerResponseEntity<Void> savePlatormIntervertion(@RequestBody OrderRefundInterventionDTO orderRefundParam) {
        Long tenantId = AuthUserContext.get().getTenantId();
        orderRefundParam.setBizId(tenantId);
        orderRefundParam.setSysType(SysTypeEnum.MULTISHOP.value());
        orderRefundInterventionService.savePlatormIntervertion(orderRefundParam);
        return ServerResponseEntity.success();
    }
}
