package com.fs.xiaoshouyi.service.impl;

import com.fs.xiaoshouyi.domain.XsyAccount;
import com.fs.xiaoshouyi.mapper.XsyAccountMapper;
import com.fs.xiaoshouyi.service.XiaoShouYiOAuthService;
import com.fs.xiaoshouyi.service.XsyAccountService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class XsyAccountServiceImpl implements XsyAccountService {

    private final XsyAccountMapper xsyAccountMapper;
    private final XiaoShouYiOAuthService oAuthService;

    @Override
    public List<XsyAccount> selectList(XsyAccount query) {
        return xsyAccountMapper.selectList(query);
    }

    @Override
    public List<XsyAccount> selectListByIds(List<Long> ids) {
        return xsyAccountMapper.selectListByIds(ids);
    }

    @Override
    public XsyAccount selectById(Long id) {
        return xsyAccountMapper.selectById(id);
    }

    @Override
    public int insert(XsyAccount account) {
        return xsyAccountMapper.insert(account);
    }

    @Override
    public int update(XsyAccount account) {
        return xsyAccountMapper.update(account);
    }

    @Override
    public int deleteById(Long id) {
        return xsyAccountMapper.deleteById(id);
    }

    @Override
    public String getAuthUrl(Long accountId) { return oAuthService.buildAuthUrl(accountId);
    }
}