package com.yami.shop.platform.controller.smqjh;

import com.yami.shop.bean.vo.xsb.RefundOrderPushVo;
import com.yami.shop.common.util.R;
import com.yami.shop.service.xsb.XSBRefundOrderService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
@RequestMapping("/platform/smqjh/refund")
@AllArgsConstructor
@Log4j2
public class SMQJHRefundOrderController {

    private final XSBRefundOrderService xsbRefundOrderService;

    @PostMapping("/applyAfterSales")
    public R<String> applyAfterSales(@RequestBody RefundOrderPushVo refundOrderPushVo) {
        String logId = UUID.randomUUID().toString();
        log.info("[{}] receive smqjh refund apply request: {}", logId, refundOrderPushVo);
        return xsbRefundOrderService.applySmqjhAfterSales(refundOrderPushVo, logId);
    }
}
