using Microsoft.AspNetCore.Mvc; using System.Net; using System.Net.Http.Headers; using Microsoft.Extensions.Hosting.Internal; using Microsoft.AspNetCore.Http.Extensions; using IStation.Untity; using Furion.DynamicApiController; using System.ComponentModel.DataAnnotations; using Mapster; namespace IStation.Application { /// /// ObjectMapInfo /// [Route("Map/ObjectMapInfo/Mobile")] [ApiDescriptionSettings("Map", Name = "对象地图信息", Order = 999)] public class ObjectMapInfo_MobileController : IDynamicApiController { /// /// 通过 Kind 和 Purpose 获取特定对象的地图位置信息(手机) /// [Route("GetByKindAndPurposeOfObject@V1.0")] [HttpGet] public List GetByKindAndPurposeOfObject([FromQuery][Required] GetObjectMapInfoMobileInput input) { var list = new Service.ObjectMapInfo().GetByKindAndPurposeOfObject(input.CorpID, input.ObjectType, input.ObjectID, input.Kind, input.Purpose); var vm_list = list?.Select(x => new ObjectMapInfoMobileDto(x)).ToList(); return vm_list; } /// /// 通过 Kind 和 Purpose 获取特定对象的第一条地图位置信息(手机) /// [Route("GetFirstByKindAndPurposeOfObject@V1.0")] [HttpGet] public ObjectMapInfoMobileDto GetFirstByKindAndPurposeOfObject([FromQuery][Required] GetObjectMapInfoMobileInput input) { var model = new Service.ObjectMapInfo().GetFirstByKindAndPurposeOfObject(input.CorpID, input.ObjectType, input.ObjectID, input.Kind, input.Purpose); return model == null ? null : new ObjectMapInfoMobileDto(model); } /// /// 通过 Kind 获取特定对象的地图位置信息(手机) /// [Route("GetByKindOfObject@V1.0")] [HttpGet] public List GetByKindOfObject([FromQuery][Required] GetObjectMapInfoOfKindMobileInput input) { var list = new Service.ObjectMapInfo().GetByKindOfObject(input.CorpID, input.ObjectType, input.ObjectID, input.Kind); var vm_list = list?.Select(x => new ObjectMapInfoMobileDto(x)).ToList(); return vm_list; } /// /// 通过 Kind 和 Purpose 获取地图位置信息(手机) /// [Route("GetByKindAndPurpose@V1.0")] [HttpGet] public List GetByKindAndPurpose ( [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")] long CorpID, [Required, DataValidation(AllowEmptyStrings = false)] string Kind, [Required, DataValidation(AllowEmptyStrings = false)] string Purpose ) { var list = new Service.ObjectMapInfo().GetByKindAndPurpose(CorpID, Kind, Purpose); var vm_list = list?.Select(x => new ObjectMapInfoMobileDto(x)).ToList(); return vm_list; } /// /// 通过 Kind 和 Purpose 获取客户下地图位置信息(手机) /// [Route("GetByKindAndPurposeUnderCorp@V1.0")] [HttpGet] public List GetByKindAndPurposeUnderCorp ( [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")] long CorpID, [Required, DataValidation(AllowEmptyStrings = false)] string Kind, [Required, DataValidation(AllowEmptyStrings = false)] string Purpose ) { var list = new Service.ObjectMapInfo().GetByKindAndPurposeUnderCorp(CorpID, Kind, Purpose); var vm_list = list?.Select(x => new ObjectMapInfoMobileDto(x)).ToList(); return vm_list; } /// /// 通过 Kind 和 Purpose 获取特定对象类型的地图位置信息(手机) /// [Route("GetByKindAndPurposeOfObjectType@V1.0")] [HttpGet] public List GetByKindAndPurposeOfObjectType ( [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")] long CorpID, [Required, DataValidation(AllowEmptyStrings = false)] string ObjectType, [Required, DataValidation(AllowEmptyStrings = false)] string Kind, [Required, DataValidation(AllowEmptyStrings = false)] string Purpose ) { var list = new Service.ObjectMapInfo().GetByKindAndPurposeOfObjectType(CorpID, ObjectType, Kind, Purpose); var vm_list = list?.Select(x => new ObjectMapInfoMobileDto(x)).ToList(); return vm_list; } } }