Browse Source

处理投票

CrazyIter_Bin 4 years ago
parent
commit
d253c79b93

+ 12 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Inner/VoteRecord.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Models.Cosmos.Common.Inner
+{
+    public class VoteRecord
+    {
+        public List<string> opt { get; set; }
+        public long time { get; set; }
+    }
+}

+ 23 - 23
TEAMModelOS.SDK/Models/Cosmos/Student/VoteRecord.cs

@@ -7,35 +7,35 @@ using TEAMModelOS.SDK.DI;
 
 
 namespace TEAMModelOS.SDK.Models
 namespace TEAMModelOS.SDK.Models
 {    
 {    
-    public class VoteRecord : CosmosEntity
-    {
+    //public class VoteRecord : CosmosEntity
+    //{
 
 
-        public VoteRecord()
-        {
-            classroom = new ClassroomItem();
-        }
+    //    public VoteRecord()
+    //    {
+    //        classroom = new ClassroomItem();
+    //    }
 
 
-        /// <summary>
-        /// 姓名
-        /// </summary>
-        public string name { get; set; }
+    //    /// <summary>
+    //    /// 姓名
+    //    /// </summary>
+    //    public string name { get; set; }
 
 
-        /// <summary>
-        /// 上课班级
-        /// </summary>
-        public ClassroomItem classroom { get; set; }
+    //    /// <summary>
+    //    /// 上课班级
+    //    /// </summary>
+    //    public ClassroomItem classroom { get; set; }
 
 
 
 
 
 
-        /// <summary>
-        /// 提交时间
-        /// </summary>
-        public long submitTime { get; set; }
+    //    /// <summary>
+    //    /// 提交时间
+    //    /// </summary>
+    //    public long submitTime { get; set; }
 
 
-        /// <summary>
-        /// 选项
-        /// </summary>
-        public string option { get; set; }
+    //    /// <summary>
+    //    /// 选项
+    //    /// </summary>
+    //    public string option { get; set; }
 
 
-    }
+    //}
 }
 }

+ 155 - 8
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -21,6 +21,9 @@ using TEAMModelOS.Models;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Options;
 using TEAMModelOS.SDK.Models.Cosmos;
 using TEAMModelOS.SDK.Models.Cosmos;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Authorization;
