package com.sooka.module.web.cms.service.impl;

import com.github.pagehelper.PageInfo;
import com.sooka.module.web.cms.service.VoteLogService;
import com.sooka.mybatis.mapper.TCmsVoteLogMapper;
import com.sooka.mybatis.model.TCmsVoteLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VoteLogServiceImpl implements VoteLogService {

    @Autowired
    private TCmsVoteLogMapper cmsVoteLogMapper;

    @Override
    public Integer checkIp(String  IP) {
        TCmsVoteLog s  =cmsVoteLogMapper.checkIP(IP);
        if(null!=s){
            return 1;
        }
        return 0;
    }

    @Override
    public Integer checkContent(String IP,Integer vote_id) {
        TCmsVoteLog s  =cmsVoteLogMapper.checkIP(IP);
        if(null!=s){
            return 1;
        }
        return 0;
    }

    @Override
    public TCmsVoteLog findByIP(String IP) {
        return cmsVoteLogMapper.findByIP(IP);
    }

    @Override
    public String save(TCmsVoteLog pojo) {
        return ""+cmsVoteLogMapper.insert(pojo);
    }

    @Override
    public String update(TCmsVoteLog pojo) {
        return ""+cmsVoteLogMapper.updateByPrimaryKey(pojo);
    }

    @Override
    public String delete(Integer[] ids) {
        return null;
    }

    @Override
    public TCmsVoteLog findById(Integer id) {
        return null;
    }

    @Override
    public List<TCmsVoteLog> findList(TCmsVoteLog pojo) {
        return null;
    }

    @Override
    public List<TCmsVoteLog> findAll() {
        return null;
    }

    @Override
    public PageInfo<TCmsVoteLog> page(Integer pageNumber, Integer pageSize, TCmsVoteLog pojo) {
        return null;
    }

    @Override
    public PageInfo<TCmsVoteLog> page(Integer pageNumber, Integer pageSize) {
        return null;
    }
}
