forked from kidgrow-microservices-platform

克 刘
2020-08-19 e6b115d138f3241ec3273ff4772a4e8f6725b79b
优化通过用户名从Cacheable中获取用户信息修改成直接获取
1 files modified
3 ■■■■ changed files
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-server/src/main/java/com/kidgrow/usercenter/controller/SysUserController.java 3 ●●●● patch | view | raw | blame | history
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-server/src/main/java/com/kidgrow/usercenter/controller/SysUserController.java
@@ -26,7 +26,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -87,7 +86,7 @@
     */
    @GetMapping(value = "/users/name/{username}")
    @ApiOperation(value = "根据用户名查询用户实体")
    @Cacheable(value = "user", key = "#username")
//    @Cacheable(value = "user", key = "#username")
    public SysUser selectByUsername(@PathVariable String username) {
        return appUserService.selectByUsername(username);
    }