
package com.tmerclub.cloud.multishop.service.impl;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.util.PageUtil;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.multishop.dto.AuditingInfoDTO;
import com.tmerclub.cloud.multishop.mapper.ShopAuditingMapper;
import com.tmerclub.cloud.multishop.model.ShopAuditing;
import com.tmerclub.cloud.multishop.service.ShopAuditingService;
import com.tmerclub.cloud.multishop.vo.ShopAuditingInfoVO;
import com.tmerclub.cloud.multishop.vo.ShopAuditingVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商家审核信息
 *
 * @author YXF
 * @date 2021-02-01 17:10:35
 */
@Service
public class ShopAuditingServiceImpl implements ShopAuditingService {

    @Autowired
    private ShopAuditingMapper shopAuditingMapper;

    @Override
    public PageVO<ShopAuditingVO> page(PageDTO pageDTO) {
        return PageUtil.doPage(pageDTO, () -> shopAuditingMapper.list());
    }

    @Override
    public ShopAuditingVO getByShopAuditingId(Long shopAuditingId) {
        return shopAuditingMapper.getByShopAuditingId(shopAuditingId);
    }

    @Override
    public void save(ShopAuditing shopAuditing) {
        shopAuditingMapper.save(shopAuditing);
    }

    @Override
    public void update(ShopAuditing shopAuditing) {
        shopAuditingMapper.update(shopAuditing);
    }

    @Override
    public void deleteById(Long shopAuditingId) {
        shopAuditingMapper.deleteById(shopAuditingId);
    }

    @Override
    public ShopAuditingVO getByshopId(Long shopId) {
        return shopAuditingMapper.getByshopId(shopId);
    }

    @Override
    public PageVO<ShopAuditingInfoVO> auditingInfoPage(PageDTO pageDTO, AuditingInfoDTO auditingInfoDTO) {
        return PageUtil.doPage(pageDTO, () -> shopAuditingMapper.auditingInfoList(auditingInfoDTO));
    }

    @Override
    public void updateToFail(List<Long> shopIds) {
        shopAuditingMapper.updateToFail(shopIds);
    }

}
