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.FrontUserDao;
import io.modules.item.dto.UserDTO;
import io.modules.item.entity.FrontUserEntity;
import io.modules.item.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 用户
 */
@Service
public class FrontUserServiceImpl extends CrudServiceImpl<FrontUserDao, FrontUserEntity, UserDTO> implements UserService {

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

        QueryWrapper<FrontUserEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
        wrapper.eq(StrUtil.isNotBlank(username), "username", username);
        return wrapper;
    }


}
