package com.sysu.admin.support.system.config;

import com.sysu.admin.support.base.BaseService;
import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shu hao
 * @description:
 * @date 2022/4/1 14:26
 */
@Service
public class SConfigService extends BaseService<SConfig, String> {

    @Autowired
    SConfigRepository mSConfigRepository;

    public String getV(String key){
        SConfig config = mSConfigRepository.get(key);
        if(config == null){
            return "";
        }
        return config.getV();
    }

    @Override
    public JpaPlusRepository<SConfig, String> r() {
        return mSConfigRepository;
    }

    public SConfig get(String k){
        return mSConfigRepository.get(k);
    }

    public void set(String k, String v){
         mSConfigRepository.set(k,v);
    }
}
