TopUserSMSServiceImpl.java 1.51 KB
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.tiptimes.service.impl;

import com.tiptimes.dao.TopUserSMSDao;
import com.tiptimes.model.TopUserSMS;
import com.tiptimes.service.TopUserSMSService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TopUserSMSServiceImpl implements TopUserSMSService {
    @Autowired
    private TopUserSMSDao topUserSMSDao;

    public TopUserSMSServiceImpl() {
    }

    @Transactional
    public void saveTopUserSMS(TopUserSMS topUserSMS) {
        this.topUserSMSDao.saveTopUserSMS(topUserSMS);
    }

    @Transactional
    public void updateSMSState(String userTell, String userTellCode) {
        List<TopUserSMS> topUserSMS_list = this.topUserSMSDao.listTopUserSMSNumberByUserTellANDUserTellCode(userTell, userTellCode);
        if (topUserSMS_list.size() != 0) {
            this.topUserSMSDao.updateTopUserSMSByuserTell(userTell);
        }

    }

    public int getTopUserSMSNumberByUserTell(String userTell) {
        return this.topUserSMSDao.getTopUserSMSNumberByUserTell(userTell);
    }

    public TopUserSMS listTopUserSMSNumberByUserTell(String userTell) {
        List<TopUserSMS> topUserSMS_list = this.topUserSMSDao.listTopUserSMSNumberByUserTell(userTell);
        return topUserSMS_list.size() == 0 ? null : (TopUserSMS)topUserSMS_list.get(0);
    }
}