增加项目,分层
This commit is contained in:
1 parent
6e995a5bdb
commit
0a3e5af6a9
234 files changed
+26994
-1
No files matched your search
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Framework.Models
|
||||
{
|
||||
public class Cookies : Dictionary<string, string>
|
||||
{
|
||||
private readonly string oldCookie;
|
||||
public Cookies(string cookie)
|
||||
{
|
||||
oldCookie = cookie;
|
||||
SplitCookie(oldCookie);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cookie字符串
|
||||
/// </summary>
|
||||
public string CookieString
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetCookieString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拆分Cookie
|
||||
/// </summary>
|
||||
private void SplitCookie(string cookie)
|
||||
{
|
||||
this.Clear();
|
||||
Regex regCookie = new Regex("(?<key>.+?)=(?<value>.+?)(;|$)");
|
||||
if (regCookie.IsMatch(cookie))
|
||||
{
|
||||
MatchCollection matchs = regCookie.Matches(cookie);
|
||||
foreach (Match item in matchs)
|
||||
{
|
||||
string key = item.Groups["key"].Value.Trim();
|
||||
string value = item.Groups["value"].Value.Trim();
|
||||
if (!ContainsKey(key))
|
||||
{
|
||||
this.Add(key.Trim(), value.Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定值
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="defvalue">默认值</param>
|
||||
/// <returns></returns>
|
||||
public string GetValue(string key, string defvalue)
|
||||
{
|
||||
if (ContainsKey(key))
|
||||
{
|
||||
return this[key];
|
||||
}
|
||||
return defvalue;
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加或修改
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public void AddOrUpdate(string key, string value)
|
||||
{
|
||||
if (!this.ContainsKey(key))
|
||||
{
|
||||
Add(key, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
this[key] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取Cookies字符串
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual string GetCookieString()
|
||||
{
|
||||
var list = this.Select(a => { return $"{a.Key}={a.Value}"; });
|
||||
return string.Join(";", list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐式转换
|
||||
/// </summary>
|
||||
/// <param name="cookie"></param>
|
||||
public static implicit operator string (Cookies cookie)
|
||||
{
|
||||
return cookie.GetCookieString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Framework.Models.Product;
|
||||
|
||||
/// <summary>
|
||||
/// 商品类目
|
||||
/// </summary>
|
||||
public class CategoryModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int ParentId { get; set; }
|
||||
public int MainCatId { get; set; }
|
||||
|
||||
public List<CategoryModel> Childs { get; set; }
|
||||
public CategoryModel()
|
||||
{
|
||||
Childs = new List<CategoryModel>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Framework.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 商铺信息
|
||||
/// </summary>
|
||||
public class ShopBase
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Password { get; set; }
|
||||
/// <summary>
|
||||
/// Cookie信息
|
||||
public Cookies Cookie { get; set; }
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// 分组名称
|
||||
/// </summary>
|
||||
public string GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商铺提示信息
|
||||
/// </summary>
|
||||
public string Msg { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 商铺信息
|
||||
/// </summary>
|
||||
/// <typeparam name="TStatus">状态码</typeparam>
|
||||
public class ShopBase<TStatus> : ShopBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public TStatus Status { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Framework.Models
|
||||
{
|
||||
public class UserInfo
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
[JsonProperty("user_name")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[JsonProperty("password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客服-4;采购-9;上货-10;数据-11;登录-8
|
||||
/// </summary>
|
||||
[JsonProperty("group_id")]
|
||||
public int GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 注册用户Key
|
||||
/// </summary>
|
||||
[JsonProperty("user_key")]
|
||||
public string UserKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所在企业ID
|
||||
/// </summary>
|
||||
[JsonProperty("company_Id")]
|
||||
public string CompanyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业名称
|
||||
/// </summary>
|
||||
[JsonProperty("company_name")]
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
[JsonProperty("nick_name")]
|
||||
public string NickName { get; set; }
|
||||
|
||||
[JsonProperty("parent_user_name")]
|
||||
public string ParentUserName { get; set; }
|
||||
|
||||
[JsonProperty("sa_level")]
|
||||
public int SaLevel { get; set; }
|
||||
|
||||
[JsonProperty("authority")]
|
||||
public string UserAuthority { get; set; }
|
||||
|
||||
[JsonProperty("parent_authority")]
|
||||
public string ParentAuthority { get; set; }
|
||||
|
||||
[JsonProperty("forbidden_page")]
|
||||
public string ForbiddenPage { get; set; }
|
||||
|
||||
[JsonProperty("mobile")]
|
||||
public string Mobile { get; set; }
|
||||
|
||||
[JsonProperty("version")]
|
||||
public int UserVersion { get; set; }
|
||||
|
||||
[JsonProperty("version_s")]
|
||||
public string UserVersionString { get; set; }
|
||||
|
||||
[JsonProperty("authorized_amount")]
|
||||
public decimal? AuthorizedAmount { get; set; }
|
||||
|
||||
[JsonProperty("points")]
|
||||
public int Points { get; set; }
|
||||
|
||||
[JsonProperty("shop_points_per_month")]
|
||||
public int ShopPointsPerMonth { get; set; }
|
||||
|
||||
[JsonProperty("balance")]
|
||||
public decimal Balance { get; set; }
|
||||
|
||||
[JsonProperty("recharge_amount_total")]
|
||||
public decimal RechargeAmountTotal { get; set; }
|
||||
|
||||
[JsonProperty("postage_per_order")]
|
||||
public decimal? PostagePerOrder { get; set; }
|
||||
|
||||
[JsonProperty("refund_postage_per_order")]
|
||||
public decimal? RefundPostagePerOrder { get; set; }
|
||||
|
||||
[JsonProperty("gift_oem_amount_per_order")]
|
||||
public decimal GiftOemAmountPerOrder { get; set; }
|
||||
|
||||
[JsonProperty("oem_id")]
|
||||
public string OemId { get; set; }
|
||||
|
||||
[JsonProperty("oem_name")]
|
||||
public string OemName { get; set; }
|
||||
|
||||
[JsonProperty("is_oem_owner")]
|
||||
public bool IsOemOwner { get; set; }
|
||||
|
||||
[JsonProperty("end")]
|
||||
public string EndDate { get; set; }
|
||||
|
||||
[JsonProperty("qq_group_num")]
|
||||
public string QqGroupNum { get; set; }
|
||||
|
||||
[JsonProperty("qq_group_url")]
|
||||
public string QqGroupUrl { get; set; }
|
||||
|
||||
[JsonProperty("wechat_url")]
|
||||
public string WechatUrl { get; set; }
|
||||
|
||||
[JsonProperty("pinduoduo")]
|
||||
public string Pinduoduo { get; set; }
|
||||
|
||||
[JsonProperty("alimama_domain")]
|
||||
public string AlimamaDomain { get; set; }
|
||||
|
||||
[JsonProperty("alimama_pid")]
|
||||
public string AlimamaPid { get; set; }
|
||||
|
||||
[JsonProperty("is_lock")]
|
||||
public int LockUserName { get; set; }
|
||||
|
||||
[JsonProperty("is_weak_password")]
|
||||
public int WeakPassword { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string MessageInfo { get; set; }
|
||||
|
||||
[JsonProperty("agent_auth")]
|
||||
public string AgentAuth { get; set; }
|
||||
|
||||
[JsonProperty("is_import")]
|
||||
public bool IsImport { get; set; }
|
||||
|
||||
[JsonProperty("card_id")]
|
||||
public string CardId { get; set; }
|
||||
|
||||
[JsonProperty("is_sa")]
|
||||
public bool IsSa { get; set; }
|
||||
|
||||
[JsonProperty("add_time")]
|
||||
public DateTime AddTime { get; set; }
|
||||
|
||||
[JsonProperty("mdy_time")]
|
||||
public DateTime MdyTime { get; set; }
|
||||
|
||||
[JsonProperty("notes")]
|
||||
public string Notes { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user