Files
KJD_WebService/AllBase/Model/Result/DouShopLoginInfo.cs
T
2025-07-07 15:46:35 +08:00

217 lines
7.2 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 DouShopLoginInfo
{
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; }
public string ShopToken { get; set; }
public string Signature { get; set; }
public string TouTiaoId { get; set; }
public string Cookies { get; set; } = "";
public Dictionary<string, string> DictMultiCookies { get; set; } = new Dictionary<string, string>();
public string LoginStatus { 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 Group { 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 SubUserName { 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;
[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>();
}
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 n = "未定义";
if (group_id == "3")
n = "主账户";
if (group_id == "4")
n = "客服";
if (group_id == "9")
n = "采购";
if (group_id == "5")
n = "加盟";
if (group_id == "10")
n = "上货";
if (group_id == "11")
n = "数据";
if (group_id == "8")
n = "登录";
return n;
}
}
public int shop_count { get; set; }
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; }
}
}