作者:li-yuefang_883 | 来源:互联网 | 2023-09-12 11:14
本文整理了Java中org.activiti.engine.IdentityService.setUserInfo()
方法的一些代码示例,展示了IdentityService.setUserInfo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IdentityService.setUserInfo()
方法的具体详情如下:
包路径:org.activiti.engine.IdentityService
类名称:IdentityService
方法名:setUserInfo
IdentityService.setUserInfo介绍
[英]Generic extensibility key-value pairs associated with a user
[中]
代码示例
代码示例来源:origin: org.activiti/activiti-rest
@ApiOperation(value = "Delete a user’s info", tags = {"Users"})
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Indicates the user was found and the info for the given key has been deleted. Response body is left empty intentionally."),
@ApiResponse(code = 404, message = "Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.")
})
@RequestMapping(value = "/identity/users/{userId}/info/{key}", method = RequestMethod.DELETE)
public void deleteUserInfo(@ApiParam(name = "userId", value="The id of the user to delete the info for.") @PathVariable("userId") String userId,@ApiParam(name = "key", value="The key of the user info to delete.") @PathVariable("key") String key, HttpServletResponse response) {
User user = getUserFromRequest(userId);
String validKey = getValidKeyFromRequest(user, key);
identityService.setUserInfo(user.getId(), validKey, null);
response.setStatus(HttpStatus.NO_CONTENT.value());
}
代码示例来源:origin: org.activiti/activiti-explorer
public void buttonClick(ClickEvent event) {
user.setFirstName((String) firstNameField.getValue());
user.setLastName((String) lastNameField.getValue());
user.setEmail((String) emailField.getValue());
identityService.saveUser(user);
identityService.setUserInfo(user.getId(), Constants.USER_INFO_JOB_TITLE, jobTitleField.getValue().toString());
if (birthDateField.getValue() != null && !"".equals(birthDateField.getValue().toString())) {
identityService.setUserInfo(user.getId(), Constants.USER_INFO_BIRTH_DATE, new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT).format(birthDateField.getValue()));
}
identityService.setUserInfo(user.getId(), Constants.USER_INFO_LOCATION, locationField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_PHONE, phoneField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_TWITTER, twitterField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_SKYPE, skypeField.getValue().toString());
// UI
editable = false;
loadProfileData();
initUi();
}
});
代码示例来源:origin: org.activiti/activiti-rest
@ApiOperation(value = "Update a user’s info", tags = {"Users"}, nickname = "updateUserInfo")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates the user was found and the info has been updated."),
@ApiResponse(code = 400, message = "Indicates the value was missing from the request body."),
@ApiResponse(code = 404, message = "Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.")
})
@RequestMapping(value = "/identity/users/{userId}/info/{key}", method = RequestMethod.PUT, produces = "application/json")
public UserInfoResponse setUserInfo(@ApiParam(name = "userId", value="The id of the user to update the info for.") @PathVariable("userId") String userId,@ApiParam(name = "key", value="The key of the user info to update.") @PathVariable("key") String key, @RequestBody UserInfoRequest userRequest, HttpServletRequest request) {
User user = getUserFromRequest(userId);
String validKey = getValidKeyFromRequest(user, key);
if (userRequest.getValue() == null) {
throw new ActivitiIllegalArgumentException("The value cannot be null.");
}
if (userRequest.getKey() == null || validKey.equals(userRequest.getKey())) {
identityService.setUserInfo(user.getId(), key, userRequest.getValue());
} else {
throw new ActivitiIllegalArgumentException("Key provided in request body doesn't match the key in the resource URL.");
}
return restResponseFactory.createUserInfoResponse(key, userRequest.getValue(), user.getId());
}
代码示例来源:origin: org.activiti/activiti-rest
@ApiOperation(value = "Create a new user’s info entry", tags = {"Users"}, nickname = "createUserInfo")
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Indicates the user was found and the info has been created."),
@ApiResponse(code = 400, message = "Indicates the key or value was missing from the request body. Status description contains additional information about the error."),
@ApiResponse(code = 404, message = "Indicates the requested user was not found."),
@ApiResponse(code = 409, message = "Indicates there is already an info-entry with the given key for the user, update the resource instance (PUT).")
})
@RequestMapping(value = "/identity/users/{userId}/info", method = RequestMethod.POST, produces = "application/json")
public UserInfoResponse setUserInfo(@ApiParam(name="userId", value="The id of the user to create the info for.") @PathVariable String userId, @RequestBody UserInfoRequest userRequest, HttpServletRequest request, HttpServletResponse response) {
User user = getUserFromRequest(userId);
if (userRequest.getKey() == null) {
throw new ActivitiIllegalArgumentException("The key cannot be null.");
}
if (userRequest.getValue() == null) {
throw new ActivitiIllegalArgumentException("The value cannot be null.");
}
String existingValue = identityService.getUserInfo(user.getId(), userRequest.getKey());
if (existingValue != null) {
throw new ActivitiConflictException("User info with key '" + userRequest.getKey() + "' already exists for this user.");
}
identityService.setUserInfo(user.getId(), userRequest.getKey(), userRequest.getValue());
response.setStatus(HttpStatus.CREATED.value());
return restResponseFactory.createUserInfoResponse(userRequest.getKey(), userRequest.getValue(), user.getId());
}
}
代码示例来源:origin: org.activiti/activiti-explorer
identityService.setUserInfo(userId, userInfo.get(i), userInfo.get(i+1));
代码示例来源:origin: com.github.hongframework/hframe-workflow
identityService.setUserInfo(userId, userInfo.get(i), userInfo.get(i+1));