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,52 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace WmsLite.Api.Common;
|
||||
|
||||
[JsonConverter(typeof(BusinessResultJsonConverter))]
|
||||
public class BusinessResult
|
||||
{
|
||||
public const string SuccessCode = "200";
|
||||
public const string BadRequestCode = "400";
|
||||
public const string NotFoundCode = "404";
|
||||
public const string ServerErrorCode = "500";
|
||||
|
||||
public bool Success { get; set; }
|
||||
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public object? Data { get; set; }
|
||||
|
||||
public static BusinessResult Ok(object? data = null, string message = "OK")
|
||||
{
|
||||
return new BusinessResult
|
||||
{
|
||||
Success = true,
|
||||
Code = SuccessCode,
|
||||
Message = message,
|
||||
Data = data
|
||||
};
|
||||
}
|
||||
|
||||
public static BusinessResult Fail(string message, string code = ServerErrorCode, object? data = null)
|
||||
{
|
||||
return new BusinessResult
|
||||
{
|
||||
Success = false,
|
||||
Code = code,
|
||||
Message = message,
|
||||
Data = data
|
||||
};
|
||||
}
|
||||
|
||||
public static BusinessResult BadRequest(string message, object? data = null)
|
||||
{
|
||||
return Fail(message, BadRequestCode, data);
|
||||
}
|
||||
|
||||
public static BusinessResult NotFound(string message, object? data = null)
|
||||
{
|
||||
return Fail(message, NotFoundCode, data);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user