using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; using System.Text.Json; using TEAMModelOS.SDK.Context.Attributes.Azure; namespace TEAMModelOS.SDK.Models { /// /// 投票 /// public class Vote : CosmosEntity { public Vote() { pk = "Vote"; options = new List(); } /// /// 发布层级 类型 school teacher /// /// /// 学校编码或教室tmdid /// [Required(ErrorMessage = "owner 必须设置")] public string owner { get; set; } /// /// 学校编码或教师tmdid /// // [Required(ErrorMessage = "school 必须设置")] public string school { get; set; } /// /// 投票名称 /// [Required(ErrorMessage = "name 必须设置")] public string name { get; set; } /// /// 创建者的id /// [Required(ErrorMessage = "creatorId 必须设置")] public string creatorId { get; set; } /// /// 投票描述 /// public string description { get; set; } /// /// pending 待发布|going 已发布|finish 已结束 /// //[Required(ErrorMessage = "progress 必须设置")] public string progress { get; set; } /// /// 投票选项 /// public List options { get; set; } /// /// //匿名投票,不公布投票人相关信息 /// public bool secret { get; set; } /// /// 投票周期/once一次,day天,week周,month月,年year等 /// [Required(ErrorMessage = "times 必须设置")] public string times { get; set; } //周期内可投票数 public int voteNum { get; set; } //周期内是否允许重复投相同一个选项。 public bool repeat { get; set; } /// /// school|private /// [Required(ErrorMessage = "scope 必须设置")] public string scope { get; set; } /// /// 参与投票的教师醍摩豆id /// // public List tmdids { get; set; } /// /// 行政班 /// public List classes { get; set; } = new List(); /// /// 学生名单(包含自定义个人学生名单,学校教学班) /// public List stuLists { get; set; } = new List(); /// /// 教研组名单 /// public List tchLists { get; set; } = new List(); public List>> groupLists { get; set; } = new List>>(); /// /// student 学生名单类型 research 教研组名单 /// public string targetType { get; set; } /// /// 发布对象全部信息。由前端操作,用于前端回显发布对象的格式。 /// public List targets { get; set; } = new List(); /// /// 开始时间 /// public long startTime { get; set; } /// /// 创建时间 /// public long createTime { get; set; } /// /// 结束时间 /// public long endTime { get; set; } /// /// 更新时间 /// public long updateTime { get; set; } /// /// 投票记录 /// public string recordUrl { get; set; } /// /// TTL删除改变状态使用 /// public int? status { get; set; } = 0; public long? size { get; set; } = 0; public string areaId { get; set; } public string pId { get; set; } public int? publish { get; set; } = 0; //结束后账户统计 public List staffIds { get; set; } = new List(); } /// /// 投票选项 /// public class OptionVote { /// /// 投票编号 /// public string code { get; set; } /// /// 投票对象 /// public string value { get; set; } /// /// 投票对象描述 /// public string desc { get; set; } } }