package com.sptg.permissions.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.permissions.api.entity.SmsTemplate;
import com.sptg.permissions.biz.mapper.SmsTemplateMapper;
import com.sptg.permissions.biz.service.SmsTemplateServiceInterface;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author zwx
 * @create 2020/11/2 15:22
 */
@Service
@RequiredArgsConstructor
public class SmsTemplateServiceImpl extends ServiceImpl<SmsTemplateMapper, SmsTemplate> implements SmsTemplateServiceInterface {

    @Override
    public SmsTemplate getByCode(String code) {
        Wrapper<SmsTemplate> wrapper = new EntityWrapper<>();
        wrapper.eq("s_code", code);
        return this.selectOne(wrapper);
    }
}
