package com.cdm.module.trade.service.aftersale;

import com.cdm.module.trade.convert.aftersale.AfterSaleLogConvert;
import com.cdm.module.trade.dal.dataobject.aftersale.AfterSaleLogDO;
import com.cdm.module.trade.dal.mysql.aftersale.AfterSaleLogMapper;
import com.cdm.module.trade.service.aftersale.bo.AfterSaleLogCreateReqBO;
import org.redisson.api.RedissonClient;
import org.redisson.client.RedisClient;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.util.List;

/**
 * 交易售后日志 Service 实现类
 *
 * @author 芋道源码
 */
@Service
@Validated
public class AfterSaleLogServiceImpl implements AfterSaleLogService {

    @Resource
    private AfterSaleLogMapper afterSaleLogMapper;
    @Resource
    private RedissonClient redisClient;

    @Override
    public void createAfterSaleLog(AfterSaleLogCreateReqBO createReqBO) {
        AfterSaleLogDO afterSaleLog = AfterSaleLogConvert.INSTANCE.convert(createReqBO);
        afterSaleLogMapper.insert(afterSaleLog);
    }

    @Override
    public List<AfterSaleLogDO> getAfterSaleLogList(Long afterSaleId) {
        return afterSaleLogMapper.selectListByAfterSaleId(afterSaleId);
    }

}