+using TEAMModelOS.Filter;
+using StackExchange.Redis;
+using TEAMModelOS.SDK.Models.Cosmos.Common.Inner;
 
 
 namespace TEAMModelOS.Controllers.Learn
 namespace TEAMModelOS.Controllers.Learn
 {
 {
@@ -197,7 +200,7 @@ namespace TEAMModelOS.Controllers.Learn
         /// <returns></returns>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [ProducesDefaultResponseType]
         [HttpPost("find-tch")]
         [HttpPost("find-tch")]
-        [Authorize(Roles = "teacher")]
+        [AuthToken(Roles = "teacher")]
         public async Task<IActionResult> FindTch(JsonElement requert)
         public async Task<IActionResult> FindTch(JsonElement requert)
         {
         {
             (List<ActivityData> datas, string continuationToken) = await FindByRole("Teacher", requert);
             (List<ActivityData> datas, string continuationToken) = await FindByRole("Teacher", requert);
@@ -220,7 +223,7 @@ namespace TEAMModelOS.Controllers.Learn
         /// <returns></returns>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [ProducesDefaultResponseType]
         [HttpPost("find-stu")]
         [HttpPost("find-stu")]
-        [Authorize(Roles = "student")]
+        [AuthToken(Roles = "student")]
         public async Task<IActionResult> FindStu(JsonElement requert)
         public async Task<IActionResult> FindStu(JsonElement requert)
         {
         {
             (List<ActivityData> datas, string continuationToken)  =await  FindByRole("Student", requert);
             (List<ActivityData> datas, string continuationToken)  =await  FindByRole("Student", requert);
@@ -376,10 +379,11 @@ namespace TEAMModelOS.Controllers.Learn
         /// <data>
         /// <data>
         /// !"id":"aaaa"
         /// !"id":"aaaa"
         /// !"code":"Vote-hbcn"/"code":"Vote-1606285227"
         /// !"code":"Vote-hbcn"/"code":"Vote-1606285227"
-        /// !"option":"A/B/C..1/2/3..."
+        /// !"option":["A","B","B"]/["1","2","3"]
         /// </data>
         /// </data>
         /// <redis>
         /// <redis>
-        /// 投票活动选项计数器 数据集合 key:"Vote:Count:AAA",value:"A",score:1
+        /// 投票活动选项计数器 使用SortedSet(有序集合)ZSET 数据集合 使用命令 ZINCRBY  key:"Vote:Count:AAA",value:"A",score:1
+        /// 投票活动 投票记录  使用Hash(哈希表)使用命令 key:"Vote:Record:AAA",feild:15283771540-20210105,value:"{"opt":["A","C","A"],"time":1608274766154}"
         /// </redis>
         /// </redis>
         /// <param name="request"></param>
         /// <param name="request"></param>
         /// <returns></returns>
         /// <returns></returns>
@@ -387,11 +391,154 @@ namespace TEAMModelOS.Controllers.Learn
         [HttpPost("decide")]
         [HttpPost("decide")]
         public async Task<IActionResult> UpsertRecord(JsonElement request)
         public async Task<IActionResult> UpsertRecord(JsonElement request)
         {
         {
-            //1.再次检查投票
-
-            //2.处理投票
+            DateTimeOffset now = DateTimeOffset.UtcNow;
             
             
-            return Ok(request);
+            long curr= now.ToUnixTimeMilliseconds();
+            var (userid, _, _, _) = HttpContext.GetAuthTokenInfo();
+            byte msgid =0;//投票失败,1投票成功,2不在时间范围内,3不在发布范围内,4投票周期内重复投票,5周期内的可投票数不足,6未设置投票项
+            //活动id
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            //活动分区
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            List<string> option = new List<string>() ;
+            if (request.TryGetProperty("option", out JsonElement joption)) {
+                option= joption.ToObject<List<string>>();
+                if (option.IsEmpty()) {
+                    msgid = 6;
+                    return Ok( new { msgid});
+                }
+            }
+            else {
+                return BadRequest();
+            }
+            VoteRecord record = null;
+            try {
+                //1.再次检查投票
+                var client = _azureCosmos.GetCosmosClient();
+                Vote vote = null;
+                ///TODO 检查是否在投票范围内,包括在tmdids 及班级  但是需要处理认证金钥中的班级问题
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Vote>(queryText: $"select c.progress,c.times,c.voteNum,c.startTime,c.endTime from c where c.id = '{id}'",
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                {
+                    vote = item;
+                    break;
+                }
+                if (vote != null)
+                {
+                    //判断投票时间是否在起止时间内
+                    if (curr >= vote.startTime && curr <= vote.endTime)
+                    {
+                       
+                        //如果是只能投票一次的活动则直接获取Redis的第一条
+                        if (vote.times.Equals("once"))
+                        {
+                            //只能投一次
+                            string Field = $"{userid}-once";
+                            RedisValue[] values = _azureRedis.GetRedisClient(8).HashValues($"Vote:Record:{vote.id}");
+                            if (values != null)
+                            {
+                                record = values[0].ToString().ToObject<VoteRecord>();
+                                msgid=await VoteIng(vote, record, msgid, option, Field, curr);
+                            }
+                            else {
+                                msgid = 1;
+                            }
+                        } 
+                        else if (vote.times.Equals("day"))
+                        {
+                            //周期内每天
+                            string Field= $"{userid}-day-{now.ToString("yyyyMMdd")}";
+                            RedisValue value= _azureRedis.GetRedisClient(8).HashGet($"Vote:Record:{vote.id}", Field);
+                            record = value.ToString().ToObject<VoteRecord>();
+                            msgid = await VoteIng(vote, record, msgid, option, Field, curr);
+                        }
+                        else if (vote.times.Equals("week"))
+                        {
+                            //自然周
+                            string Field = $"{userid}-week-{now.ToString("yyyy")}{GetWeek(now)}";
+                            RedisValue value = _azureRedis.GetRedisClient(8).HashGet($"Vote:Record:{vote.id}", Field);
+                            record = value.ToString().ToObject<VoteRecord>();
+                            msgid = await VoteIng(vote, record, msgid, option, Field, curr);
+
+                        }
+                        else if (vote.times.Equals("month"))
+                        {
+                            //月份
+                            string Field = $"{userid}-month-{now.ToString("yyyyMM")}";
+                            RedisValue value = _azureRedis.GetRedisClient(8).HashGet($"Vote:Record:{vote.id}", Field);
+                            record = value.ToString().ToObject<VoteRecord>();
+                            msgid = await VoteIng(vote, record, msgid, option, Field, curr);
+                        }
+                        else if (vote.times.Equals("year"))
+                        {
+                            //年份
+                            string Field = $"{userid}-year-{now.ToString("yyyy")}";
+                            RedisValue value = _azureRedis.GetRedisClient(8).HashGet($"Vote:Record:{vote.id}", Field);
+                            record = value.ToString().ToObject<VoteRecord>();
+                            msgid = await VoteIng(vote, record, msgid, option, Field,curr);
+                        }
+                    }
+                    else 
+                    {
+                        msgid = 2;
+                    }
+                }
+            }
+            catch (Exception e) {
+            }
+            return Ok(new { msgid });
+        }
+
+        public async Task<byte> VoteIng(Vote vote, VoteRecord record,byte msgid,List<string> option,string Field ,long curr) {
+            if (record != null)
+            {
+                //处理记录投票+当前设置的投票是否小于等于周期内最大投票数
+                if (record.opt.Count + option.Count <= vote.voteNum)
+                {
+                    record.opt.AddRange(option);
+                    record.time = curr;
+                    bool status = await _azureRedis.GetRedisClient(8).HashSetAsync($"Vote:Record:{vote.id}", Field, record.ToJsonString());
+                    if (status)
+                    {
+                        msgid = 1;
+                    }
+                }
+                else
+                {
+                    msgid = 5;
+                }
+            }
+            else {
+                record = new VoteRecord { opt = option, time = curr };
+                bool status = await _azureRedis.GetRedisClient(8).HashSetAsync($"Vote:Record:{vote.id}", Field, record.ToJsonString());
+                if (status)
+                {
+                    msgid = 1;
+                }
+            }
+            return msgid;
+        }
+        /// <summary>
+        /// 获取时间的在当年的第几周
+        /// </summary>
+        /// <param name="dt"></param>
+        /// <returns></returns>
+        public static int GetWeek(DateTimeOffset dt)
+        {
+            DateTimeOffset time = Convert.ToDateTime(dt.ToString("yyyy") + "-01-01");
+            TimeSpan ts = dt - time;
+            int iii = (int)time.DayOfWeek;
+            int day = int.Parse(ts.TotalDays.ToString("F0"));
+            if (iii == 0)
+            {
+                day--;
+            }
+            else
+            {
+                day = day - (7 - iii) - 1;
+            }
+            int week = ((day + 7) / 7) + 1;
+            return week;
         }
         }
     }
     }
 }
 }

+ 0 - 1
TEAMModelOS/Controllers/Import/ImportController.cs

@@ -18,7 +18,6 @@ using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.Models.Dto;
 using TEAMModelOS.Models.Dto;
-using TEAMModelOS.Models.PowerPoint;
 using TEAMModelOS.SDK;
 using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.Context.Constant.Common;
 using TEAMModelOS.SDK.Context.Constant.Common;

+ 2 - 2
TEAMModelOS/Controllers/School/StudentCommonController.cs

@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Text.Json;
 using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
+using TEAMModelOS.Filter;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models.Cosmos;
 using TEAMModelOS.SDK.Models.Cosmos;
@@ -42,11 +43,10 @@ namespace TEAMModelOS.Controllers
         /// <returns></returns>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [ProducesDefaultResponseType]
         [HttpPost("find-activity")]
         [HttpPost("find-activity")]
-        [Authorize(Roles = "student")]
+        [AuthToken(Roles = "teacher")]
         public async Task<IActionResult> FindTch(JsonElement requert)
         public async Task<IActionResult> FindTch(JsonElement requert)
         {
         {
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
-
             (List<ActivityData> datas, string continuationToken) = await ActivityService.FindByRole("School", requert, id, _azureCosmos);
             (List<ActivityData> datas, string continuationToken) = await ActivityService.FindByRole("School", requert, id, _azureCosmos);
             return Ok(new { datas, continuationToken });
             return Ok(new { datas, continuationToken });
         }
         }

+ 2 - 1
TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

@@ -7,6 +7,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Text.Json;
 using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
+using TEAMModelOS.Filter;
 using TEAMModelOS.Models;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Extension;
@@ -44,7 +45,7 @@ namespace TEAMModelOS.Controllers
         /// <returns></returns>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [ProducesDefaultResponseType]
         [HttpPost("find-activity")]
         [HttpPost("find-activity")]
-        [Authorize(Roles = "teacher")]
+        [AuthToken(Roles = "teacher")] 
         public async Task<IActionResult> FindTch(JsonElement requert)
         public async Task<IActionResult> FindTch(JsonElement requert)
         {
         {
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();

+ 0 - 19
TEAMModelOS/Models/PowerPoint/Border.cs

@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public  class Border
-    {
-
-        public double width { get; set; }
-        public string color { get; set; }
-        public string type { get; set; }
-        /// <summary>
-        /// 描边
-        /// </summary>
-        public string stroke{ get; set; }
-        public string dir { get; set; }
-    }
-}

+ 0 - 173
TEAMModelOS/Models/PowerPoint/Chart.cs

@@ -1,173 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public   class Chart : Item
-    {
-        public  List<CommonChart> charts { get; set; }
-        public List<Paragraph> title { get; set; }
-    }
-
-    public abstract class CommonChart {
-        /// <summary>
-        ///  bar col line pie area scatter radar plotAreaRegion stock surface
-        /// </summary>
-        public string chartType { get; set; }
-        public List<Dictionary<string, object>> datas {get;set;}
-    }
-
-    /// <summary>
-    /// surface3DChart
-    ///     三维曲面图  wireframe=0
-    ///     三维线框曲面图 wireframe=1
-    ///  surfaceChart
-    ///     曲面图  wireframe=0
-    ///     曲面图-俯视框架图  wireframe=1
-    /// </summary>
-    public class SurfaceChart : CommonChart
-    {
-        public string surfaceType { get; set; }
-        public bool is3D { get; set; }
-    }
-    /// <summary>
-    /// stockChart
-    ///     股价图 
-    ///         盘高-盘低-收盘
-    ///         开盘-盘高-盘低-收盘
-    ///         成交量-盘高-盘低-收盘
-    ///         成交量-开盘-盘高-盘低-收盘
-    /// </summary>
-    public class StockChart : CommonChart
-    {
-        public string stockType { get; set; }
-    }
-    /// <summary>
-    /// plotAreaRegion
-    ///     旭日图 sunburst  
-    ///     树状图 treemap
-    ///     直方图 排列图 clusteredColumn
-    ///     箱型图 boxWhisker
-    ///     瀑布图 waterfall
-    /// </summary>
-    public class PlotAreaChart : CommonChart
-    {
-        public string plotAreaType { get;set;}
-    }
-    /// <summary>
-    ///  type radar
-    ///  radarChart  
-    ///     雷达图 
-    ///     带数据标记的雷达图c:radarStyle val="marker"/>
-    ///     填充雷达图 c:radarStyle val="filled"/>
-    /// </summary>
-    public class RadarChart : CommonChart
-    {
-        public string radarType { get; set; }
-    }
-    /// <summary>
-    /// type scatter
-    ///  scatterChart
-    ///     散点图 c:scatterStyle val="lineMarker"/>
-    ///     带直线的散点图 c:scatterStyle val="lineMarker"/>
-    ///     带直线和数据标记的散点图c:scatterStyle val="lineMarker"/>
-    ///     
-    ///     带平滑线和数据标记的散点图c:scatterStyle val="smoothMarker"/>
-    ///     带平滑线的散点图c:scatterStyle val="smoothMarker"/>
-    ///  bubbleChart 气泡图   三维气泡图
-    /// </summary>
-    public class ScatterChart : CommonChart
-    {
-        public string scatterType { get; set; }
-       // public bool Is3D { get; set; }
-    }
-    /// <summary>
-    /// type area
-    /// areaChart
-    ///     面积图 standard
-    ///     堆积面积图 stacked
-    ///     百分比堆积面积图 percentStacked
-    /// area3DChart
-    ///     三维面积图 standard
-    ///     三维堆积面积图 stacked
-    ///     三维百分比堆积面积图 percentStacked
-    /// </summary>
-    public class AreaChart : CommonChart
-    {
-        public string areaType { get; set; }
-        public bool is3D { get; set; }
-    }
-    /// <summary>
-    /// type bar  条形图c:barDir val="bar"/>   
-    ///  barChart
-    ///     簇状条形图 clustered
-    ///     堆积条形图 stacked
-    ///     百分比堆积条形图 percentStacked
-    ///  bar3DChart
-    ///     三维堆积条形图 stacked
-    ///     三维簇状条形图 clustered
-    ///     三维百分比堆积条形图 percentStacked
-    /// </summary>
-    public class BarChart : CommonChart
-    {
-        public string barType { get; set; }
-        public bool is3D { get; set; }
-    }
-    /// <summary>
-    ///  type bar  柱状图c:barDir val="col"/>
-    ///  barChart
-    ///     簇状柱形图 clustered
-    ///     堆积柱形图 stacked
-    ///     百分比堆积柱形图 percentStacked
-    ///  bar3DChart
-    ///     三维堆积柱形图 stacked
-    ///     三维簇状柱形图 clustered
-    ///     三维百分比堆积柱形图 percentStacked
-    ///     三维柱形图 standard
-    /// </summary>
-    public class ColChart : CommonChart
-    {
-        public string colType { get; set; }
-        public bool is3D { get; set; }
-    }
-    /// <summary>
-    ///  type line   
-    ///  lineChart
-    ///  合并
-    ///     折线图 standard
-    ///     带数据标记的折线图 standard 
-    ///  合并
-    ///     堆积折线图 stacked
-    ///     带标记的堆积折线图 stacked  c:layout>不为空
-    ///  合并 
-    ///     百分比堆积折线图 percentStacked
-    ///     带数据标记的百分比堆积折线图 percentStacked
-    ///  line3DChart
-    ///     三维折线图 standard
-    /// </summary>
-    public class LineChart : CommonChart
-    {
-        public string lineType { get; set; }
-        public bool is3D { get; set; }
-    }
-    
-    /// <summary>
-    ///   type pie
-    ///  pieChart
-    ///     饼图  不包含   
-    ///  ofPieChart
-    ///     子母饼图   包含 c:ofPieType val="pie"/> 且val为 pie
-    ///     复合条饼图 包含 c:ofPieType val="bar"/> 且val为 bar
-    ///  pie3DChart
-    ///     三维饼图
-    ///  doughnutChart
-    ///     圆环饼图
-    /// </summary>
-    public class PieChart : CommonChart
-    {
-        public string pieType { get; set; }
-        public bool is3D { get; set; }
-    }
-
-}

+ 0 - 20
TEAMModelOS/Models/PowerPoint/Connector.cs

@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-
-    public class Connector : Item
-    {
-        
-        /// <summary>
-        ///连接线 p:cxnSp
-        /// </summary>
-        public string cxnType { get; set; }
-        //public string HeadEnd { get; set; }
-        //public string TailEnd { get; set; }
-        public Border border { get; set; }
-      
-    }
-}

+ 0 - 11
TEAMModelOS/Models/PowerPoint/Diagram.cs

@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Diagram :Item
-    {
-        public List<Item> shapes { get; set; }
-    }
-}

+ 0 - 47
TEAMModelOS/Models/PowerPoint/Fill.cs

@@ -1,47 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Fill
-    {
-
-        public Fill() {
-            grad = new List<string>();
-        }
-        /// <summary>
-        /// [a:noFill, solidFill, gradFill, blipFill, pattFill,        grpFill]
-        ///0,无填充 1.纯色填充 2.渐变填充 3.图片或纹理填充 4.图案填充
-        /// </summary>
-        public int type { get; set; }
-        public string color { get; set; }
-        public string image { get; set; }
-        public FillStyle style { get; set; }
-        //[Newtonsoft.Json.JsonIgnore]
-        //[System.Text.Json.Serialization.JsonIgnore]
-        //public string SvgText { get; set; }
-        //[Newtonsoft.Json.JsonIgnore]
-        //[System.Text.Json.Serialization.JsonIgnore]
-        //public string HtmlText { get; set; }
-        //渐变填充投射方向
-        public double rot { get; set; }
-        //渐变填充  以及前景色 背景色 的图案填充  颜色列表
-        public List<string> grad { get; set; }
-        /// <summary>
-        /// 图案填充的内置图形 ltDnDiag 等 48种内置图案
-        /// </summary>
-        public string patt { get; set; }
-
-    }
-    /// <summary>
-    /// 填充图片偏移量px
-    /// </summary>
-    public class FillStyle {
-        public int left { get; set; } = 0;
-        public int top { get; set; } = 0;
-        public int right { get; set; } = 0;
-        public int bottom { get; set; } = 0;
-    }
-
-}

