package com.cm.manager.sms.service;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultList;
import com.cm.manager.sms.pojo.dtos.sms.SmsDTO;
import com.cm.manager.sms.pojo.vos.sms.SmsVO;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IVerificationCodeService
 * @Description: 验证码
 * @Author: WangGeng
 * @Date: 2020/3/4 7:44 下午
 * @Version: 1.0
 **/
public interface ISmsService {

    /**
     * 腾讯类别
     */
    String TENCENT_TYPE = "tencent";
    /**
     * 自定义类别
     */
    String CUSTOM_TYPE = "custom";

    /**
     * 新增短信
     *
     * @param smsVO
     * @return
     * @throws Exception
     */
    SuccessResult saveSms(SmsVO smsVO) throws Exception;

    /**
     * 新增短信(APP)
     *
     * @param token
     * @param smsVO
     * @return
     * @throws Exception
     */
    SuccessResult saveSmsByToken(String token, SmsVO smsVO) throws Exception;

    /**
     * 删除短信
     *
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeSms(String ids) throws RemoveException;

    /**
     * 删除短信(APP)
     *
     * @param token
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeSmsByToken(String token, String ids) throws RemoveException;

    /**
     * 修改短信
     *
     * @param smsId
     * @param smsVO
     * @return
     * @throws Exception
     */
    SuccessResult updateSms(String smsId, SmsVO smsVO) throws Exception;

    /**
     * 修改短信(APP)
     *
     * @param token
     * @param smsId
     * @param smsVO
     * @return
     * @throws Exception
     */
    SuccessResult updateSmsByToken(String token, String smsId, SmsVO smsVO) throws Exception;

    /**
     * 短信详情(通过ID)
     *
     * @param smsId
     * @return
     * @throws SearchException
     */
    SmsDTO getSmsById(String smsId) throws SearchException;

    /**
     * 短信列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<SmsDTO> listSms(Map<String, Object> params) throws SearchException;

    /**
     * 短信分页列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<SmsDTO>> listPageSms(ListPage page) throws SearchException;

    /**
     * 获取验证码
     *
     * @param phone
     * @return
     */
    SuccessResult saveVerificationCode(String phone) throws Exception;

    /**
     * 发送短信
     *
     * @param phone
     * @param content
     */
    void saveSms(String phone, String content) throws Exception;
}
