QuestionInfo.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using Abp.Domain.Entities.Auditing;
  6. using WeOnlineApp.Authorization.Users;
  7. using WeOnlineApp.Basic;
  8. using WeOnlineApp.Configuration;
  9. using WeOnlineApp.TrainingCamp;
  10. namespace WeOnlineApp.Question
  11. {
  12. /// <summary>
  13. /// 问题
  14. /// </summary>
  15. [Table("Train_QuestionInfos")]
  16. public class QuestionInfo : FullAuditedEntity<string, User>
  17. {
  18. public const int TitleLength = 500;
  19. public const int ContentLength = 1000;
  20. /// <summary>
  21. /// 课程类型
  22. /// </summary>
  23. [MaxLength(IwbConsts.PrimaryKey)]
  24. public string SubjectCategoryNo { get; set; }
  25. [ForeignKey("SubjectCategoryNo")]
  26. public SubjectCategoryInfo SubjectCategory { get; set; }
  27. /// <summary>
  28. /// 课程类型
  29. /// </summary>
  30. [MaxLength(IwbConsts.PrimaryKey)]
  31. public string CampNo { get; set; }
  32. [ForeignKey("CampNo")]
  33. public CampInfo Camp { get; set; }
  34. [NotMapped]
  35. public string CampName => Camp?.Name ?? "";
  36. /// <summary>
  37. /// 问题标题
  38. /// </summary>
  39. [MaxLength(TitleLength)]
  40. public string Title { get; set; }
  41. /// <summary>
  42. /// 问题内容
  43. /// </summary>
  44. [MaxLength(ContentLength)]
  45. public string ContentInfo { get; set; }
  46. /// <summary>
  47. /// 问题状态
  48. /// </summary>
  49. public int QuestionState { get; set; }
  50. /// <summary>
  51. /// 解答时间
  52. /// </summary>
  53. public DateTime? AnswerDateTime { get; set; }
  54. public string AnswerNo { get; set; }
  55. public virtual ICollection<QuestionAnswerInfo> AnswerInfos { get; set; }
  56. public virtual ICollection<QuestionFavoriteInfo> Favorites { get; set; }
  57. /// <summary>
  58. /// 备注
  59. /// </summary>
  60. [MaxLength(RemarkLength)]
  61. public string Remark { get; set; }
  62. public const int RemarkLength = 500;
  63. }
  64. }