+ 0 - 25
TEAMModelOS/Models/PowerPoint/FontStyle.cs

@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public  class FontStyle
-    {
-        /// <summary>
-        /// 
-        /// font-family、font-style、font-weight、font-variant、font-stretch、font-size、font-size-adjust、
-        /// kerning、letter-spacing、word-spacing和text-decoration
-        /// </summary>
-        public string color { get; set; }
-        public double size { get; set; }
-        //inherit  继承父级
-        public string family { get; set; }
-        public string weight { get; set; }
-        public string style { get; set; }
-        public string decoration { get; set; }
-        public string vertAlign { get; set; }
-        public string align { get; set; }
-        public string shadow { get; set; }
-    }
-}

+ 0 - 11
TEAMModelOS/Models/PowerPoint/Group.cs

@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public  class Group : Item
-    {
-        public List<Item> shapes { get; set; }
-    }
-}

+ 0 - 43
TEAMModelOS/Models/PowerPoint/Htex.cs

@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Htex
-    {
-        public Htex() {
-            slides = new List<string>();
-            //size = new PptSize();
-            //FontStyles = new Dictionary<string, FontStyle>();
-            //Fills = new Dictionary<string, Fill>();
-            //ParagraphStyles = new Dictionary<string, ParagraphStyle>();
-            //BuChars = new Dictionary<string, BuChar>();
-            //Borders = new Dictionary<string, Border>();
-
-        }
-        public HtexSize size { get; set; }
-        //缩略图
-        public string thumbnail { get; set; }
-        //PPT幻灯片集合
-        //  public List<string> HiXmls { get; set; }
-        public List<string> slides { get; set; }
-        // public string PptUrl { get; set; }
-        // public string Sha1Code { get; set; }
-        //页数
-        public int page { get; set; }
-
-        //public Dictionary<string, FontStyle> FontStyles { get;set;}
-        //public Dictionary<string, Fill> Fills { get; set; }
-        //public Dictionary<string, ParagraphStyle> ParagraphStyles { get; set; }
-        //public Dictionary<string, BuChar> BuChars { get; set; }
-        //public Dictionary<string, Border> Borders { get; set; }
-    }
-    public class HtexSize
-    {
-        //宽度
-        public double width { get; set; }
-        //高度
-        public double height { get; set; }
-    }
-}

