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:
+7
-1
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user