更新框架,增加云库搜索模块
This commit is contained in:
1 parent
8526e5e0d2
commit
f2caec6083
192 files changed
+3626
-804
No files matched your search
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Store.Framework.Base
|
||||
{
|
||||
[ApiController]
|
||||
public class AppControllerBase : ControllerBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Store.Framework.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户实体
|
||||
/// </summary>
|
||||
//[Table(Name = "user")]
|
||||
public class User
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID,主键,自增
|
||||
/// </summary>
|
||||
[Column(Name = "id", IsPrimary = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[Column(Name = "nick_name", DbType = "varchar(50)")]
|
||||
public string NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户名称(登录账户)
|
||||
/// </summary>
|
||||
[Column(Name = "user_name", DbType = "varchar(20)")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录密码
|
||||
/// </summary>
|
||||
[Column(Name = "password", DbType = "varchar(32)")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证号
|
||||
/// </summary>
|
||||
[Column(Name = "card_id", DbType = "varchar(50)")]
|
||||
public string CardId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户分组:3主号 4客服 5加盟 8登录 9采购 10加盟 11上货,默认10
|
||||
/// </summary>
|
||||
[Column(Name = "group_id")]
|
||||
public byte GroupId { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 父账户用户名
|
||||
/// </summary>
|
||||
[Column(Name = "parent_user_name", DbType = "varchar(20)")]
|
||||
public string ParentUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OEM编号,仅OEM用户有值
|
||||
/// </summary>
|
||||
[Column(Name = "oem_id", DbType = "varchar(20)")]
|
||||
public string OemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[Column(Name = "mobile", DbType = "varchar(20)")]
|
||||
public string Mobile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 添加时间
|
||||
/// </summary>
|
||||
[Column(Name = "add_time")]
|
||||
public DateTime? AddTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
[Column(Name = "mdy_time")]
|
||||
public DateTime? MdyTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公司名称
|
||||
/// </summary>
|
||||
[Column(Name = "company_name", DbType = "varchar(50)")]
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Column(Name = "notes", DbType = "varchar(50)")]
|
||||
public string Notes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 超管等级:0普通用户 1超级管理员,默认0
|
||||
/// </summary>
|
||||
[Column(Name = "sa_level")]
|
||||
public short SaLevel { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 账户权限
|
||||
/// </summary>
|
||||
[Column(Name = "authority", DbType = "varchar(255)")]
|
||||
public string Authority { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子账号被禁止展示的功能页面
|
||||
/// </summary>
|
||||
[Column(Name = "forbidden_page", DbType = "varchar(500)")]
|
||||
public string ForbiddenPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账户积分,1积分=1元,默认0.00
|
||||
/// </summary>
|
||||
[Column(Name = "points", DbType = "decimal(10,2)")]
|
||||
public decimal Points { get; set; } = 0.00m;
|
||||
|
||||
/// <summary>
|
||||
/// 积分历史累计充值金额
|
||||
/// </summary>
|
||||
[Column(Name = "recharge_points_total", DbType = "decimal(10,2)")]
|
||||
public decimal? RechargePointsTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 店铺每续费一个月需要的积分(单位:元),默认30
|
||||
/// </summary>
|
||||
[Column(Name = "shop_points_per_month")]
|
||||
public int ShopPointsPerMonth { get; set; } = 30;
|
||||
|
||||
/// <summary>
|
||||
/// 可用余额,默认0.00
|
||||
/// </summary>
|
||||
[Column(Name = "balance", DbType = "decimal(10,2)")]
|
||||
public decimal? Balance { get; set; } = 0.00m;
|
||||
|
||||
/// <summary>
|
||||
/// 累计充值金额,默认0.00
|
||||
/// </summary>
|
||||
[Column(Name = "recharge_amount_total", DbType = "decimal(10,2)")]
|
||||
public decimal? RechargeAmountTotal { get; set; } = 0.00m;
|
||||
|
||||
/// <summary>
|
||||
/// 每单中转仓快递费用(单位:元,两位小数),默认2.20
|
||||
/// </summary>
|
||||
[Column(Name = "postage_per_order", DbType = "decimal(10,2)")]
|
||||
public decimal? PostagePerOrder { get; set; } = 2.20m;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using FreeSql;
|
||||
using MAX.Core.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Store.Framework.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Store.Framework.Repositorys
|
||||
{
|
||||
public interface IUserRepository : IBaseRepository<User>
|
||||
{
|
||||
|
||||
}
|
||||
public class SqlRepository : WxRepository<User>, IUserRepository, IScopedDependency
|
||||
{
|
||||
public SqlRepository([FromKeyedServices("KJDDB")] IFreeSql fsql) : base(fsql)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public abstract class WxRepository<TEntity> : BaseRepository<TEntity>
|
||||
where TEntity : class
|
||||
{
|
||||
protected WxRepository(IFreeSql fsql)
|
||||
: base(fsql)
|
||||
{
|
||||
fsql.CodeFirst.ConfigEntity<TEntity>(a =>
|
||||
{
|
||||
a.Name($"wxxd.{typeof(TEntity).Name}");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using FreeSql;
|
||||
using MAX.Core.DependencyInjection;
|
||||
using MAX.Core.Interfaces;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Store.Framework
|
||||
{
|
||||
public class Startup : IStartup
|
||||
{
|
||||
public int Priority => int.MaxValue - 1;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Register(IServiceRegistrar registrar)
|
||||
{
|
||||
//Func<IServiceProvider, IFreeSql> userFsqlFactory = r =>
|
||||
//{
|
||||
// var config = r.GetRequiredService<IConfiguration>();
|
||||
// var connection = config.GetConnectionString("UserConnection");
|
||||
// IFreeSql fsql = new FreeSql.FreeSqlBuilder()
|
||||
// .UseConnectionString(FreeSql.DataType.MySql, connection)
|
||||
// .UseAdoConnectionPool(true)
|
||||
// .Build();
|
||||
// return fsql;
|
||||
//};
|
||||
//registrar.RegisterSingleton<IFreeSql>("UserDB", (s, k) =>
|
||||
//{
|
||||
// return userFsqlFactory(s);
|
||||
//});
|
||||
|
||||
|
||||
|
||||
Func<IServiceProvider, IFreeSql> KJDFsqlFactory = r =>
|
||||
{
|
||||
var config = r.GetRequiredService<IConfiguration>();
|
||||
var connection = config.GetConnectionString("KJDConnection");
|
||||
IFreeSql fsql = new FreeSql.FreeSqlBuilder()
|
||||
.UseConnectionString(FreeSql.DataType.MySql, connection)
|
||||
.UseAdoConnectionPool(true)
|
||||
.Build();
|
||||
return fsql;
|
||||
};
|
||||
registrar.RegisterSingleton<IFreeSql>("KJDDB", (s, k) =>
|
||||
{
|
||||
return KJDFsqlFactory(s);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core\MAX.Core\MAX.Core.csproj" />
|
||||
<ProjectReference Include="..\Core\MAX.Framework\MAX.Framework.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in new issue
Block a user