Minor fixes

This commit is contained in:
2026-01-02 20:52:24 +01:00
parent 8ed4943dd7
commit 76958d75db
3 changed files with 6 additions and 5 deletions

View File

@@ -107,7 +107,7 @@ public class ChatController {
ObjectMapper mapper = new ObjectMapper();
WebexWebhook payload = mapper.readValue(rawPayload, WebexWebhook.class);
Room room = webexService.getByRoom(payload.getData().getRoomId());
Room room = webexService.getRoomById(payload.getData().getRoomId());
Message msg = webexService.fetchMessage(payload.getData().getId());
this.messageService.save(msg);

View File

@@ -2,6 +2,7 @@ package be.naaturel.boardmateapi.services;
import be.naaturel.boardmateapi.common.exceptions.ServiceException;
import be.naaturel.boardmateapi.common.helpers.Logger;
import be.naaturel.boardmateapi.common.models.Client;
import be.naaturel.boardmateapi.common.models.Message;
import be.naaturel.boardmateapi.common.models.Room;
import be.naaturel.boardmateapi.configurations.properties.NgrokProperties;
@@ -79,7 +80,7 @@ public class WebexService {
public void post(Message m) throws ServiceException {
try (HttpClient client = HttpClient.newHttpClient()) {
Room room = getByClient(m.getClientId());
Room room = getRoomByClient(m.getClientId());
if (room == null) {
room = createRoom(m.getClientId());
inviteMemberToRoom(room.getId(), "laurent.crema@student.hepl.be");
@@ -165,11 +166,11 @@ public class WebexService {
}
}
public Room getByClient(String clientId) {
public Room getRoomByClient(String clientId) {
return repo.findByClientId(clientId).map(RoomMapper::toModel).orElse(null);
}
public Room getByRoom(String roomId) {
public Room getRoomById(String roomId) {
return repo.findByRoomId(roomId).map(RoomMapper::toModel).orElse(null);
}