Files
KJD_WebService/AllBase/Model/Result/ShopLoginInfo.cs
T

253 lines
8.4 KiB
C#

using AllBase.Model.Param.FissionManage;
using CefSharp.WinForms;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
namespace AllBase.Model.Result
{
public class ShopLoginInfo
{
public string DbId { get; set; }
public string LoginName { get; set; }
public string Password { get; set; }
public string ShopId { get; set; } = "";
public string ShopAccount { get; set; } = "";
public string Mobile { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Notes { get; set; }
public string CompanyName { get; set; }
public string ShopToken { get; set; }
public string Signature { get; set; }
public string TouTiaoId { get; set; }
public string Cookies { get; set; } = "";
public string Cookies2 { get; set; } = "";
public Dictionary<string, string> DictMultiCookies { get; set; } = new Dictionary<string, string>();
public string LoginStatus { get; set; }
public string LoginStatus2 { get; set; }
public string ApiAuthStatus { get; set; }
public List<BrandInfo> LstBrand { get; set; }
/// <summary>
/// 客服账户
/// </summary>
public string ChatAccount
{
get
{
string accountStr = "";
foreach (var sub in this.ShopSubAccountList)
{
if (sub.group_name == "客服")
accountStr += sub.user_name + ",";
}
return accountStr.TrimEnd(',');
}
}
/// <summary>
/// 上货账户
/// </summary>
public string UploadAccount
{
get
{
string accountStr = "";
foreach (var sub in this.ShopSubAccountList)
{
if (sub.group_name == "上货")
accountStr += sub.user_name + ",";
}
return accountStr.TrimEnd(',');
}
}
/// <summary>
/// 拍单(采购)用户账户
/// </summary>
public string BuyAccount
{
get
{
string accountStr = "";
foreach (var sub in this.ShopSubAccountList)
{
if (sub.group_name == "采购")
accountStr += sub.user_name + ",";
}
return accountStr.TrimEnd(',');
}
}
public string GroupName { get; set; }
public string LastRefreshDate { get; set; }
public string AccessToken { get { return CurrentAuthInfo?.AccessToken; } }
public string RefreshToken { get { return CurrentAuthInfo?.RefreshToken; } }
public string AppKey { get { return CurrentAuthInfo?.AppKey; } }
public DateTime AddTime { get { return CurrentAuthInfo?.AddTime == null ? new DateTime() : CurrentAuthInfo.AddTime; } }
public DateTime ExpiresTime { get { return CurrentAuthInfo?.ExpiresTime == null ? new DateTime() : CurrentAuthInfo.ExpiresTime; } }
/// <summary>
/// 店铺运费模板
/// </summary>
public long ExpressId { get; set; }
/// <summary>
/// 店铺是否可上传
/// </summary>
public bool CanUpload = true;
/// <summary>
/// 店铺状态信息
/// </summary>
public string Message;
public List<AuthInfo> ApiAuthInfoList { get; set; } = new List<AuthInfo>();
public AuthInfo CurrentAuthInfo { get { return this.ApiAuthInfoList.OrderBy(a => a.ExpiresTime).LastOrDefault(); } }
/// <summary>
/// 拍单Api授权信息
/// </summary>
public AuthInfo BuyApiAuth { get; set; } = new AuthInfo();
/// <summary>
/// 主账户
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 子账户
/// </summary>
public string SubUserName { get; set; }
/// <summary>
/// 分管二级账户
/// </summary>
public string OperateSubSaName { get; set; }
/// <summary>
/// 子账户列表(抖店用)
/// </summary>
public List<DouShopSubAccountInfo> ShopSubAccountList { get; } = new List<DouShopSubAccountInfo>();
public int OnlineProductCount { get; set; } = -1;
public int OfflineProductCount { get; set; } = -1;
[JsonIgnore]
[ScriptIgnore]
[XmlIgnore]
public ChromiumWebBrowser Chat { get; set; } = null;
public int PayStatus { get; set; } = 0;
/// <summary>
/// 试用版最大上货计数,超过100限制
/// </summary>
public int TrialUploadCount { get; set; } = 0;
/// <summary>
/// 试用版最大操作计数,超过100限制
/// </summary>
public int TrialOperateCount { get; set; } = 0;
/// <summary>
/// 月选品上传限额剩余,默认40
/// </summary>
public int AddProductRemaining { get; set; }
[JsonIgnore]
[ScriptIgnore]
[XmlIgnore]
public int UploadCount { get; set; } = 0;
public int X { get; set; }
public int Y { get; set; }
public List<int> LstShopCategory { get; set; } = new List<int>();
//在一次检测中是否已检测同一个账户下的不同店铺,如果已检测,使用相同cookie即可,不用多次检测
public bool isCheckLogin { get; set; }
}
public class AuthInfo
{
public string AccessToken { get; set; } = "";
public string RefreshToken { get; set; } = "";
public string AppKey { get; set; } = "";
public DateTime ExpiresTime { get; set; }
public DateTime AddTime { get; set; }
public string ApiAuthStatus { get; set; } = "未授权";
}
public class SubAccountInfo
{
public string user_name { get; set; }
public string nick_name { get; set; }
public string mobile { get; set; }
public string group_id { get; set; }
public string group_name
{
get
{
var s = "未定义";
if (group_id == "3")
s = "主账户";
if (group_id == "4")
s = "客服";
if (group_id == "9")
s = "采购";
if (group_id == "5")
s = "加盟";
if (group_id == "10")
s = "上货";
if (group_id == "11")
s = "数据";
if (group_id == "8")
s = "登录";
return s;
}
}
public int shop_count { get; set; }
public int sa_level { get; set; }
public string sa_level_name
{
get
{
var s = "普通用户";
if (sa_level == 1)
s = "一级超管";
if (sa_level == 2)
s = "二级超管";
return s;
}
}
public int id { get; set; }
}
public class DouShopSubAccountInfo : SubAccountInfo
{
public string shop_login_name { get; set; }
public string sub_user_id { get { return id.ToString(); } set { id = value.ParseToInt(); } }
public string sub_user_name { get { return user_name; } set { user_name = value; } }
public string status { get; set; } = "1";
public string company_id { get; set; }
public string company_name { get; set; }
}
public class BrandInfo
{
public string brand_chinese_name { get; set; }
public string brand_english_name { get; set; }
public string brand_reg_num { get; set; }
public long id { get; set; }
}
// temu 一个登录账号下可以有多个店铺
public class ShopCompany
{
public string UserName { get; set; }
public string LoginName { get; set; }
public string AccountId { get; set; }
public string AccountName { get; set; }
public string LoginStatus { get; set; }
}
}