Skip to content

Commit

Permalink
fix: alert template (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
masaimu authored Jan 31, 2024
1 parent f9c579f commit 83e670b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ParaCheckUtil {
private static Pattern PATTERN_SQL =
Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_ ,\\.]*$");
private static Pattern PATTERN_STRICT_SQL =
Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_,|\\.]*$");
Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_, |:\\.]*$");

private static Pattern uniCodePattern = Pattern.compile("\\\\u[0-9a-f]{4}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public void doManage() {
"create alertNotificationTemplate tenant {} workspace {} creator {} insert size {}",
templateDTO.getTenant(), templateDTO.getWorkspace(), templateDTO.getCreator(), insert);

userOpLogService.append("alert_notification_template", alertTemplate.getUuid(),
OpType.CREATE, mu.getLoginName(), ms.getTenant(), ms.getWorkspace(),
J.toJson(templateDTO), null, null, "alert_notification_template_create");
userOpLogService.append("alert_template", alertTemplate.getUuid(), OpType.CREATE,
mu.getLoginName(), ms.getTenant(), ms.getWorkspace(), J.toJson(templateDTO), null, null,
"alert_template_create");
JsonResult.createSuccessResult(result, alertTemplate.getUuid());
}
});
Expand Down Expand Up @@ -134,10 +134,9 @@ public void doManage() {
AlertTemplate alertTemplate = alertTemplateConverter.dtoToDO(templateDTO);
alertTemplateMapper.updateById(alertTemplate);

userOpLogService.append("alert_notification_template", templateDTO.getUuid(), OpType.UPDATE,
userOpLogService.append("alert_template", templateDTO.getUuid(), OpType.UPDATE,
RequestContext.getContext().mu.getLoginName(), ms.getTenant(), ms.getWorkspace(),
J.toJson(originalItem), J.toJson(templateDTO), null,
"alert_notification_template_update");
J.toJson(originalItem), J.toJson(templateDTO), null, "alert_template_update");

JsonResult.createSuccessResult(result, templateDTO.uuid);
}
Expand Down Expand Up @@ -183,7 +182,7 @@ public void doManage() {
levelAuthorizationCheckeClass = "io.holoinsight.server.home.web.security.custom.AlertTemplateFacadeImplChecker")
@DeleteMapping(value = "/delete/{uuid}")
@MonitorScopeAuth(targetType = AuthTargetType.TENANT, needPower = PowerConstants.EDIT)
public JsonResult<Integer> deleteById(@PathVariable("uuid") Long uuid) {
public JsonResult<Integer> deleteById(@PathVariable("uuid") String uuid) {
final JsonResult<Integer> result = new JsonResult<>();
facadeTemplate.manage(result, new ManageCallback() {
@Override
Expand All @@ -200,9 +199,9 @@ public void doManage() {
rtn = alertTemplateMapper.deleteById(uuid);
}

userOpLogService.append("alert_notification_template", uuid, OpType.DELETE,
userOpLogService.append("alert_template", uuid, OpType.DELETE,
RequestContext.getContext().mu.getLoginName(), ms.getTenant(), ms.getWorkspace(),
J.toJson(originalItem), null, null, "alert_notification_template_delete");
J.toJson(originalItem), null, null, "alert_template_delete");

JsonResult.createSuccessResult(result, rtn);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private boolean checkId(List<String> parameters, String tenant, String workspace
return false;
}

String uuid = parameters.get(0);
String uuid = J.fromJson(parameters.get(0), String.class);
return checkId(uuid, tenant, workspace);
}

Expand Down

0 comments on commit 83e670b

Please sign in to comment.