+ 0 - 30
TEAMModelOS/Models/PowerPoint/Inner/WarpObj.cs

@@ -1,30 +0,0 @@
-using TEAMModelOS.Models.PowerPoint;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class WarpObj
-    {
-        public XmlDocument zip { get; set; }
-        public NodesTable slideLayoutTables { get; set; }
-        public NodesTable slideMasterTables { get; set; }
-        public XmlNode slideMasterTextStyles { get; set; }
-        public Dictionary<string, Dictionary<string, string>> slideResObj { get; set; }
-        public Dictionary<string, Dictionary<string, string>> layoutResObj { get; set; }
-        public Dictionary<string, Dictionary<string, string>> masterResObj { get; set; }
-        public XmlNode slideLayoutContent { get; set; }
-        public XmlNode slideMasterContent { get; set; }
-        public XmlNode themeContent { get; set; }
-        public XmlNode tableStyles { get; set; }
-        public Htex htex { get; set; }
-    }
-
-
-}public class NodesTable { 
-    public Dictionary<string, XmlNode> idTable { get; set; }
-    public Dictionary<string, XmlNode> idxTable { get; set; }
-    public Dictionary<string, XmlNode> typeTable { get; set; }
-}

+ 0 - 23
TEAMModelOS/Models/PowerPoint/Item.cs

