http://jira.mfd.msk:8088/browse/CLS-550 не доверять пользователю указывать свой userId, проставляется на бэкенде.

This commit is contained in:
AKurakin 2023-09-28 10:28:09 +03:00
parent 4df7131630
commit 4951559891
6 changed files with 4 additions and 35 deletions

View file

@ -13,16 +13,12 @@ public class NotificationUpdateAction implements IAction<NotificationUpdateReque
@ApiModelProperty(value = "Наименование статуса сообщения", example = "ACTV") @ApiModelProperty(value = "Наименование статуса сообщения", example = "ACTV")
@JsonProperty @JsonProperty
public String notificationStatus; public String notificationStatus;
@ApiModelProperty(value = "Наименование отправителя", example = "1234")
@JsonProperty
public Long senderId;
@Override @Override
public NotificationUpdateRequest toRequest() { public NotificationUpdateRequest toRequest() {
var req = new NotificationUpdateRequest(); var req = new NotificationUpdateRequest();
req.setId(this.id); req.setId(this.id);
req.setNotificationStatus(this.notificationStatus); req.setNotificationStatus(this.notificationStatus);
req.setSenderId(this.senderId);
return req; return req;
} }
@ -48,11 +44,4 @@ public class NotificationUpdateAction implements IAction<NotificationUpdateReque
this.notificationStatus = notificationStatus; this.notificationStatus = notificationStatus;
} }
public Long getSenderId() {
return senderId;
}
public void setSenderId(Long senderId) {
this.senderId = senderId;
}
} }

View file

@ -1,6 +1,6 @@
{ {
"version": "3.8.0.56", "version": "3.8.0.57",
"enums": { "enums": {
@ -7007,10 +7007,6 @@
{"code": "notificationStatus", {"code": "notificationStatus",
"type": 12,"name": "Наименование статуса сообщения","shortname": "Статус","link": "notificationStatus","required": true "type": 12,"name": "Наименование статуса сообщения","shortname": "Статус","link": "notificationStatus","required": true
} }
,
{"code": "senderId",
"type": 1,"name": "Наименование отправителя","shortname": "Отправитель","visible": false,"required": true
}
] ]
} }
] ]

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?--> <!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?-->
<meta version="3.8.0.56"> <meta version="3.8.0.57">
<!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" --> <!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" -->
<!--Здесь словари--> <!--Здесь словари-->
<enums> <enums>
@ -1622,7 +1622,6 @@
<put name="Изменение статуса сообщения" class="ru.spcex.clearing.backendapi.controller.request.cud.registry.NotificationUpdateAction"> <put name="Изменение статуса сообщения" class="ru.spcex.clearing.backendapi.controller.request.cud.registry.NotificationUpdateAction">
<id type="1" name="Идентификатор записи" shortname="ID" link="notification" linkCode="id" required="true"/> <id type="1" name="Идентификатор записи" shortname="ID" link="notification" linkCode="id" required="true"/>
<notificationStatus type="12" name="Наименование статуса сообщения" shortname="Статус" link="notificationStatus" required="true"/> <notificationStatus type="12" name="Наименование статуса сообщения" shortname="Статус" link="notificationStatus" required="true"/>
<senderId type="1" name="Наименование отправителя" shortname="Отправитель" visible="false" required="true" />
</put> </put>
</actions> </actions>
</notification> </notification>

View file

@ -1,6 +1,6 @@
{ {
"version": "3.8.0.56", "version": "3.8.0.57",
"enums": { "enums": {
@ -7007,10 +7007,6 @@
{"code": "notificationStatus", {"code": "notificationStatus",
"type": 12,"name": "Наименование статуса сообщения","shortname": "Статус","link": "notificationStatus","required": true "type": 12,"name": "Наименование статуса сообщения","shortname": "Статус","link": "notificationStatus","required": true
} }
,
{"code": "senderId",
"type": 1,"name": "Наименование отправителя","shortname": "Отправитель","visible": false,"required": true
}
] ]
} }
] ]

View file

@ -68,7 +68,7 @@ public class NotificationService extends QueueConsumer implements InitializingBe
throw new NullPointerException("Notification by id:{" + id + "} is null!"); throw new NullPointerException("Notification by id:{" + id + "} is null!");
} }
notification.setNotificationStatus(request.getNotificationStatus()); notification.setNotificationStatus(request.getNotificationStatus());
notification.setSenderId(request.getSenderId()); notification.setSenderId(notificationUpdateRequestBaseRequest.getUserId());
notification.setUpdated(Instant.now()); notification.setUpdated(Instant.now());
notificationMap.update(notification); notificationMap.update(notification);
sendFeedbackString(notification); sendFeedbackString(notification);

View file

@ -9,9 +9,6 @@ public class NotificationUpdateRequest {
@JsonProperty @JsonProperty
public String notificationStatus; public String notificationStatus;
@JsonProperty
public Long senderId;
public Long getId() { public Long getId() {
return id; return id;
} }
@ -27,12 +24,4 @@ public class NotificationUpdateRequest {
public void setNotificationStatus(String notificationStatus) { public void setNotificationStatus(String notificationStatus) {
this.notificationStatus = notificationStatus; this.notificationStatus = notificationStatus;
} }
public Long getSenderId() {
return senderId;
}
public void setSenderId(Long senderId) {
this.senderId = senderId;
}
} }