package com.multictrl.modules.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.multictrl.common.service.impl.CrudServiceImpl;
import cn.hutool.core.util.StrUtil;
import com.multictrl.modules.business.dao.MediaFileDao;
import com.multictrl.modules.business.dto.MediaFileDTO;
import com.multictrl.modules.business.entity.MediaFileEntity;
import com.multictrl.modules.business.service.MediaFileService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 媒体资源
 *
 * @author Sdy
 * @since 1.0.0 2026-04-29
 */
@Service
public class MediaFileServiceImpl extends CrudServiceImpl<MediaFileDao, MediaFileEntity, MediaFileDTO> implements MediaFileService {

    @Override
    public QueryWrapper<MediaFileEntity> getWrapper(Map<String, Object> params) {
        String id = (String) params.get("id");

        QueryWrapper<MediaFileEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }

    @Override
    public MediaFileDao getDao() {
        return baseDao;
    }
}