/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.seckill.comment.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.seckill.comment.dto.SeckillOrderMergerDto;
import com.yami.shop.seckill.comment.model.Seckill;
import com.yami.shop.seckill.comment.model.SeckillOrder;

/**
 * 秒杀订单
 *
 * @author LGH
 * @date 2019-08-28 09:36:59
 */
public interface SeckillOrderService extends IService<SeckillOrder> {

    /**
     * 将确认的的订单信息缓存起来
     * @param userId
     * @param dto
     * @return
     */
    SeckillOrderMergerDto putConfirmOrderCache(String userId , SeckillOrderMergerDto dto);

    /**
     * 获取缓存的确认订单信息
     * @param userId
     * @return
     */
    SeckillOrderMergerDto getConfirmOrderCache(String userId);

    /**
     * 移除确认的订单的缓存
     * @param userId
     */
    void removeConfirmOrderCache(String userId);

    /**
     * 提交订单返回订单号
     * @param dto
     * @return
     */
    String submit(SeckillOrderMergerDto dto);

    void checkOrderProdNum(Seckill seckill,String userId, int prodCount);

    void cancelOrderUnpayOrderByTime();

    void cancelUnpayOrderByOrderNumber(String orderNumber);

}
