修改代码

增加云商品数据
This commit is contained in:
chfei committed 2026-10-14 11:53:36 +08:00
1 parent 2f406c840f
commit db4f030c17
58 files changed
+1550 -120

No files matched your search

+144
View File
@@ -0,0 +1,144 @@
using FreeSql.DataAnnotations;
using System;
namespace YourNamespace
{
/// <summary>
/// 店铺表
/// </summary>
[Table(Name = "wxxd.shop")]
public class ShopEntity
{
/// <summary>
/// 表id
/// </summary>
[Column(Name = "id", IsPrimary = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// login_name
/// </summary>
[Column(Name = "login_name")]
public string LoginName { get; set; }
/// <summary>
/// login_pass
/// </summary>
[Column(Name = "login_pass")]
public string LoginPass { get; set; }
/// <summary>
/// cookie
/// </summary>
[Column(Name = "cookie")]
public string Cookie { get; set; }
/// <summary>
/// cookie2
/// </summary>
[Column(Name = "cookie2")]
public string Cookie2 { get; set; }
/// <summary>
/// anti_contents
/// </summary>
[Column(Name = "anti_contents")]
public string AntiContents { get; set; }
/// <summary>
/// openid
/// </summary>
[Column(Name = "openid")]
public string Openid { get; set; }
/// <summary>
/// shop_id
/// </summary>
[Column(Name = "shop_id")]
public string ShopId { get; set; }
/// <summary>
/// shop_account
/// </summary>
[Column(Name = "shop_account")]
public string ShopAccount { get; set; }
/// <summary>
/// sub_user_name
/// </summary>
[Column(Name = "sub_user_name")]
public string SubUserName { get; set; }
/// <summary>
/// user_name
/// </summary>
[Column(Name = "user_name")]
public string UserName { get; set; }
/// <summary>
/// 店铺分组名称(非子账号分组)
/// </summary>
[Column(Name = "group_name")]
public string GroupName { get; set; }
/// <summary>
/// add_time
/// </summary>
[Column(Name = "add_time")]
public DateTime? AddTime { get; set; }
/// <summary>
/// mdy_time
/// </summary>
[Column(Name = "mdy_time")]
public DateTime? MdyTime { get; set; }
/// <summary>
/// 店铺所属公司
/// </summary>
[Column(Name = "company_name")]
public string CompanyName { get; set; }
/// <summary>
/// 备注
/// </summary>
[Column(Name = "notes")]
public string Notes { get; set; }
/// <summary>
/// login_status
/// </summary>
[Column(Name = "login_status")]
public string LoginStatus { get; set; }
/// <summary>
/// 店铺每月商品上传限额剩余
/// </summary>
[Column(Name = "add_product_remaining")]
public int AddProductRemaining { get; set; }
/// <summary>
/// 上传限额所处月份
/// </summary>
[Column(Name = "add_product_month")]
public byte AddProductMonth { get; set; }
/// <summary>
/// 分配的二级超管的user_name
/// </summary>
[Column(Name = "operate_sub_sa_name")]
public string OperateSubSaName { get; set; }
/// <summary>
/// 分配二级超管的时间
/// </summary>
[Column(Name = "add_sub_sa_time")]
public DateTime? AddSubSaTime { get; set; }
/// <summary>
/// login_status2
/// </summary>
[Column(Name = "login_status2")]
public string LoginStatus2 { get; set; }
}
}
@@ -0,0 +1,43 @@
using FreeSql.DataAnnotations;
using System;
namespace Store.Users.Entities
{
/// <summary>
/// 商店过期
/// </summary>
[Table(Name = "wxxd.user_points_shop_expire")]
public class ShopExpireEntity
{
/// <summary>
/// ID
/// </summary>
[Column(Name = "id", IsPrimary = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 商店ID
/// </summary>
[Column(Name = "shop_id")]
public string ShopId { get; set; }
/// <summary>
/// 过期时间
/// </summary>
// 数据库列名末尾包含 U+200C,不能改成普通 expire_time。
[Column(Name = "expire_time")]
public int ExpireTime { get; set; }
/// <summary>
/// 添加时间
/// </summary>
[Column(Name = "add_time")]
public DateTime AddTime { get; set; }
/// <summary>
/// 修改时间
/// </summary>
[Column(Name = "mdy_time")]
public DateTime MdyTime { get; set; }
}
}
@@ -0,0 +1,47 @@
using FreeSql;
using MAX.Core.DependencyInjection;
using MAX.Core.Helpers;
using Store.Users.Entities;
using System;
using System.Collections.Generic;
using System.Text;
using YourNamespace;
namespace Store.Shops.Repositories
{
public interface IShopRepository : IBaseRepository<ShopEntity>
{
/// <summary>
/// 获取用户商铺过期时间
/// </summary>
/// <param name="ShopId"></param>
/// <returns></returns>
DateTime GetExpireTime(string ShopId);
}
internal class ShopRepository : BaseRepository<ShopEntity>, IShopRepository, ITransientDependency
{
private readonly IFreeSql _freeSql;
public ShopRepository(IFreeSql freeSql) : base(freeSql)
{
_freeSql = freeSql;
}
/// <summary>
/// 获取用户商铺过期时间
/// </summary>
/// <param name="ShopId"></param>
public DateTime GetExpireTime(string ShopId)
{
ShopExpireEntity currentExpire = _freeSql.Select<ShopExpireEntity>()
.Where(a => a.ShopId == ShopId)
.ForUpdate()
.First();
if (currentExpire == null)
{
return DateTime.MinValue;
}
return DateHelper.ConvertFromUnixTimestampInSeconds(currentExpire.ExpireTime);
}
}
}
@@ -0,0 +1,23 @@
using MAX.Core.DependencyInjection;
using Store.Shops.Contracts;
using Store.Shops.Repositories;
using System;
using System.Collections.Generic;
using System.Text;
namespace Store.Shops.Services
{
internal class ShopQueryService: IShopQueryService, ITransientDependency
{
private readonly IShopRepository _shopRepository;
public ShopQueryService(IShopRepository shopRepository)
{
_shopRepository = shopRepository;
}
public DateTime GetExpireTime(string shopId)
{
return _shopRepository.GetExpireTime(shopId);
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using MAX.Core.DependencyInjection;
using MAX.Core.Interfaces;
namespace Store.Shops
{
public class Startup : IStartup
{
public int Priority => IntPriority.Normal;
public void Initialize()
{
}
public void Register(IServiceRegistrar registrar)
{
}
public void Start(IServiceProvider serviceProvider)
{
}
}
}
+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Store.Framework\Store.Framework.csproj" />
<ProjectReference Include="..\Store.Shops.Contracts\Store.Shops.Contracts.csproj" />
</ItemGroup>
</Project>