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.WallDao;
import io.modules.item.dto.BookDTO;
import io.modules.item.entity.BookEntity;
import io.modules.item.service.BookService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service
public class BookServiceImpl extends CrudServiceImpl<WallDao, BookEntity, BookDTO> implements BookService {

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

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

        return wrapper;
    }


}