@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public abstract class Item
-    {
-        // Sp  CxnSp Media Group  Table Chart Diagram
-        public string type { get; set; }
-        public Position position { get; set; }
-      //  public string Xml { get; set; }
-        public int index { get; set; }
-        public Svg svg { get; set; }
-
-        public string uid { get; set; } = Guid.NewGuid().ToString();
-        //public Picture Picture { get; set; }
-        //public Shape Shape { get; set; }
-        //public Math Math { get; set; }
-        //public Table Table { get; set; }
-        //public Chart Chart { get; set; }
-    }
-}

+ 0 - 17
TEAMModelOS/Models/PowerPoint/Math.cs

@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Math : Item
-    {
-    
-        public string content { get; set; }
-        
-        public Fill fill { get; set; }
-        
-        public Border border { get; set; }
-      
-    }
-}

+ 0 - 21
TEAMModelOS/Models/PowerPoint/Media.cs

@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public   class Media : Item
-    {
-        //image 图片 video.视频 audio 音频
-        public string mediaType { get; set; }
-        //视频资源链接
-        public string url { get; set; }
-        //图片或视频音频缩略图链接
-        public string image { get; set; }
-     
-        public Fill fill { get; set; }
-      
-        public Border border { get; set; }
-     
-    }
-}

+ 0 - 54
TEAMModelOS/Models/PowerPoint/Paragraph.cs

