Add WmsLite monorepo with JWT auth, tenant context, and project READMEs.
Implement API security baseline (sys_user, JWT, audit fields, transactions, unique constraints) and Web real login with 401 handling. Document setup and development workflows in root, WmsLite.Api, and WmsLite.Web README files. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
fa1b286463
241 files changed
+31188
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Models;
|
||||
using WmsLite.Api.Repositories.Interfaces;
|
||||
|
||||
namespace WmsLite.Api.Repositories;
|
||||
|
||||
public class SysDictItemRepository : ISysDictItemRepository
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
|
||||
public SysDictItemRepository(ISqlSugarClient db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public async Task<List<SysDictItem>> ListEnabledAsync(string tenantId, string ownerCode, IReadOnlyList<string>? categories)
|
||||
{
|
||||
var tenant = tenantId.Trim();
|
||||
var owner = ownerCode.Trim();
|
||||
|
||||
var q = _db.Queryable<SysDictItem>()
|
||||
.Where(x => !x.IsDeleted && x.IsEnabled &&
|
||||
((x.TenantId == tenant && x.OwnerCode == owner)
|
||||
|| (x.TenantId == "system" && x.OwnerCode == "system")));
|
||||
|
||||
if (categories is { Count: > 0 })
|
||||
{
|
||||
var set = categories.Select(c => c.Trim()).Where(c => c.Length > 0).Distinct().ToList();
|
||||
if (set.Count > 0)
|
||||
{
|
||||
q = q.Where(x => set.Contains(x.Category));
|
||||
}
|
||||
}
|
||||
|
||||
return await q.OrderBy(x => x.Category).OrderBy(x => x.SortOrder).OrderBy(x => x.Code).ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user