Java Code Examples for cn.hutool.core.util.StrUtil#COLON

The following examples show how to use cn.hutool.core.util.StrUtil#COLON . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: YamiUserServiceImpl.java    From mall4j with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * 获取前端登陆的用户信息
 *
 * @param app
 * @param bizUserId openId
 * @return UserDetails
 * @throws UsernameNotFoundExceptionBase
 */
@Override
public YamiUser loadUserByAppIdAndBizUserId(App app, String bizUserId) {

	String cacheKey = app.value() + StrUtil.COLON + bizUserId;

	User user = userMapper.getUserByBizUserId(app.value(), bizUserId);
	if (user == null) {
		throw new UsernameNotFoundExceptionBase("无法获取用户信息");
	}
	String name = StrUtil.isBlank(user.getRealName()) ? user.getNickName() : user.getRealName();
	YamiUser yamiUser = new YamiUser(user.getUserId(), bizUserId, app.value(), user.getStatus() == 1);
	yamiUser.setName(name);
	yamiUser.setPic(user.getPic());

	return yamiUser;
}
 
Example 2
Source File: RedisLockAspect.java    From mall4j with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 将spel表达式转换为字符串
 * @param joinPoint 切点
 * @return redisKey
 */
private String getRedisKey(ProceedingJoinPoint joinPoint,String lockName,String spel) {
	Signature signature = joinPoint.getSignature();
	MethodSignature methodSignature = (MethodSignature) signature;
	Method targetMethod = methodSignature.getMethod();
	Object target = joinPoint.getTarget();
	Object[] arguments = joinPoint.getArgs();
	return REDISSON_LOCK_PREFIX + lockName + StrUtil.COLON + SpelUtil.parse(target,spel, targetMethod, arguments);
}
 
Example 3
Source File: UserController.java    From mall4j with GNU Affero General Public License v3.0 5 votes vote down vote up
@PutMapping("/setUserInfo")
  @ApiOperation(value="设置用户信息", notes="设置用户信息")
  public ResponseEntity<Void> setUserInfo(@RequestBody UserInfoParam userInfoParam) {
  	String userId = SecurityUtils.getUser().getUserId();
  	User user = new User();
  	user.setUserId(userId);
  	user.setPic(userInfoParam.getAvatarUrl());
  	user.setNickName(EmojiUtil.toAlias(userInfoParam.getNickName()));
  	userService.updateById(user);
String cacheKey = App.MINI.value() + StrUtil.COLON + SecurityUtils.getUser().getBizUserId();
cacheManagerUtil.evictCache("yami_user", cacheKey);
      return ResponseEntity.ok(null);
  }
 
Example 4
Source File: YamiUser.java    From mall4j with GNU Affero General Public License v3.0 4 votes vote down vote up
public YamiUser(String userId, String bizUserId, Integer appId, boolean enabled) {
	super(appId + StrUtil.COLON + bizUserId, "", enabled,true, true, true , Collections.emptyList());
	this.userId = userId;
	this.bizUserId = bizUserId;
}