@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Paragraph
-    {
-         
-        public ParagraphStyle style { get; set; }
-        public Paragraph() {
-            texts = new List<Text>();
-        }
- 
-        public BuChar buChar { get; set; }
-        public List<Text> texts { get; set; }
-       
-    }
-    public class Text
-    {
-      //  public string StyleSha { get; set; }
-        public string content { get; set; }
-        public string href { get; set; }
-        public bool isbr { get; set; } = false;
-        
-        public FontStyle style { get; set; }
-    }
-
-    public class BuChar {
-        //TYPE_BULPIC  TYPE_NUMERIC TYPE_BULLET  TYPE_NONE  没有图标的 只有缩进
-        public string type{ get; set; }
-        public double left { get; set; }
-        public double riht { get; set; }
-        public string buchar { get; set; }
-        public string typeface { get; set; }
-        public double  size { get; set; }
-        public string @float { get; set; }
-        /// <summary>
-        /// ltr	默认。文本方向从左到右
-        /// rtl	文本方向从右到左。
-        /// inherit	规定应该从父元素继承 direction 属性的值。
-        /// </summary>
-        public string direction { get; set; } = "inherit";
-    }
-
-    public class ParagraphStyle
-    {
-        public string vert { get; set; }
-        // public string LeftMargin { get; set; }
-        public string hori { get; set; }
-        public string writing { get; set; }
-      
-    }
-}

