Commit ebdc4af3 authored by 李德才's avatar 李德才

代码优化

parent a36b705e
......@@ -29,6 +29,9 @@ public class UserController extends Controller {
@Inject
UserService userService;
private static final String _INFO = "_INFO";
/**
* 获取用户信息
*/
......@@ -53,7 +56,7 @@ public class UserController extends Controller {
return ;
}
try {
Redis.use().hset(username+ "_INFO", "password", password);
Redis.use().hset(username+ _INFO, "password", password);
}catch (Exception e) {
e.printStackTrace();
}
......@@ -96,7 +99,7 @@ public class UserController extends Controller {
userAttr = userIterator.next();
userMap.put(userAttr.getKey().toString().trim().toLowerCase(), userAttr.getValue());
}
Redis.use().hmset(user.getUsername() + "_INFO", userMap);
Redis.use().hmset(user.getUsername() + _INFO, userMap);
} catch (Exception e) {
e.printStackTrace();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment