package cn.com.ctop.crawler.modules.pangolin.service.impl;

import cn.com.ctop.common.module.utils.ResultMapUtils;
import cn.com.ctop.common.module.utils.StatusCode;
import cn.com.ctop.crawler.modules.pangolin.entity.PangolinChannel;
import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinChannelMapper;
import cn.com.ctop.crawler.modules.pangolin.service.PangolinChannelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PangolinChannelServiceImpl extends ServiceImpl<PangolinChannelMapper, PangolinChannel> implements PangolinChannelService {
    @Autowired
    private PangolinChannelMapper pangolinChannelMapper;
    @Override
    public Map<String, Object> getListByUserId(String userId) {
        Map<String,Object>result = new HashMap<>();
        List<PangolinChannel>channelList = pangolinChannelMapper.getListByUserId(userId);
        result.put("data",channelList);
        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
        return result;
    }
}
