This commit is contained in:
chfei committed 2026-09-15 16:08:14 +08:00
1 parent 085f275620
commit 256a0c24f9
11 files changed
+198 -147

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Store.Framework.Enums;
/// <summary>
/// 商铺状态
/// </summary>
public enum ShopStatus
{
}
+44
View File
@@ -0,0 +1,44 @@
using Store.Framework.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Store.Framework.Inerterfaces;
public interface IShop
{
/// <summary>
/// 商铺Id
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 商铺名
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 登录密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// Cookie信息
/// </summary>
public Cookies Cookie { get; set; }
/// <summary>
/// 分组名称
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 商铺提示信息
/// </summary>
public string Msg { get; set; }
/// <summary>
/// 是否登录成功
/// </summary>
public bool IsLoggedIn { get; set; }
}
+36 -39
View File
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using Store.Framework.Inerterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -7,48 +8,44 @@ using System.Threading.Tasks;
namespace Store.Framework.Models
{
/// <summary>
/// 商铺信息
/// </summary>
public abstract class ShopBase
{
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// 商铺信息
/// </summary>
public abstract class ShopBase : IShop
{
public int Id { get; set; }
/// <summary>
/// 商铺Id
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 商铺名
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 登录密码
/// </summary>
[JsonProperty("shop_account")]
public string Name { get; set; }
public string Password { get; set; }
[JsonProperty("login_pass")]
public string Password { get; set; }
/// <summary>
/// Cookie信息
/// </summary>
public Cookies Cookie { get; set; }
/// <summary>
/// Cookie信息
/// </summary>
[JsonProperty("cookie")]
public Cookies Cookie { get; set; }
/// <summary>
/// 分组名称
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 分组名称
/// </summary>
[JsonProperty("group_name")]
public string GroupName { get; set; }
/// <summary>
/// 商铺提示信息
/// </summary>
public string Msg { get; set; }
/// <summary>
/// 是否登录成功
/// </summary>
public bool IsLoggedIn { get; set; }
/// <summary>
/// 商铺提示信息
/// </summary>
[JsonProperty("login_status")]
public string Msg { get; set; }
}
/// <summary>
/// 商铺信息
/// </summary>
/// <typeparam name="TStatus">状态码</typeparam>
public abstract class ShopBase<TStatus> : ShopBase
{
/// <summary>
/// 状态
/// </summary>
public TStatus Status { get; set; }
}
}
}
+1 -1
View File
@@ -107,7 +107,7 @@ namespace Store.Client.Services
foreach (Match match in matches)
{
string key = match.Groups["key"].Value;
Shop shop = shops.FirstOrDefault(s => s.Id == key || s.Name == key);
Shop shop = shops.FirstOrDefault(s => s.Id == key || s.ShopName == key);
if (shop == null)
continue;