package cn.novalon.gym.manage.member.repository;

import cn.novalon.gym.manage.member.entity.WechatUser;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono;

/**
 * 微信用户Repository
 * 
 * @author 付嘉
 * @date 2026-05-01
 */

@Repository
public interface WechatUserRepository extends R2dbcRepository<WechatUser, Long> {

    // 通过UnionID查询微信用户
    Mono<WechatUser> findByUnionId(String unionId);

    // 通过小程序OpenID查询微信用户
    Mono<WechatUser> findByMiniappOpenid(String miniappOpenid);

    // 通过服务号OpenID查询微信用户
    Mono<WechatUser> findByMpOpenid(String mpOpenid);

    // 通过会员ID查询微信用户
    Mono<WechatUser> findByMemberId(Long memberId);
}
