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


import com.rf.psychological.scale.dao.model.ScaleDetailsEntity;
import com.rf.psychological.scale.dao.repository.ScaleDetailsRepository;
import com.rf.psychological.scale.service.ScaleDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author zsy
 * @description:量表类别信息管理
 * @date 2021/6/17 15:55
 */
@Service
public class ScaleDetailsServiceImpl implements ScaleDetailsService {

    @Autowired
    private ScaleDetailsRepository scaleDetailsRepository;

    @Override
    @Cacheable(value = "detail", key = "#flag",unless = "#result == null ")
    public ScaleDetailsEntity getSubjectDetailsByFlag(String flag) {
        return this.scaleDetailsRepository.getSubjectDetailsByFlag(flag);
    }

}
