package cn.superdesk.uniorder.controller.operationCenter.base;


import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dto.vo.operationCenter.base.OperationCenterVo;
import cn.superdesk.uniorder.dubbo.consumer.operationCenter.base.OperationCenterBaseDubboService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author : zx
 * @Create : 2023/3/28 10:46
 * Description : 主要是为了给前端提供检索映射-运营中心1.0 数据同步
 */
@Slf4j
@RestController
@RequestMapping("/operationCenter/base")
@RequiredArgsConstructor
public class OperationCenterBaseController {

    private final OperationCenterBaseDubboService operationCenterBaseDubboService;

    /**
     *业务平台
     */
    @PostMapping("/platform")
    @ResponseBody
    public R<List<OperationCenterVo>> getPlatformCode() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> platformCode = operationCenterBaseDubboService.getPlatformCode();
        result.setData(platformCode);
        return result;
    }
    /**
     *订单类型
     */
    @PostMapping("/orderType")
    @ResponseBody
    public R<List<OperationCenterVo>> getOrderType() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> orderTypeCode = operationCenterBaseDubboService.getOrderType();
        result.setData(orderTypeCode);
        return result;
    }

    /**
     *业务类型
     */
    @PostMapping("/orderBizType")
    @ResponseBody
    public R<List<OperationCenterVo>> getOrderBizType() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> orderBizTypeCode = operationCenterBaseDubboService.getOrderBizType();
        result.setData(orderBizTypeCode);
        return result;
    }

    /**
     *支付状态
     */
    @PostMapping("/orderPayStatus")
    @ResponseBody
    public R<List<OperationCenterVo>> getOrderPayStatus() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> orderPayStatus = operationCenterBaseDubboService.getOrderPayStatus();
        result.setData(orderPayStatus);
        return result;
    }
    /**
     *平台支付方式
     */
    @PostMapping("/payMethod")
    @ResponseBody
    public R<List<OperationCenterVo>> paymentMethod() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> paymentMethod = operationCenterBaseDubboService.getPaymentByOperatorId();
        result.setData(paymentMethod);
        return result;
    }
    /**
     *交易状态
     */
    @PostMapping("/transactionStatus")
    @ResponseBody
    public R<List<OperationCenterVo>> getTransactionStatus() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> transactionStatus = operationCenterBaseDubboService.getTransactionStatus();
        result.setData(transactionStatus);
        return result;
    }
    /**
     *售后状态 OpCenterPlatformAftersaleStatusEnum
     */
    @PostMapping("/afterSaleStatus")
    @ResponseBody
    public R<List<OperationCenterVo>> getAfterSaleStatus() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> afterSaleStatus = operationCenterBaseDubboService.getAfterSaleStatus();
        result.setData(afterSaleStatus);
        return result;
    }
    /**
     *售后类型  OpCenterPlatformAftersaleTypeEnum
     */
    @PostMapping("/afterSaleType")
    @ResponseBody
    public R<List<OperationCenterVo>> getAfterSaleType() {
        R<List<OperationCenterVo>> result = new R<>();
        List<OperationCenterVo> afterSaleType = operationCenterBaseDubboService.getAfterSaleType();
        result.setData(afterSaleType);
        return result;
    }
}
