From 51954072667f570edc2e534061eb5cad176b75a2 Mon Sep 17 00:00:00 2001 From: Putoo <290555932@qq.com> Date: Thu, 4 Jun 2026 18:34:00 +0800 Subject: [PATCH] 12 --- .../Controllers/Map/MapController.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Service/Application.Web/Controllers/Map/MapController.cs b/Service/Application.Web/Controllers/Map/MapController.cs index ffbd2dd..39490e0 100644 --- a/Service/Application.Web/Controllers/Map/MapController.cs +++ b/Service/Application.Web/Controllers/Map/MapController.cs @@ -92,7 +92,7 @@ public class MapController : ControllerBase var npcData = await _mapService.GetMapNpc(mapInfo.mapId); //NPC信息 npcData = npcData.FindAll(it => GameTool.AreaVerify(StateHelper.areaId, it.areaId)); var nearUser = - await _mapService.GetMapUser(mapInfo.mapId, area, (int)mapInfo.lookArea, new List { userId }, + await _mapService.GetMapUser(mapInfo.mapId, area, (int)mapInfo.lookArea, [userId], 3); //获取附近的人 var cityInfo = await _mapService.GetCityInfo((int)mapInfo.cityId); //城市信息 @@ -110,18 +110,20 @@ public class MapController : ControllerBase if (mapInfo.isBus == 1) { var busData = await _mapService.GetMapBus(mapInfo.mapId, 0, 0); - business = busData.Select(it => new + business = busData.Select(it => new { busId = it.busId, busName = it.busName - }); + }); } + //地图资源 List mapRes = new List(); - if (mapInfo.isRes==1) + if (mapInfo.isRes == 1) { mapRes = await _mapService.GetMapRes(mapInfo.mapId); } + #endregion @@ -150,7 +152,7 @@ public class MapController : ControllerBase [HttpGet] public async Task GetMapUser(int page) { - RefAsync Total = 0; + RefAsync total = 0; string userId = StateHelper.userId; int areaId = StateHelper.areaId; var onMap = await _mapService.GetUserOnMap(userId); @@ -161,11 +163,12 @@ public class MapController : ControllerBase return PoAction.Message("地图不存在!"); } - var data = await _mapService.GetMapUser(onMap.mapId, areaId, (int)mapInfo.lookArea, new List { userId }, + var data = await _mapService.GetMapUser(onMap.mapId, areaId, (int)mapInfo.lookArea, + [userId], page, - 10, Total); + 10, total); - return PoAction.Ok(new { data, total = Total.Value, map = mapInfo }); + return PoAction.Ok(new { data, total = total.Value, map = mapInfo }); } /// @@ -516,12 +519,12 @@ public class MapController : ControllerBase int safety = 0; string busCode = $"{runInfo.onMap}_{runInfo.toMap}"; var busData = await _mapService.GetMapBus(busCode, (int)runInfo.position, (int)runInfo.depth); - var business = busData.Select(it => new + var business = busData.Select(it => new { busId = it.busId, busName = it.busName }); - + return PoAction.Ok(new { onCity = onCity.cityName,