using MessagePack;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XPrintServer.DataModel.Models
{
    ///<summary>
    ///模型表
    ///</summary>
    [SugarIndex("idx_{split_table}_create_time", nameof(CreateTime), OrderByType.Desc)]
    [SplitTable(SplitType.Year)]//按年分表 （自带分表支持 年、季、月、周、日）
    [SugarTable("model_{year}{month}{day}")]//3个变量必须要有，这么设计为了兼容开始按年，后面改成按月、按日
    public partial class Model
    {
        public Model()
        {
        }

        /// <summary>
        /// Desc:Id
        /// Default:
        /// Nullable:False
        /// </summary>           
        [Key("Id")]
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键Id")]
        public Guid Id { get; set; }

        /// <summary>
        /// Desc:模型名
        /// Default:
        /// Nullable:False
        /// </summary>    
        [Key("ModelName")]
        [SugarColumn(IsNullable = false, ColumnDescription = "模型名")]
        public string ModelName { get; set; } = null!;

        /// <summary>
        /// Desc:模型名
        /// Default:
        /// Nullable:False
        /// </summary>    
        [Key("ModelPath")]
        [SugarColumn(IsNullable = false, ColumnDescription = "模型路径")]
        public string ModelPath { get; set; } = null!;


        /// <summary>
        /// Desc:模型名
        /// Default:
        /// Nullable:False
        /// </summary>    
        [Key("ModelPictureUrl")]
        [SugarColumn(IsNullable = true, ColumnDescription = "模型预览图")]
        public string? ModelPictureUrl { get; set; } = null;


        /// <summary>
        /// Desc:模型场景Y坐标偏移值
        /// Nullable:False
        /// </summary>    
        [Key("OffsetY")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景Y坐标偏移值")]
        public float OffsetY { get; set; } = 0f;


        /// <summary>
        /// Desc:摄像头最小可视范围
        /// Nullable:False
        /// </summary>    
        [Key("MinZ")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头最小可视范围")]
        public float MinZ { get; set; } = 0f;

        /// <summary>
        /// Desc:摄像头最大可视范围
        /// Nullable:False
        /// </summary>    
        [Key("MaxZ")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头最大可视范围")]
        public float MaxZ { get; set; } = 0f;


        /// <summary>
        /// Desc:模型场景摄像头最小Beta值
        /// Nullable:False
        /// </summary>    
        [Key("LowerBetaLimit")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头最小Beta值")]
        public float LowerBetaLimit { get; set; } = 0f;

        /// <summary>
        /// Desc:模型场景摄像头最大Beta值
        /// Nullable:False
        /// </summary>    
        [Key("UpperBetaLimit")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头最大Beta值")]
        public float UpperBetaLimit { get; set; } = 0f;


        /// <summary>
        /// Desc:模型场景摄像头最小Radius值
        /// Nullable:False
        /// </summary>    
        [Key("LowerRadiusLimit")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头最小Radius值")]
        public float LowerRadiusLimit { get; set; } = 0f;

        /// <summary>
        /// Desc:模型场景摄像头最大Radius值
        /// Nullable:False
        /// </summary>    
        [Key("UpperRadiusLimit")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头最大Radius值")]
        public float UpperRadiusLimit { get; set; } = 0f;


        /// <summary>
        /// Desc:模型场景摄像头Alpha值
        /// Nullable:False
        /// </summary>    
        [Key("Alpha")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头Alpha值")]
        public float Alpha { get; set; } = 0f;

        /// <summary>
        /// Desc:模型场景摄像头Beta值
        /// Nullable:False
        /// </summary>    
        [Key("Alpha")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头Beta值")]
        public float Beta { get; set; } = 0f;

        /// <summary>
        /// Desc:模型场景摄像头Radius值
        /// Nullable:False
        /// </summary>    
        [Key("Alpha")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "模型场景摄像头Radius值")]
        public float Radius { get; set; } = 0f;

        /// <summary>
        /// Desc:模型场景摄像头Radius值
        /// Nullable:False
        /// </summary>    
        [Key("WheelDeltaPercentage")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "鼠标滚轮缩放速度")]
        public float WheelDeltaPercentage { get; set; } = 0f;

        /// <summary>
        /// Desc:模型场景摄像头Radius值
        /// Nullable:False
        /// </summary>    
        [Key("PinchDeltaPercentage")]
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "双指缩放速度")]
        public float PinchDeltaPercentage { get; set; } = 0f;

        [Key("CreateTime")]
        [SplitField] //分表字段 在插入的时候会根据这个字段插入哪个表，在更新删除的时候用这个字段找出相关表
        public DateTime CreateTime { get; set; }

    }
}