+ 0 - 34
TEAMModelOS/Models/PowerPoint/Position.cs

@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Position
-    {
-        //旋转角度
-        public double rot { get; set; } = 0;
-        //水平翻转
-        public int flipH { get; set; } = 0;
-        //垂直翻转
-        public int flipV { get; set; } = 0;
-        //x轴
-        public double x { get; set; } = 0;
-        //y轴
-        public double y { get; set; } = 0;
-        //宽度
-        public double cx { get; set; } = 0;
-        //高度
-        public double cy { get; set; } = 0;
-        ////初始坐标x
-        //public Int64 ChX { get; set; } = 0;
-        ////初始坐标Y
-        //public Int64 ChY { get; set; } = 0;
-        ////拉伸宽度
-        //public Int64 ChCX { get; set; } = 0;
-        ////拉伸高度
-        //public Int64 ChCY { get; set; } = 0;
-        //层级
-      
-    }
-}

+ 0 - 121
TEAMModelOS/Models/PowerPoint/Shape.cs

@@ -1,121 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-     public class Shape : Item
-    { 
-        public string shapeType;
-        public List<Paragraph> paragraph { get; set; }
-        public Fill fill { get; set; }
-        public Border border { get; set; }
-       
-        //public List<ShapeGuide> ShapeGuides { get; set; }
-        //public List<Path> Paths { get; set; }
-        //public string BorderSha { get; set; }
-        //public string FillSha { get; set; }
-
-    }
-
-    public class Svg {
-        public string id { get; set; }
-        //public string Width { get; set; }
-        //public string Height { get; set; }
-        //public string Top { get; set; }
-        //public string Left { get; set; }
-        //public string Style { get; set; }
-        public List<SvgShape> svgShape { get; set; }
-        //public string Defs { get; set; }
-      //  public string Transform { get; set; }
-  
-       // public string SvgData { get; set; }
-       
-    }
-
-    public abstract class SvgShape {
-        // rect ,circle ,ellipse ,line ,polygon ,polyline ,path
-        public string type { get; set; }
-       // public string Style { get; set; }
-       // public string Stroke { get; set; }
-        //描边的不透明度
-       // public string StrokeOpacity { get; set; } = "1";
-      //  public string StrokeWidth { get; set; }
-        // 虚线类型描边
-       // public string StrokeDasharray { get; set; }
-       // public string Fill { get; set; }
-        public string transform { get; set; }
-        public string start { get; set; }
-        public string end { get; set; }
-        //填充色的不透明度
-        //  public string FillOpacity { get; set; } = "1";
-    }
-    public class Rect : SvgShape
-    { 
-        //矩形左上角的x位置
-        public string x { get; set; }
-        //矩形左上角的y位置
-        public string y { get; set; }
-        //矩形的宽度
-        public string width { get; set; }
-        //矩形的高度
-        public string height { get; set; }
-        // 圆角的x方位的半径
-        public string rx { get; set; }
-        // 圆角的y方位的半径
-        public string ry { get; set; }
-    }
-    public class Circle : SvgShape
-    {
-        //圆的半径
-        public string r { get; set; }
-        //圆心的x位置
-        public string cx { get; set; }
-        //圆心的y位置
-        public string cy { get; set; }
-    }
-    public class Ellipse : SvgShape
-    {
-        // 椭圆的x方位的半径
-        public string rx { get; set; }
-        // 椭圆的y方位的半径
-        public string ry { get; set; }
-
-        //椭圆的x位置
-        public string cx { get; set; }
-        //椭圆的y位置
-        public string cy { get; set; }
-    }
-    public class Line : SvgShape
-    {
-        //起点的x位置
-        public string x1 { get; set; }
-        //起点的Y位置
-        public string y1 { get; set; }
-        //终点的X位置
-        public string x2 { get; set; }
-        //终点的Y位置
-        public string y2 { get; set; }
-    }
-    public class Polyline : SvgShape
-    {
-        /// <summary>
-        /// 点集数列。每个数字用空白、逗号、终止命令符或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。
-        /// </summary>
-        public string points { get; set; }
-    }
-    public class Polygon : SvgShape
-    {
-        /// <summary>
-        /// 点集数列。每个数字用空白符、逗号、终止命令或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。
-        /// 所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。路径绘制完后闭合图形,所以最终的直线将从位置(2,2)连接到位置(0,0)。
-        /// </summary>
-        public string points { get; set; }
-
-    }
-    public class SvgPath : SvgShape
-    {
-        public string d { get; set; }
-    
-    }
-}

