平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BuildingInfoDto.cs 1.5 KiB

3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Newtonsoft.Json;
  2. namespace SafeCampus.Application.Services.Business.BuildingService;
  3. public class BuildingInfoDto
  4. {
  5. /// <summary>
  6. /// ID
  7. /// </summary>
  8. public long? Id { get; set; }
  9. /// <summary>
  10. /// 宿舍楼名称
  11. /// </summary>
  12. public string Name { get; set; }
  13. /// <summary>
  14. /// 男寝还是女寝
  15. /// </summary>
  16. public bool Gender { get; set; }
  17. /// <summary>
  18. /// 创建时间
  19. /// </summary>
  20. public DateTime CreateTime { get; set; }
  21. /// <summary>
  22. /// 进入摄像头id
  23. /// </summary>
  24. [JsonProperty(NullValueHandling = NullValueHandling.Include)]
  25. public string InsCameraId { get; set; }
  26. /// <summary>
  27. /// 摄像头名称
  28. /// </summary>
  29. [JsonProperty(NullValueHandling = NullValueHandling.Include)]
  30. public string InsCameraName { get; set;}
  31. /// <summary>
  32. /// 出去摄像头id
  33. /// </summary>
  34. [JsonProperty(NullValueHandling = NullValueHandling.Include)]
  35. public string OutCameraId { get; set; }
  36. /// <summary>
  37. /// 出去摄像头名称
  38. /// </summary>
  39. [JsonProperty(NullValueHandling = NullValueHandling.Include)]
  40. public string OutCameraName { get; set;}
  41. }
  42. public class BuildingInfoDtoMapper : IRegister
  43. {
  44. public void Register(TypeAdapterConfig config)
  45. {
  46. config.ForType<BuildingInfo, BuildingInfoDto>()
  47. .Map(x => x.InsCameraName, x => x.InsCameraInfoItem.SensorName)
  48. .Map(x => x.OutCameraName, x => x.OutCameraInfoItem.SensorName);
  49. }
  50. }