package com.agileboot.system.client.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.agileboot.system.client.entity.SysClient;
import com.agileboot.system.client.mapper.SysClientMapper;
import com.agileboot.system.client.service.ISysClientService;
import com.agileboot.system.client.vo.SysClientVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysClientServiceImpl extends ServiceImpl<SysClientMapper, SysClient> implements ISysClientService {
    @Override
    public SysClientVO queryByClientId(Long clientId) {
        SysClient client = super.baseMapper.selectOne(new LambdaQueryWrapper<SysClient>().eq(SysClient::getId, clientId));
        return BeanUtil.copyProperties(client, SysClientVO.class);
    }

    @Override
    public List<SysClient> list() {
        return super.list();
    }
}