+ 0 - 26
TEAMModelOS/Models/PowerPoint/Slide.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using TEAMModelOS.Models;
-using TEAMModelOS.SDK.Models;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Slide
-    {
-        public List<Item> item { get; set; }
-        public Fill fill { get; set; }
-        public int index { get; set; }
-        //宽度
-        public double width { get; set; }
-        //高度
-        public double height { get; set; }
-        public ItemInfo exercise { get; set; }
-        //1 PPTX  2 HTML  来源
-        public int source { get; set; }
-        /// <summary>
-        /// 1默认为普通页面,2为题目
-        /// </summary>
-        public int flag { get; set; } 
-    }
-}

+ 0 - 45
TEAMModelOS/Models/PowerPoint/Table.cs

@@ -1,45 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.Models.PowerPoint
-{
-    public class Table :Item
-    {
-        public Table() {
-            tr = new List<Tr>();
-        }
-        //内容排版方向 左书写 右书写
-        public string dir { get; set; }
-        public string collapse { get; set; } = "collapse";
-       // public Border Border { get; set; }
-       // public Fill Fill { get; set; }
-        public List<Tr> tr { get; set; }
-    }
-
-    public class Tr {
-        public Tr()
-        {
-            td = new List<Td>();
-        }
-       
-        public Fill fill { get; set; }
-        public  double height { get; set; }
-        public List<Td> td { get; set; }
-    
-        public List<Border> borders { get; set; }
-    }
-    public class Td
-    {
-        public double width { get; set; }
-    
-        public Fill fill { get; set; }
-        public int rowspan { get; set; }
-        public int colspan { get; set; }
-
-        public int vmerge { get; set; }
-        public int hmerge { get; set; }
-        public List<Paragraph> paragraphs { get; set; }
-      
-    }
-}