package com.supplier.service.impl;

import com.supplier.mapper.PersonalMapper;
import com.supplier.model.Supplier;
import com.supplier.service.PersonalServce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PersonalServiceImpl implements PersonalServce {

    @Autowired
    private PersonalMapper personalMapper;

    @Override
    public Supplier getPresonalMessage(String code) {
        return personalMapper.getPresonalMessage(code);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updatePhone(Supplier supplier) {
        personalMapper.updatePhone(supplier);
    }

    @Override
    public int checkCaptcha(Supplier supplier) {
        return personalMapper.checkCaptcha(supplier);
    }
}
