package cn.novalon.gym.manage.sys.core.repository;

import cn.novalon.gym.manage.sys.core.domain.SysConfig;
import org.springframework.data.domain.Sort;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * 系统配置仓储接口
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public interface ISysConfigRepository {

    Mono<SysConfig> findById(Long id);

    Mono<SysConfig> findByConfigKeyAndDeletedAtIsNull(String configKey);

    Flux<SysConfig> findByDeletedAtIsNull();

    Flux<SysConfig> findAll();

    Flux<SysConfig> findAll(Sort sort);

    Mono<SysConfig> save(SysConfig config);

    Mono<Void> deleteByIdAndDeletedAtIsNull(Long id);

    Mono<Long> count();

    Mono<Boolean> existsByConfigKey(String configKey);
}