package com.rf.psychological.user.service.impl;

import com.rf.psychological.user.dao.model.OpenIdEntity;
import com.rf.psychological.user.dao.repository.OpenidRepository;
import com.rf.psychological.user.service.OpenidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author:zzf
 * @Date:2022/8/19:10:51
 * @Description:
 */
@Service
public class OpenServiceImpl implements OpenidService {

    @Autowired
    private OpenidRepository repository;
    @Override
    public OpenIdEntity findByUserIdAndOpenId(String userid, String openId) {
        return this.repository.findByUserIdAndOpenId(userid,openId);
    }

    @Override
    public OpenIdEntity save(OpenIdEntity openIdEntity) {
        return this.repository.save(openIdEntity);
    }

    @Override
    public OpenIdEntity findByUserId(String userId) {
        return this.repository.findByUserId(userId);
    }

    @Override
    public OpenIdEntity findByPhone(String phone) {
        return this.repository.findByPhone(phone);
    }
}
