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>
26 lines
664 B
C#
26 lines
664 B
C#
using System.Threading.Tasks;
|
|
using SqlSugar;
|
|
using WmsLite.Api.Common;
|
|
using WmsLite.Api.Models;
|
|
using WmsLite.Api.Repositories.Interfaces;
|
|
|
|
namespace WmsLite.Api.Repositories;
|
|
|
|
public class HttpAccessLogRepository : IHttpAccessLogRepository
|
|
{
|
|
private readonly ISqlSugarClient _db;
|
|
|
|
public HttpAccessLogRepository(ISqlSugarClient db)
|
|
{
|
|
_db = db;
|
|
}
|
|
|
|
public async Task<long> InsertAsync(HttpAccessLog entity)
|
|
{
|
|
entity.Id = entity.Id == 0 ? SnowFlakeSingle.Instance.NextId() : entity.Id;
|
|
entity.CreateTime ??= DateTime.Now;
|
|
await _db.Insertable(entity).ExecuteCommandAsync();
|
|
return entity.Id;
|
|
}
|
|
}
|