package com.ho.business.service.impl;

import com.ho.business.service.BusinessTestService;
import com.ho.user.api.vo.req.QueryDeptReqVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author fancl
 * @desc:
 * @date 2023/2/20
 */
@Service
@Slf4j
public class BusinessTestServiceImpl implements BusinessTestService {

    @Override
    @Cacheable(cacheManager = "towMinuteCacheManager",value = "dept",key = "#queryDeptReqVO.deptId",sync = true)
    public String getFromCaffeine(QueryDeptReqVO queryDeptReqVO) {


        System.out.println("从数据库中读取");

        return "缓存数据";
    }


    @Override
    //@Cacheable(value = "dept")
    public String getFromCaffeineParam(String p1, String p2) {


        System.out.println("从数据库中读取");

        return "缓存数据";
    }

}
