| | |
| | | using System;
|
| | | using Shared.Common;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Shared.Phone.UserCenter
|
| | |
| | | /// <summary>
|
| | | /// 用户图标文件
|
| | | /// </summary>
|
| | | [Newtonsoft.Json.JsonIgnore]
|
| | | public string UserIconFile = string.Empty;
|
| | | /// <summary>
|
| | | /// 用户图标文件是否改变
|
| | | /// </summary>
|
| | | [Newtonsoft.Json.JsonIgnore]
|
| | | public bool UserIconFileChanged = false;
|
| | | /// <summary>
|
| | | /// 用户头像数据(临时用,会置空)
|
| | | /// </summary>
|
| | | public byte[] HeadImage = null;
|
| | | /// <summary>
|
| | | /// 手势密码(临时用,会置空)
|
| | | /// </summary>
|
| | | public string GesturePwd = string.Empty;
|
| | | /// <summary>
|
| | | /// 密码验证(临时用,会置空)
|
| | | /// </summary>
|
| | | public string StringPwd = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// 用户名
|
| | | /// </summary>
|
| | | public string UserName = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 昵称信息
|
| | | /// </summary>
|
| | | public class NicknameInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 昵称
|
| | | /// </summary>
|
| | | public string nickname = string.Empty;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// AccountType
|
| | | /// </summary> |
| | | public int AccountType = 0;
|
| | | /// <summary>
|
| | | /// 是否拥有远程控制权限
|
| | | /// </summary>
|
| | | public bool IsAllowRemoteCtrl = false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// 手机号
|
| | | /// </summary>
|
| | | public string Phone = string.Empty;
|
| | | /// <summary>
|
| | | /// 头像数据
|
| | | /// </summary>
|
| | | public byte[] HeadImage = null;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <summary>
|
| | | /// Page
|
| | | /// </summary>
|
| | | public int Page = 0;
|
| | | public int Page = 1;
|
| | | /// <summary>
|
| | | /// PageSize
|
| | | /// </summary>
|
| | |
| | | public class MemberShardInfoData
|
| | | {
|
| | | /// <summary>
|
| | | /// 成员的全部分享数据,里面包含所有的文件(keys:房间文件名 value:文件名)
|
| | | /// </summary>
|
| | | public Dictionary<string, HashSet<string>> dicAllMemberShard = new Dictionary<string, HashSet<string>>();
|
| | | /// <summary>
|
| | | /// 全部的分享文件的主键(keys:文件名 value:主键)
|
| | | /// </summary>
|
| | | public Dictionary<string, string> dicAllShardKeys = new Dictionary<string, string>();
|
| | | /// <summary>
|
| | | /// 分享房间的对象(它是从云端来的)
|
| | | /// 分享房间的对象(它是从云端来的,keys:文件名)
|
| | | /// </summary>
|
| | | public Dictionary<string, Common.Room> dicShardRoom = new Dictionary<string, Common.Room>();
|
| | | public Dictionary<string, Room> dicShardRoom = new Dictionary<string, Common.Room>();
|
| | | /// <summary>
|
| | | /// 分享的楼层
|
| | | /// </summary>
|
| | | public Dictionary<string, string> dicShardFloor = new Dictionary<string, string>();
|
| | | /// <summary>
|
| | | /// 临时变量(这个东西为null,即不是新分享的房间,否则是新分享的房间。用完记得置空)
|
| | | /// </summary>
|
| | | public Room TempRoom = null;
|
| | | /// <summary>
|
| | | /// 是否需要刷新
|
| | | /// </summary>
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 账号设置类__________________________
|
| | | #region ■ 住宅信息类__________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 账号设置信息
|
| | | /// 编辑住宅的启动参数
|
| | | /// </summary>
|
| | | public class AccountOption
|
| | | public class EditorResidencePra : IfacePraCommon
|
| | | {
|
| | | /// <summary>
|
| | | /// 是否使用指纹验证
|
| | | /// RequestVersion
|
| | | /// </summary>
|
| | | public bool FingerprintAuthentication = false;
|
| | | public string RequestVersion = Common.CommonPage.RequestVersion;
|
| | | /// <summary>
|
| | | /// 密码验证
|
| | | /// LoginAccessToken
|
| | | /// </summary>
|
| | | public string PswAuthentication = string.Empty;
|
| | | public string LoginAccessToken = Common.Config.Instance.Token;
|
| | | /// <summary>
|
| | | /// 手势验证
|
| | | /// ZigbeeHomeId
|
| | | /// </summary>
|
| | | public string GestureAuthentication = string.Empty;
|
| | | public string HomeId = "";
|
| | | /// <summary>
|
| | | /// 是否使用远程开锁
|
| | | /// Name
|
| | | /// </summary>
|
| | | public bool DoorUnLockByRemote = false;
|
| | | public string Name = string.Empty;
|
| | | /// <summary>
|
| | | /// 保存
|
| | | /// 经度
|
| | | /// </summary>
|
| | | public void Save()
|
| | | public double Longitude = 0;
|
| | | /// <summary>
|
| | | /// 纬度
|
| | | /// </summary>
|
| | | public double Latitude = 0;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 消息管理类__________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取消息记录的请求参数
|
| | | /// </summary>
|
| | | public class MessageInfoPra : IfacePraCommon
|
| | | {
|
| | | /// <summary>
|
| | | /// RequestVersion
|
| | | /// </summary>
|
| | | public string RequestVersion = Common.CommonPage.RequestVersion;
|
| | | /// <summary>
|
| | | /// LoginAccessToken
|
| | | /// </summary>
|
| | | public string LoginAccessToken = Common.Config.Instance.Token;
|
| | | /// <summary>
|
| | | /// ZigbeeHomeId
|
| | | /// </summary>
|
| | | public string HomeId = Common.Config.Instance.Home.Id;
|
| | | /// <summary>
|
| | | /// 主题
|
| | | /// </summary>
|
| | | public string Topic = null;
|
| | | /// <summary>
|
| | | /// 开始时间
|
| | | /// </summary>
|
| | | public string BeginTime = null;
|
| | | /// <summary>
|
| | | /// 结束时间
|
| | | /// </summary>
|
| | | public string EndTime = null;
|
| | | /// <summary>
|
| | | /// 页数
|
| | | /// </summary>
|
| | | public PageSettingInfo PageSetting = new PageSettingInfo();
|
| | |
|
| | | public MessageInfoPra()
|
| | | {
|
| | | //加密密码
|
| | | string hdlKey = "hD1(La3o";
|
| | | string oldPswAuthentication = PswAuthentication;
|
| | | PswAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldPswAuthentication);
|
| | | |
| | | string oldGestureAuthentication = GestureAuthentication;
|
| | | GestureAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldGestureAuthentication);
|
| | |
|
| | | var data = Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
| | | var byteData = System.Text.Encoding.UTF8.GetBytes(data);
|
| | | string fullName = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, DirNameResourse.AccountOptionFile);
|
| | | //写入内容
|
| | | Shared.IO.FileUtils.WriteFileByBytes(fullName, byteData);
|
| | | //还原明码
|
| | | PswAuthentication = oldPswAuthentication;
|
| | | GestureAuthentication = oldGestureAuthentication;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 加载数据
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public AccountOption Load()
|
| | | {
|
| | | string fileName = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, DirNameResourse.AccountOptionFile);
|
| | | if (System.IO.File.Exists(fileName) == false)
|
| | | {
|
| | | return new AccountOption();
|
| | | }
|
| | | var varByte = Shared.IO.FileUtils.ReadFile(fileName);
|
| | | string strValue = System.Text.Encoding.UTF8.GetString(varByte);
|
| | | var info = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountOption>(strValue);
|
| | | //解密密码
|
| | | string hdlKey = "hD1(La3o";
|
| | | info.PswAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.PswAuthentication);
|
| | | info.GestureAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.GestureAuthentication);
|
| | |
|
| | | return info;
|
| | | PageSetting.PageSize = 50;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 消息中心的结果返回值
|
| | | /// </summary>
|
| | | public class MessageCentetInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 列表数据
|
| | | /// </summary>
|
| | | public List<MessageRecordInfo> PageData = null;
|
| | | /// <summary>
|
| | | /// PageIndex
|
| | | /// </summary>
|
| | | public int PageIndex = 0;
|
| | | /// <summary>
|
| | | /// PageSize
|
| | | /// </summary>
|
| | | public int PageSize = 0;
|
| | | /// <summary>
|
| | | /// TotalCount
|
| | | /// </summary>
|
| | | public int TotalCount = 0;
|
| | | /// <summary>
|
| | | /// TotalPages
|
| | | /// </summary>
|
| | | public int TotalPages = 0;
|
| | | /// <summary>
|
| | | /// HasPreviousPage
|
| | | /// </summary>
|
| | | public bool HasPreviousPage = false;
|
| | | /// <summary>
|
| | | /// HasNextPage
|
| | | /// </summary>
|
| | | public bool HasNextPage = false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 信息结果
|
| | | /// </summary>
|
| | | public class MessageRecordInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 主键
|
| | | /// </summary>
|
| | | public string Id = string.Empty;
|
| | | /// <summary>
|
| | | /// 主题
|
| | | /// </summary>
|
| | | public string Topic = string.Empty;
|
| | | /// <summary>
|
| | | /// 网关上报的json
|
| | | /// </summary>
|
| | | public string PayloadJson = string.Empty;
|
| | | /// <summary>
|
| | | /// 是否已读
|
| | | /// </summary>
|
| | | public bool IsReading = false;
|
| | | /// <summary>
|
| | | /// 时间 2019-09-10T13:11:55
|
| | | /// </summary>
|
| | | public string CreatedOnUtc = string.Empty;
|
| | | /// <summary>
|
| | | /// 图片地址
|
| | | /// </summary>
|
| | | public string IconPath = string.Empty;
|
| | | /// <summary>
|
| | | /// 消息类型
|
| | | /// </summary>
|
| | | public string MsgObjectText = string.Empty;
|
| | | /// <summary>
|
| | | /// 消息文本
|
| | | /// </summary>
|
| | | public string MsgText = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置消息已读状态的启动参数
|
| | | /// </summary>
|
| | | public class MessageReadStatuPra : IfacePraCommon
|
| | | {
|
| | | /// <summary>
|
| | | /// RequestVersion
|
| | | /// </summary>
|
| | | public string RequestVersion = Common.CommonPage.RequestVersion;
|
| | | /// <summary>
|
| | | /// LoginAccessToken
|
| | | /// </summary>
|
| | | public string LoginAccessToken = Common.Config.Instance.Token;
|
| | | /// <summary>
|
| | | /// ZigbeeHomeId
|
| | | /// </summary>
|
| | | public string HomeId = Common.Config.Instance.Home.Id;
|
| | | /// <summary>
|
| | | /// ID
|
| | | /// </summary>
|
| | | public string Id = string.Empty;
|
| | | /// <summary>
|
| | | /// 已读状态
|
| | | /// </summary>
|
| | | public bool IsReading = true;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 隐匿功能类__________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 隐匿功能
|
| | | /// </summary>
|
| | | public class HideOptionInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 是否显示主页隐藏菜单(Debug用): 1 -> 显示
|
| | | /// </summary>
|
| | | public int CenterHideMenu = 0;
|
| | | /// <summary>
|
| | | /// 是否出力详细Log 1 -> 出力
|
| | | /// </summary>
|
| | | public int DetailedLog = 0;
|
| | | /// <summary>
|
| | | /// 显示设备历史版本 1 -> 显示
|
| | | /// </summary>
|
| | | public int DeviceHistory = 0;
|
| | | }
|
| | | #endregion
|
| | | }
|