using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; using TEAMModelOS.SDK.Context.Attributes.Azure; namespace TEAMModelOS.SDK.Models { /// /// 投票 /// public class Vote : CosmosEntity { public Vote() { pk = "Vote"; options = new List(); } /// /// 发布层级 类型 school teacher /// public string owner { get; set; } /// /// 学校编码或教师tmdid /// [Required(ErrorMessage = "owner 必须设置")] 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; } /// /// scope 为school时 是学校的班级 为private 时是私人班级 /// public List classes { get; set; } /// /// 开始时间 /// 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 class OptionVote { /// /// 投票编号 /// public string code { get; set; } /// /// 投票对象 /// public string value { get; set; } /// /// 投票对象描述 /// public string desc { get; set; } } }