package com.itheima.service.impl;

import com.itheima.dao.UserInfoDao;
import com.itheima.domain.UserInfo;
import com.itheima.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/*****
 * @Author: http://www.itheima.com
 * @Description: com.itheima.service.impl.UserInfoServiceImpl
 ****/
@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    private UserInfoDao userInfoDao;

    /***
     * 根据name获取用户信息
     */
    @Cacheable(value = "get",key = "'get:'+#p0")
    @Override
    public UserInfo get(String name) {
        UserInfo userInfo = userInfoDao.one(name);
        return userInfo;
    }
}
