package io.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import io.modules.item.dao.AuditDao;
import io.modules.item.dto.AuditDTO;
import io.modules.item.entity.AuditEntity;
import io.modules.item.service.AuditService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 授权表
 *
 * @author Mark #
 * @since 1.0.0 2025-05-13
 */
@Service
public class AuditServiceImpl extends CrudServiceImpl<AuditDao, AuditEntity, AuditDTO> implements AuditService {

    @Override
    public QueryWrapper<AuditEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");
        String userId = (String)params.get("userId");
        QueryWrapper<AuditEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
        wrapper.eq(StrUtil.isNotBlank(userId), "user_id", userId);
        return wrapper;
    }


}