Refactor ChatService and ChannelListComponent: integrate ChatService into ChannelListComponent, rename partieId to partyId, update party and DM name mappings in UI, and remove debug log in AuthService.

This commit is contained in:
2026-08-01 20:47:34 +02:00
parent 8ecfb99b27
commit 8f9aea2e0f
6 changed files with 36 additions and 15 deletions
@@ -1,6 +1,7 @@
package com.alttd.altitudeweb.controllers.chat;
import com.alttd.altitudeweb.api.ChatInfoApi;
import com.alttd.altitudeweb.model.PartyNameDto;
import com.alttd.altitudeweb.model.PlayerNameDto;
import com.alttd.altitudeweb.services.chat.ChatInfoService;
import lombok.RequiredArgsConstructor;
@@ -25,7 +26,7 @@ public class ChatInfoController implements ChatInfoApi {
}
@Override
public ResponseEntity<String> getPartyName(String id) {
public ResponseEntity<PartyNameDto> getPartyName(String id) {
int partyId;
try {
partyId = Integer.parseInt(id);
@@ -33,6 +34,11 @@ public class ChatInfoController implements ChatInfoApi {
return ResponseEntity.badRequest().build();
}
return chatInfoService.getPartyName(partyId)
.map(partyName -> {
PartyNameDto partyNameDto = new PartyNameDto();
partyNameDto.setName(partyName);
return partyNameDto;
})
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
}