新增国家列表接口
(cherry picked from commit 9cf8cabbabcd656fe9bbe2bfdfcbb1fe463fb23f)
This commit is contained in:
parent
e62e8b6f17
commit
4d4640a105
@ -3,6 +3,7 @@ package com.red.circle.other.adapter.app.room;
|
||||
import com.red.circle.common.business.dto.cmd.AppExtCommand;
|
||||
import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd;
|
||||
import com.red.circle.framework.web.controller.BaseController;
|
||||
import com.red.circle.other.app.dto.clientobject.room.CountryCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.EntryRoomResponseCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomOnlineUserCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO;
|
||||
@ -172,4 +173,17 @@ public class LiveVoiceRoomRestController extends BaseController {
|
||||
return liveVoiceRoomService.explore(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 国家列表.
|
||||
*
|
||||
* @eo.name 国家列表.
|
||||
* @eo.url /country
|
||||
* @eo.method get
|
||||
* @eo.request-type formdata
|
||||
*/
|
||||
@GetMapping("/country")
|
||||
public List<CountryCO> listCountry() {
|
||||
return liveVoiceRoomService.listRoomCountry();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package com.red.circle.other.app.command.room.query;
|
||||
|
||||
import com.red.circle.other.app.dto.clientobject.room.CountryCO;
|
||||
import com.red.circle.other.infra.database.rds.entity.sys.SysCountryCode;
|
||||
import com.red.circle.other.infra.database.rds.service.sys.SysCountryCodeService;
|
||||
import com.red.circle.tool.core.text.StringUtils;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 房间国家列表查询.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class RoomCountryListQryExe {
|
||||
|
||||
private final SysCountryCodeService sysCountryCodeService;
|
||||
|
||||
public List<CountryCO> execute() {
|
||||
List<SysCountryCode> countries = sysCountryCodeService.listOpenCountry();
|
||||
return countries.stream().map(this::toCountryCO).toList();
|
||||
}
|
||||
|
||||
private CountryCO toCountryCO(SysCountryCode entity) {
|
||||
CountryCO co = new CountryCO();
|
||||
co.setCountryId(entity.getId());
|
||||
co.setCountryCode(entity.getAlphaTwo());
|
||||
co.setCountryName(StringUtils.isBlankOrElse(entity.getAliasName(), entity.getCountryName()));
|
||||
co.setNationalFlag(entity.getNationalFlag());
|
||||
return co;
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,7 @@ import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd;
|
||||
import com.red.circle.other.app.command.room.LiveVoicePublicRoomCreateCmdExe;
|
||||
import com.red.circle.other.app.command.room.LiveVoiceRoomCreateCmdExe;
|
||||
import com.red.circle.other.app.command.room.RoomEnterCmdExe;
|
||||
import com.red.circle.other.app.command.room.query.RoomCountryListQryExe;
|
||||
import com.red.circle.other.app.command.room.query.RoomLatestCreateQryExe;
|
||||
import com.red.circle.other.app.command.room.query.RoomOnlineUserFlowQryExe;
|
||||
import com.red.circle.other.app.command.room.query.RoomVoiceDiscoverQryExe;
|
||||
@ -13,6 +14,7 @@ import com.red.circle.other.app.command.room.query.RoomVoiceExploreQryExe;
|
||||
import com.red.circle.other.app.command.room.query.RoomVoiceProfileByRoomAccountQryExe;
|
||||
import com.red.circle.other.app.command.room.query.SearchRegionRoomQryExe;
|
||||
import com.red.circle.other.app.command.room.query.UserCurrentLocationRoomQryExe;
|
||||
import com.red.circle.other.app.dto.clientobject.room.CountryCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.EntryRoomResponseCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomOnlineUserCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO;
|
||||
@ -42,6 +44,7 @@ public class LiveVoiceRoomServiceImpl implements LiveVoiceRoomService {
|
||||
private final RoomLatestCreateQryExe roomLatestCreateQryExe;
|
||||
private final RoomVoiceDiscoverQryExe roomVoiceDiscoverQryExe;
|
||||
private final RoomVoiceExploreQryExe roomVoiceExploreQryExe;
|
||||
private final RoomCountryListQryExe roomCountryListQryExe;
|
||||
private final RoomOnlineUserFlowQryExe roomOnlineUserFlowQryExe;
|
||||
private final LiveVoiceRoomCreateCmdExe liveVoiceRoomCreateCmdExe;
|
||||
private final UserCurrentLocationRoomQryExe userCurrentLocationRoomQryExe;
|
||||
@ -95,6 +98,11 @@ public class LiveVoiceRoomServiceImpl implements LiveVoiceRoomService {
|
||||
return roomVoiceExploreQryExe.execute(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CountryCO> listRoomCountry() {
|
||||
return roomCountryListQryExe.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createPublicRoomByRegion(AppExtCommand cmd) {
|
||||
return liveVoicePublicRoomCreateCmdExe.execute(cmd);
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.red.circle.other.app.dto.clientobject.room;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.red.circle.framework.dto.ClientObject;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 国家信息.
|
||||
*
|
||||
* @author tf
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CountryCO extends ClientObject {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long countryId;
|
||||
|
||||
private String countryCode;
|
||||
|
||||
private String countryName;
|
||||
|
||||
private String nationalFlag;
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.red.circle.other.app.service.room;
|
||||
|
||||
import com.red.circle.common.business.dto.cmd.AppExtCommand;
|
||||
import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd;
|
||||
import com.red.circle.other.app.dto.clientobject.room.CountryCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.EntryRoomResponseCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomOnlineUserCO;
|
||||
import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO;
|
||||
@ -39,5 +40,7 @@ public interface LiveVoiceRoomService {
|
||||
|
||||
List<RoomVoiceProfileCO> explore(RoomExploreQryCmd cmd);
|
||||
|
||||
List<CountryCO> listRoomCountry();
|
||||
|
||||
String createPublicRoomByRegion(AppExtCommand cmd);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user