package com.yn.bftl.thirdparty.common.service.impl;


import com.yn.bftl.common.modules.order.enums.PushEnum;
import com.yn.bftl.thirdparty.common.service.PushMessageCustomerService;
import com.yn.bftl.thirdparty.common.service.PushService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: mingwei
 * @Date:2021/12/6
 * @Description:
 */
@Service
public class PushServiceImpl implements PushService {

    @Resource
    PushMessageCustomerService pushMessageCustomerService;

    @Override
    public String pushMessage(Long id, PushEnum pushEnum) {

       String s=null;
        if (pushEnum.equals(PushEnum.EVALUATE_PUSH)){
            //订单评价提醒
            s= pushMessageCustomerService.evaluatePush(id);
        }
        if (pushEnum.equals(PushEnum.RETURN_PUSH)){
            s=pushMessageCustomerService.returnPush(id);
        }
        if (pushEnum.equals(PushEnum.PICK_PUSH)){
            s=pushMessageCustomerService.pickPush(id);
        }
        if (pushEnum.equals(PushEnum.TO_PAY_PUSH)){
            //待支付消息推送
            s=pushMessageCustomerService.push(id);
        }
        if (pushEnum.equals(PushEnum.DELIVER_PUSH)){
            //订单发货提醒
           s= pushMessageCustomerService.deliverPush(id);
        }
        if (pushEnum.equals(PushEnum.REFUND_PUSH)){
            //订单退款通知
            s=pushMessageCustomerService.refundPush(id);
        }
        if (pushEnum.equals(PushEnum.TO_DELIVER_PUSH)){
          s=  pushMessageCustomerService.toDeliverPush(id);
        }

        return s;
    }
}
