Minor fixes
This commit is contained in:
@@ -32,7 +32,7 @@ message_controller = MessageController(app, auth_data, "https://192.168.15.120:8
|
||||
def handle_message_received(topic:str, payload:str):
|
||||
try :
|
||||
print(payload, flush=True)
|
||||
url = "https://127.0.0.1:1880/message/receive"
|
||||
url = "https://192.168.15.120:1880/message/receive"
|
||||
requests.post(url, json=payload, verify=False)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user