调整数据库结构,实现消息模板管理

This commit is contained in:
2025-12-16 11:26:55 +08:00
parent 98e3f7ab73
commit ed32b98867
45 changed files with 1100 additions and 1319 deletions

View File

@@ -1,20 +0,0 @@
namespace Atomx.Admin.Client.Models
{
public class MaterialSearch : BaseSearch
{
/// <summary>
/// 类型
/// </summary>
public int? Type { get; set; }
/// <summary>
/// 原料归属公司ID
/// </summary>
public long CorporationId { get; set; }
/// <summary>
/// 原料归属店铺网点ID
/// </summary>
public long StoreId { get; set; }
}
}

View File

@@ -7,6 +7,16 @@
/// </summary>
public long Id { get; set; }
/// <summary>
/// 站点ID
/// </summary>
public long SiteId { get; set; }
/// <summary>
/// 语言编码
/// </summary>
public int LanguageId { get; set; }
/// <summary>
/// 消息模板类型
/// </summary>
@@ -32,6 +42,11 @@
/// </summary>
public string Body { get; set; } = string.Empty;
/// <summary>
/// 附件文件地址列表,多个附件以逗号分隔
/// </summary>
public string Attachments { get; set; } = string.Empty;
/// <summary>
/// 是否可用
/// </summary>

View File

@@ -4,6 +4,8 @@
{
public int? Type { get; set; }
public int? Language { get; set; }
public string Key { get; set; } = string.Empty;
}
}

View File

@@ -24,6 +24,9 @@
<li>
<a href="/system/role/list">角色管理</a>
</li>
<li>
<a href="/currency/list">货币设置</a>
</li>
</PageContainer>
@code {

View File

@@ -0,0 +1,5 @@
<h3>CountryEdit</h3>
@code {
}

View File

@@ -0,0 +1,5 @@
<h3>CountryList</h3>
@code {
}

View File

@@ -0,0 +1,22 @@
@page "/currency/list"
@page "/{locale}/currency/list"
@inject ILogger<CurrencyList> Logger
@attribute [Authorize]
<PageContainer Title="货币管理">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>货币管理</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<h3>Tools</h3>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -1,10 +1,17 @@
@page "/setting/messagetemplate/list"
@page "/{locale}/setting/messagetemplate/list"
@inject ILogger<MessageTemplateList> Logger
@attribute [Authorize]
<PageTitle>消息模板</PageTitle>
<Title Level="4">消息模版管理</Title>
<PageContainer Title="消息模板">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>系统设置</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Card>
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
<Row Justify="RowJustify.Start" Gutter="16">
@@ -22,7 +29,7 @@
</Row>
</Form>
</Card>
<br />
<Card Class="mt-3">
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
<TitleTemplate>
@@ -49,6 +56,9 @@
}
</PropertyColumn>
<PropertyColumn Property="c => c.Name" Title="模版名称" />
<PropertyColumn Property="c => c.LanguageId" Title="语言">
@GetLanuageName(context.LanguageId)
</PropertyColumn>
<PropertyColumn Property="c => c.Key" Title="模版Code" Width="100px" />
<PropertyColumn Property="c => c.Title" Title="模版标题" />
<PropertyColumn Property="c => c.Enabled" Title="状态" Width="80px" Align="ColumnAlign.Center">
@@ -95,6 +105,7 @@
</ActionColumn>
</ColumnDefinitions>
</Table>
<br />
<Row Justify="RowJustify.End">
<Pagination PageIndex="PagingList.Index" Total="PagingList.Count" PageSize="PagingList.Size" ShowSizeChanger="false" OnChange="OnPageChanged"></Pagination>
</Row>
@@ -103,7 +114,7 @@
<Modal Title="@("消息模版设置")" Visible="@modalVisible" Width="700" MaskClosable="true" OkText="@("保存")" CancelText="@("取消")" OnOk="@HandleModalOk" OnCancel="@HandleCancel">
<Form Model="@template" @ref="@editForm" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
<Form Model="@model" @ref="@editForm" LabelCol="new ColLayoutParam { Span = 5 }" WrapperCol="new ColLayoutParam { Span = 15 }" Name="modalForm" OnFinish="OnFormFinish">
<FluentValidationValidator />
<FormItem Label="消息模版类型">
<SimpleSelect DefaultValue="" Style="width:120px;" @bind-Value="@context.Type">
@@ -118,7 +129,10 @@
<FormItem Label="消息模版名称">
<Input Placeholder="消息模版名称" @bind-Value="@context.Name" />
</FormItem>
<FormItem Label="语言">
<Select DataSource="@languages" @bind-Value="@context.LanguageId" ItemValue="p => p.Id" ItemLabel="p => p.Title" Disabled="@(context.Id > 0)">
</Select>
</FormItem>
<FormItem Label="模版Code">
<Input Placeholder="模版Code" @bind-Value="@context.Key" Disabled="@(context.Id > 0)" />
</FormItem>
@@ -135,10 +149,14 @@
</FormItem>
</Form>
</Modal>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
[SupplyParameterFromQuery]
int? Page { get; set; }
@@ -147,10 +165,10 @@
Form<MessageTemplateSearch> searchForm = null!;
[SupplyParameterFromForm]
MessageTemplateModel template { get; set; } = new();
MessageTemplateModel model { get; set; } = new();
Form<MessageTemplateModel> editForm = null!;
List<Language> languages = new();
PagingList<MessageTemplate> PagingList = new();
bool loading { get; set; } = true;
bool searchExpand { get; set; } = false;
@@ -166,7 +184,7 @@
{
loadQueryString();
LoadList();
_ = LoadLanguages();
base.OnParametersSet();
}
@@ -177,6 +195,20 @@
search.Key = query.GetQueryString("Key");
}
private async Task LoadLanguages()
{
var url = $"/api/language/enabled";
var apiResult = await HttpService.Get<ApiResult<List<Language>>>(url);
if (apiResult.Success)
{
if (apiResult.Data != null)
{
languages = apiResult.Data;
StateHasChanged();
}
}
}
private async void LoadList()
{
@@ -265,13 +297,13 @@
void OnCreateClick()
{
template = new();
model = new();
modalVisible = true;
}
void HandleEdit(MessageTemplate model)
void HandleEdit(MessageTemplate data)
{
template = model.Adapt<MessageTemplateModel>();
model = data.Adapt<MessageTemplateModel>();
modalVisible = true;
}
@@ -285,18 +317,8 @@
if (editForm.Validate())
{
var result = new ApiResult<string>();
var data = template.Adapt<MessageTemplate>();
if (template.Id > 0)
{
var url = $"api/messagetemplate/edit";
result = await HttpService.Post<ApiResult<string>>(url, data);
}
else
{
var url = $"api/messagetemplate/add";
result = await HttpService.Post<ApiResult<string>>(url, data);
}
var url = $"api/messagetemplate/save";
result = await HttpService.Post<ApiResult<string>>(url, model);
if (result.Code == (int)ResultCode.Success)
{
@@ -314,4 +336,14 @@
{
modalVisible = false;
}
string GetLanuageName(int languageId)
{
var language = languages.FirstOrDefault(l => l.Id == languageId);
if (language != null)
{
return language.Title;
}
return "-";
}
}

View File

@@ -1,7 +1,22 @@
@page "/settings"
@page "/{locale}/settings"
@attribute [Authorize]
@inject ILogger<Settings> Logger
@code {
<PageContainer Title="系统设置">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>系统设置</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<h3>Tools</h3>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -3,7 +3,7 @@
@inject ILogger<AppVersionList> Logger
@attribute [Authorize]
<div>
<PageContainer Title="App版本管理">
<Breadcrumb>
<Breadcrumb>
@@ -16,7 +16,6 @@
<h3>App Version List</h3>
</ChildContent>
</PageContainer>
</div>
@code {

View File

@@ -1,7 +1,22 @@
@page "/system/app/list"
@page "/{locale}/system/app/list"
@inject ILogger<SiteAppList> Logger
@attribute [Authorize]
@code {
<PageContainer Title="系统工具">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>系统工具</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<h3>Tools</h3>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
}

View File

@@ -1,9 +1,17 @@
@page "/system/file/list"
@page "/{locale}/system/file/list"
@inject ILogger<UploadList> Logger
@attribute [Authorize]
<PageTitle>上传文件</PageTitle>
<Title Level="4">上传文件</Title>
<PageContainer Title="上传文件">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>上传文件</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Card>
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
<Row Justify="RowJustify.Start" Gutter="16">
@@ -98,6 +106,8 @@
</FormItem>
</Form>
</Drawer>
</ChildContent>
</PageContainer>
@code {
[SupplyParameterFromQuery]

View File

@@ -1,9 +0,0 @@
@page "/system/currency/list"
@inject ILogger<CurrencyList> Logger
@attribute [Authorize]
<h3>CurrencyList</h3>
@code {
}

View File

@@ -1,6 +1,17 @@
@page "/system/info"
@page "/{locale}/system/info"
<h3>Info</h3>
<PageContainer Title="系统信息">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>系统信息</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<h3>Tools</h3>
</ChildContent>
</PageContainer>
@code {
[Parameter]

View File

@@ -1,11 +1,17 @@
@page "/system/language/list"
@page "/{locale}/system/language/list"
@inject ILogger<LanguageList> Logger
@attribute [Authorize]
<PageTitle>语言管理</PageTitle>
<Title Level="4">多语言</Title>
<PageContainer Title="语言管理">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>语言管理</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Card Class="mt-3">
<Table DataSource="PagingList.Items" PageSize="100" HidePagination="true" Resizable>
<TitleTemplate>
@@ -103,8 +109,13 @@
</FormItem>
</Form>
</Drawer>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
[SupplyParameterFromQuery]
int? Page { get; set; }

View File

@@ -1,10 +1,17 @@
@page "/system/locale/resource/detail/{Name}"
@page "/{locale}/system/locale/resource/detail/{Name}"
@inject ILogger<LocaleResourceList> Logger
@attribute [Authorize]
<PageTitle>本地化语言资源</PageTitle>
<Title Level="4">多语言本地资源管理</Title>
<PageContainer Title="本地化语言资源">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>本地化语言资源</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Spin Spinning="loading">
<Card Class="mt-3">
<Table DataSource="ResourceItems" PageSize="100" HidePagination="true" Resizable>
@@ -83,10 +90,14 @@
</FormItem>
</Form>
</Modal>
</ChildContent>
</PageContainer>
@code {
bool loading = false;
[Parameter]
public string Locale { get; set; } = string.Empty;
[Parameter]
public string Name { get; set; }

View File

@@ -1,10 +1,17 @@
@page "/system/locale/resource/list/{Id:int}"
@page "/{locale}/system/locale/resource/list/{Id:int}"
@inject ILogger<LocaleResourceList> Logger
@attribute [Authorize]
<PageTitle>本地化语言资源</PageTitle>
<Title Level="4">多语言本地资源管理</Title>
<PageContainer Title="多语言本地资源管理">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>多语言本地资源管理</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Spin Spinning="loading">
<Card>
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
@@ -102,10 +109,13 @@
</FormItem>
</Form>
</Modal>
</ChildContent>
</PageContainer>
@code {
bool loading = false;
[Parameter]
public string Locale { get; set; } = string.Empty;
[Parameter]
public int Id { get; set; }

View File

@@ -1,13 +1,19 @@
@page "/system/menu/list"
@page "/{locale}/system/menu/list"
@inject ILogger<MenuList> Logger
@using MenuItem = Atomx.Admin.Client.Models.MenuItem
@using Menu = Atomx.Common.Entities.Menu
@attribute [Authorize]
<PageTitle>菜单管理</PageTitle>
<Title Level="4">菜单管理</Title>
<PageContainer Title="菜单管理">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>菜单管理</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<Card>
<Form @ref="searchForm" Model="search" Layout="FormLayout.Inline" Class="search-form" OnFinish="OnSearchFinish">
<Row Justify="RowJustify.Start" Gutter="16">
@@ -42,7 +48,8 @@
<AntDesign.Text>@GetName(context)</AntDesign.Text>
</PropertyColumn>
<PropertyColumn Property="c => c.Icon" Title="图标" Width="60px" Align="ColumnAlign.Center">
@if (!string.IsNullOrEmpty(context.Icon)) {
@if (!string.IsNullOrEmpty(context.Icon))
{
<Icon Type="@context.Icon" Theme="IconThemeType.Outline" Width="1.3em" Height="1.3em" />
}
</PropertyColumn>
@@ -132,11 +139,14 @@
</FormItem>
</Form>
</Drawer>
</ChildContent>
</PageContainer>
@code {
[Parameter]
public string Locale { get; set; } = string.Empty;
[SupplyParameterFromQuery]
int? Page { get; set; }

View File

@@ -1,7 +1,18 @@
@page "/system/tools"
@page "/{locale}/system/tools"
<PageContainer Title="系统工具">
<Breadcrumb>
<Breadcrumb>
<BreadcrumbItem Href="/">管理后台</BreadcrumbItem>
<BreadcrumbItem Href="/admin/list">系统功能</BreadcrumbItem>
<BreadcrumbItem>系统工具</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
<ChildContent>
<h3>Tools</h3>
</ChildContent>
</PageContainer>
@code {
[Parameter]

View File

@@ -1,13 +0,0 @@
using Atomx.Common.Entities;
using FluentValidation;
namespace Atomx.Admin.Client.Validators
{
public class MaterialBatchValidator : AbstractValidator<MaterialBatch>
{
public MaterialBatchValidator()
{
RuleFor(p => p.Price).NotEmpty().WithMessage("价格不能为空");
}
}
}

View File

@@ -1,13 +0,0 @@
using Atomx.Common.Entities;
using FluentValidation;
namespace Atomx.Admin.Client.Validators
{
public class MaterialRecordValidator : AbstractValidator<MaterialRecord>
{
public MaterialRecordValidator()
{
RuleFor(p => p.UserId).NotEmpty().WithMessage("名称不能为空");
}
}
}

View File

@@ -1,13 +0,0 @@
using Atomx.Common.Entities;
using FluentValidation;
namespace Atomx.Admin.Client.Validators
{
public class MaterialValidator : AbstractValidator<Material>
{
public MaterialValidator()
{
//RuleFor(p => p.Name).NotEmpty().WithMessage("名称不能为空");
}
}
}

View File

@@ -1,11 +1,12 @@
using Atomx.Admin.Client.Models;
using FluentValidation;
using Microsoft.Extensions.Localization;
namespace Atomx.Admin.Client.Validators
{
public class MessageTemplateModelValidator : AbstractValidator<MessageTemplateModel>
{
public MessageTemplateModelValidator()
public MessageTemplateModelValidator(IStringLocalizer<MessageTemplateModelValidator> localizer)
{
RuleFor(p => p.Name).NotEmpty().WithMessage("消息模板名称不能为空");
RuleFor(p => p.Title).NotEmpty().WithMessage("消息模板标题不能为空");

View File

@@ -1,16 +1,14 @@
using Atomx.Admin.Client.Models;
using Atomx.Admin.Client.Validators;
using Atomx.Admin.Services;
using Atomx.Common.Entities;
using Atomx.Common.Models;
using Atomx.Data;
using Atomx.Data.CacheServices;
using Atomx.Data.Services;
using Atomx.Utils.Extension;
using Atomx.Utils.Models;
using FluentValidation;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
namespace Atomx.Admin.Controllers
{
@@ -26,6 +24,8 @@ namespace Atomx.Admin.Controllers
private readonly IMapper _mapper;
private readonly JwtSetting _jwtSettings;
private readonly ICacheService _cacheService;
readonly IValidator<CurrencyModel> _validator;
readonly IStringLocalizer<CurrencyController> _localizer;
/// <summary>
@@ -38,7 +38,8 @@ namespace Atomx.Admin.Controllers
/// <param name="mapper"></param>
/// <param name="jwtSettings"></param>
/// <param name="cacheService"></param>
public CurrencyController(ILogger<CurrencyController> logger, IIdCreatorService idCreator, IIdentityService identityService, DataContext dbContext, IMapper mapper, JwtSetting jwtSettings, ICacheService cacheService)
public CurrencyController(ILogger<CurrencyController> logger, IIdCreatorService idCreator, IIdentityService identityService,
DataContext dbContext, IMapper mapper, JwtSetting jwtSettings, ICacheService cacheService,IValidator<CurrencyModel> validator, IStringLocalizer<CurrencyController> stringLocalizer)
{
_logger = logger;
_idCreator = idCreator;
@@ -47,6 +48,8 @@ namespace Atomx.Admin.Controllers
_mapper = mapper;
_jwtSettings = jwtSettings;
_cacheService = cacheService;
_validator = validator;
_localizer = stringLocalizer;
}
///// <summary>

View File

@@ -1,4 +1,5 @@
using Atomx.Admin.Client.Models;
using AntDesign;
using Atomx.Admin.Client.Models;
using Atomx.Admin.Client.Validators;
using Atomx.Admin.Services;
using Atomx.Common.Entities;
@@ -6,9 +7,11 @@ using Atomx.Common.Models;
using Atomx.Data;
using Atomx.Data.CacheServices;
using Atomx.Data.Services;
using FluentValidation;
using MapsterMapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Localization;
namespace Atomx.Admin.Controllers
{
@@ -22,6 +25,8 @@ namespace Atomx.Admin.Controllers
readonly IMapper _mapper;
readonly DataContext _dbContext;
readonly ICacheService _cacheService;
readonly IValidator<MessageTemplateModel> _validator;
readonly IStringLocalizer<MessageTemplateController> _localizer;
/// <summary>
///
@@ -31,7 +36,8 @@ namespace Atomx.Admin.Controllers
/// <param name="idCreator"></param>
/// <param name="messageTemplateService"></param>
/// <param name="mapper"></param>
public MessageTemplateController(ILogger<MessageTemplateController> logger, IIdentityService identityService, IIdCreatorService idCreator, IMapper mapper, DataContext dataContext, ICacheService cacheService)
public MessageTemplateController(ILogger<MessageTemplateController> logger, IIdentityService identityService,
IIdCreatorService idCreator, IMapper mapper, DataContext dataContext, ICacheService cacheService, IValidator<MessageTemplateModel> validator, IStringLocalizer<MessageTemplateController> stringLocalizer)
{
_logger = logger;
_identityService = identityService;
@@ -39,6 +45,8 @@ namespace Atomx.Admin.Controllers
_mapper = mapper;
_dbContext = dataContext;
_cacheService = cacheService;
_validator = validator;
_localizer = stringLocalizer;
}
@@ -64,6 +72,12 @@ namespace Atomx.Admin.Controllers
where p.Type == search.Type
select p;
}
if (search.Language.HasValue)
{
query = from p in query
where p.LanguageId == search.Language
select p;
}
if (!string.IsNullOrEmpty(search.Key))
{
query = from p in query
@@ -107,82 +121,58 @@ namespace Atomx.Admin.Controllers
}
/// <summary>
/// 添加版本信息
/// 保存消息模板配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost("add")]
public IActionResult Add(MessageTemplateModel model)
[HttpPost("save")]
public async Task<IActionResult> SaveAsync(MessageTemplateModel model)
{
var result = new ApiResult<string>();
var validator = new MessageTemplateModelValidator();
var validation = validator.Validate(model);
var validation = await _validator.ValidateAsync(model);
if (!validation.IsValid)
{
var message = validation.Errors.FirstOrDefault()?.ErrorMessage;
result = result.IsFail(message ?? string.Empty, null);
return new JsonResult(result);
var message = validation.Errors.FirstOrDefault()?.ErrorMessage ?? string.Empty;
return new JsonResult(new ApiResult<string>().IsFail(message, null));
}
try
{
model.Id = _idCreator.CreateId();
var message = _mapper.Map<MessageTemplate>(model);
message.CreateTime = DateTime.UtcNow;
_dbContext.MessageTemplates.Add(message);
var count = _dbContext.SaveChanges();
result = result.IsSuccess(count.ToString());
}
catch (Exception ex)
var data = _dbContext.MessageTemplates.SingleOrDefault(p => p.Key == model.Key && p.LanguageId == model.LanguageId && p.SiteId == model.SiteId && p.Id != model.Id);
if (data != null)
{
result = result.IsFail(ex.Message);
_logger.LogError(ex.Message);
}
return new JsonResult(result);
return new JsonResult(new ApiResult<string>().IsFail("当前站点语言下已经存在这个配置,请认真检查", null));
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost("edit")]
public IActionResult Edit(MessageTemplateModel model)
if (model.Id > 0)
{
var result = new ApiResult<string>();
var validator = new MessageTemplateModelValidator();
var validation = validator.Validate(model);
if (!validation.IsValid)
{
var message = validation.Errors.FirstOrDefault()?.ErrorMessage;
result = result.IsFail(message ?? string.Empty, null);
return new JsonResult(result);
}
var data = _dbContext.MessageTemplates.SingleOrDefault(p => p.Id == model.Id);
data = _dbContext.MessageTemplates.SingleOrDefault(p => p.Id == model.Id);
if (data == null)
{
result = result.IsFail("数据不存在");
return new JsonResult(result);
return new JsonResult(new ApiResult<string>().IsFail("数据不存在", null));
}
data = _mapper.Map<MessageTemplateModel, MessageTemplate>(model, data);
data.UpdateTime = DateTime.UtcNow;
_dbContext.SaveChanges();
}
else
{
model.Id = _idCreator.CreateId();
data = _mapper.Map<MessageTemplate>(model);
data.CreateTime = DateTime.UtcNow;
_dbContext.MessageTemplates.Add(data);
_dbContext.SaveChanges();
}
data.UpdateTime = DateTime.UtcNow;
try
{
int count = _dbContext.SaveChanges();
result = result.IsSuccess(count.ToString());
return new JsonResult(new ApiResult<string>().IsSuccess("操作成功"));
}
catch (Exception ex)
{
result = result.IsFail(ex.Message);
_logger.LogError(ex.Message);
Console.WriteLine(ex.Message);
return new JsonResult(new ApiResult<string>().IsFail(ex.Message, null));
}
return new JsonResult(result);
}
/// <summary>
/// 根据ID删除
/// </summary>

View File

@@ -0,0 +1,3 @@
{
}

View File

@@ -6,6 +6,7 @@ namespace Atomx.Common.Entities
/// <summary>
/// 地区(国家、省、市、区)
/// </summary>
[Table("Areas")]
public class Area
{
/// <summary>

View File

@@ -6,6 +6,7 @@ namespace Atomx.Common.Entities
/// <summary>
/// 分类
/// </summary>
[Table("Categories")]
public class Category
{
/// <summary>

View File

@@ -3,7 +3,8 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
public class PaymentChannel
[Table("Channels")]
public class Channel
{
/// <summary>
/// 数据ID
@@ -13,23 +14,28 @@ namespace Atomx.Common.Entities
public int Id { get; set; }
/// <summary>
/// 付款方式,银行、微信、支付宝USDT
/// 站点ID
/// </summary>
public long SiteId { get; set; }
/// <summary>
/// 通道类型,例如通知、支付、登录等
/// </summary>
public int Type { get; set; }
/// <summary>
/// 支付网络,区块链-TRC20Online-WechatBank-ICBC
/// 通道网络,例如API、SMS、Email,MQTT,区块链网络等
/// </summary>
public int Network { get; set; }
/// <summary>
/// 支付渠道名称
/// 道名称
/// </summary>
[Column(TypeName = "varchar(20)")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 支付渠道标题名称
/// 道标题名称
/// </summary>
[Column(TypeName = "varchar(20)")]
public string Title { get; set; } = string.Empty;
@@ -40,15 +46,8 @@ namespace Atomx.Common.Entities
[Column(TypeName = "varchar(512)")]
public string Description { get; set; } = string.Empty;
/// <summary>
/// 收款账号
/// </summary>
[Column(TypeName = "varchar(256)")]
public string Account { get; set; } = string.Empty;
/// <summary>
/// 支付通道的设置
/// 通道的设置
/// </summary>
[Column(TypeName = "text")]
public string Config { get; set; } = string.Empty;

View File

@@ -1,35 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 企业供应商关系
/// </summary>
[Table("CorporationManufacturerRelations")]
public class CorporationManufacturerRelation
{
/// <summary>
/// 产品属性关联数据ID
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 企业ID
/// </summary>
public long CorporationId { get; set; }
/// <summary>
/// 供应制造商ID
/// </summary>
public long ManufacturerId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; }
}
}

View File

@@ -1,43 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 用户公司关系
/// </summary>
[Table("CorporationUserRelations")]
public class CorporationUserRelation
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 公司ID
/// </summary>
public long CorporationId { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long UserId { get; set; }
/// <summary>
/// 数据状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 数据创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
/// <summary>
/// 数据更新时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}

View File

@@ -6,6 +6,7 @@ namespace Atomx.Common.Entities
/// <summary>
/// 货币信息
/// </summary>
[Table("Currencies")]
public class Currency
{
/// <summary>
@@ -15,6 +16,11 @@ namespace Atomx.Common.Entities
[Key]
public int Id { get; set; }
/// <summary>
/// 站点ID
/// </summary>
public long SiteId { get; set; }
/// <summary>
/// 货币名称,系统
/// </summary>

View File

@@ -6,6 +6,7 @@ namespace Atomx.Common.Entities
/// <summary>
/// 货币与支付通道关联表
/// </summary>
[Table("CurrencyChannelRelations")]
public class CurrencyChannelRelation
{
[DatabaseGenerated(DatabaseGeneratedOption.None)]

View File

@@ -1,45 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 物料原料类型数据
/// </summary>
[Table("Materials")]
public class Material
{
/// <summary>
/// 数据ID
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 原料类型
/// </summary>
public int Type { get; set; }
/// <summary>
/// 原料归属公司ID
/// </summary>
public long CorporationId { get; set; }
/// <summary>
/// 原料归属店铺网点ID
/// </summary>
public long StoreId { get; set; }
/// <summary>
/// 原料数量
/// </summary>
public decimal Quantity { get; set; }
/// <summary>
/// 数据最后更新时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}

View File

@@ -1,66 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 原料采购批次
/// </summary>
[Table("MaterialBatchs")]
public class MaterialBatch
{
/// <summary>
/// 数据ID
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 类型:采购、借调、借调归还
/// </summary>
public int Type { get; set; }
/// <summary>
/// 原料数据ID
/// </summary>
public long MaterialId { get; set; }
/// <summary>
/// 原料归属公司ID
/// </summary>
public long CorporationId { get; set; }
/// <summary>
/// 原料归属店铺网点ID
/// </summary>
public long StoreId { get; set; }
/// <summary>
/// 原料当前数量
/// </summary>
public decimal Quantity { get; set; }
/// <summary>
/// 原料批次总量
/// </summary>
public decimal TotalQuantity { get; set; }
/// <summary>
/// 原料采购价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 数据创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
/// <summary>
/// 数据最后更新时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}

View File

@@ -1,81 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 原料详细记录,采购入库、使用出库、借调、归还、盘点校对
/// </summary>
[Table("MaterialRecords")]
public class MaterialRecord
{
/// <summary>
/// 数据ID
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 操作类型,采购入库、使用出库、借调出库、归还入库、盘点校对
/// </summary>
public int Type { get; set; }
/// <summary>
/// 原料Id
/// </summary>
public long MaterialId { get; set; }
/// <summary>
/// 归属原料批次ID
/// </summary>
public long MaterialBatchId { get; set; }
/// <summary>
/// 归属公司id
/// </summary>
public long CorporationId { get; set; }
/// <summary>
/// 数据店铺网点id
/// </summary>
public long StoreId { get; set; }
/// <summary>
/// 操作用户ID
/// </summary>
public long UserId { get; set; }
/// <summary>
/// 原料价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 数量
/// </summary>
public decimal Quantity { get; set; }
/// <summary>
/// 使用原料产生的费用
/// </summary>
public decimal Expenses { get; set; }
/// <summary>
/// 标记
/// </summary>
public int Mark { get; set; }
/// <summary>
/// 备注说明
/// </summary>
[Column(TypeName = "varchar(256)")]
public string Note { get; set; } = string.Empty;
/// <summary>
/// 注册数据创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
}
}

View File

@@ -16,6 +16,11 @@ namespace Atomx.Common.Entities
[Key]
public long Id { get; set; }
/// <summary>
/// 站点ID
/// </summary>
public long SiteId { get; set; }
/// <summary>
/// 语言编码
/// </summary>
@@ -50,6 +55,12 @@ namespace Atomx.Common.Entities
[Column(TypeName = "text")]
public string Body { get; set; } = string.Empty;
/// <summary>
/// 附件文件地址列表,多个附件以逗号分隔
/// </summary>
[Column(TypeName = "varchar(1024)")]
public string Attachments { get; set; } = string.Empty;
/// <summary>
/// 是否可用
/// </summary>

View File

@@ -1,72 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 价格走势
/// </summary>
[Table("PriceTrends")]
public class PriceTrend
{
/// <summary>
/// 数据ID
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 日期
/// </summary>
public int Date { get; set; }
/// <summary>
/// 类型
/// </summary>
public int Type { get; set; }
/// <summary>
/// 当前价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 最低价格
/// </summary>
public decimal LowestPrice { get; set; }
/// <summary>
/// 最高价格
/// </summary>
public decimal HighestPrice { get; set; }
/// <summary>
/// 当前零售价格
/// </summary>
public decimal RetailPrice { get; set; }
/// <summary>
/// 最低零售价格
/// </summary>
public decimal LowestRetailPrice { get; set; }
/// <summary>
/// 最高零售价格
/// </summary>
public decimal HighestRetailPrice { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}

View File

@@ -22,13 +22,7 @@ namespace Atomx.Common.Entities
public long SiteId { get; set; }
/// <summary>
/// 系统设置KEY
/// </summary>
[Column(TypeName = "varchar(64)")]
public string Key { get; set; } = string.Empty;
/// <summary>
/// 配置类型,0 系统设置,
/// 配置类型,见 SettingType 枚举
/// </summary>
public int Type { get; set; }
@@ -38,6 +32,12 @@ namespace Atomx.Common.Entities
[Column(TypeName = "varchar(64)")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 系统设置KEY
/// </summary>
[Column(TypeName = "varchar(64)")]
public string Key { get; set; } = string.Empty;
/// <summary>
/// 系统设置项
/// </summary>

View File

@@ -6,6 +6,7 @@ namespace Atomx.Common.Entities
/// <summary>
/// 站点应用
/// </summary>
[Table("SiteApps")]
public class SiteApp
{
/// <summary>

View File

@@ -1,41 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
/// <summary>
/// 出入库记录
/// </summary>
[Table("WarehouseStockRecords")]
public class WarehouseStockRecord
{
/// <summary>
/// 数据ID
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
/// <summary>
/// 类型,0入库1出库初始
/// </summary>
public int? Type { get; set; }
/// <summary>
/// 产生动作的用户ID
/// </summary>
public long? Operator { get; set; }
/// <summary>
/// 备注说明
/// </summary>
[Column(TypeName = "varchar(256)")]
public string Note { get; set; } = string.Empty;
/// <summary>
/// 注册数据创建时间
/// </summary>
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; } = DateTime.UtcNow;
}
}

View File

@@ -51,6 +51,11 @@ namespace Atomx.Data
/// </summary>
public DbSet<Category> Categories { get; set; }
/// <summary>
/// 系统通道
/// </summary>
public DbSet<Channel> Channels { get; set; }
/// <summary>
/// 货币信息
/// </summary>
@@ -71,11 +76,6 @@ namespace Atomx.Data
/// </summary>
public DbSet<LocalizedProperty> LocalizedProperties { get; set; }
/// <summary>
/// 支付通道信息
/// </summary>
public DbSet<PaymentChannel> PaymentChannels { get; set; }
/// <summary>
/// 权限信息
/// </summary>

View File

@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Atomx.Data.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20251214094758_0.1")]
[Migration("20251216011300_0.1")]
partial class _01
{
/// <inheritdoc />
@@ -347,6 +347,53 @@ namespace Atomx.Data.Migrations
b.ToTable("Categories");
});
modelBuilder.Entity("Atomx.Common.Entities.Channel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("Channels");
});
modelBuilder.Entity("Atomx.Common.Entities.Currency", b =>
{
b.Property<int>("Id")
@@ -386,6 +433,9 @@ namespace Atomx.Data.Migrations
b.Property<decimal>("Rate")
.HasColumnType("decimal(16, 4)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Symbolic")
.IsRequired()
.HasColumnType("varchar(8)");
@@ -606,6 +656,10 @@ namespace Atomx.Data.Migrations
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<string>("Attachments")
.IsRequired()
.HasColumnType("varchar(1024)");
b.Property<string>("Body")
.IsRequired()
.HasColumnType("text");
@@ -620,10 +674,16 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<int>("LanguageId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(256)");
@@ -639,54 +699,6 @@ namespace Atomx.Data.Migrations
b.ToTable("MessageTemplates");
});
modelBuilder.Entity("Atomx.Common.Entities.PaymentChannel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Account")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("PaymentChannels");
});
modelBuilder.Entity("Atomx.Common.Entities.Permission", b =>
{
b.Property<long>("Id")

View File

@@ -145,11 +145,34 @@ namespace Atomx.Data.Migrations
table.PrimaryKey("PK_Categories", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Channels",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Network = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(20)", nullable: false),
Title = table.Column<string>(type: "varchar(20)", nullable: false),
Description = table.Column<string>(type: "varchar(512)", nullable: false),
Config = table.Column<string>(type: "text", nullable: false),
DisplayOrder = table.Column<int>(type: "integer", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
CreateTime = table.Column<DateTime>(type: "timestamptz", nullable: false),
UpdateTime = table.Column<DateTime>(type: "timestamptz", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Channels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Currencies",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "varchar(50)", nullable: false),
Title = table.Column<string>(type: "varchar(50)", nullable: false),
CurrencyCode = table.Column<string>(type: "varchar(10)", nullable: false),
@@ -273,11 +296,14 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
LanguageId = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Key = table.Column<string>(type: "varchar(64)", nullable: false),
Name = table.Column<string>(type: "varchar(256)", nullable: false),
Title = table.Column<string>(type: "varchar(256)", nullable: false),
Body = table.Column<string>(type: "text", nullable: false),
Attachments = table.Column<string>(type: "varchar(1024)", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
CreateTime = table.Column<DateTime>(type: "timestamptz", nullable: false),
UpdateTime = table.Column<DateTime>(type: "timestamptz", nullable: true)
@@ -287,28 +313,6 @@ namespace Atomx.Data.Migrations
table.PrimaryKey("PK_MessageTemplates", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PaymentChannels",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Network = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(20)", nullable: false),
Title = table.Column<string>(type: "varchar(20)", nullable: false),
Description = table.Column<string>(type: "varchar(512)", nullable: false),
Account = table.Column<string>(type: "varchar(256)", nullable: false),
Config = table.Column<string>(type: "text", nullable: false),
DisplayOrder = table.Column<int>(type: "integer", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
CreateTime = table.Column<DateTime>(type: "timestamptz", nullable: false),
UpdateTime = table.Column<DateTime>(type: "timestamptz", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentChannels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Permissions",
columns: table => new
@@ -563,9 +567,9 @@ namespace Atomx.Data.Migrations
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Key = table.Column<string>(type: "varchar(64)", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(64)", nullable: false),
Key = table.Column<string>(type: "varchar(64)", nullable: false),
Content = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
@@ -691,6 +695,9 @@ namespace Atomx.Data.Migrations
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "Channels");
migrationBuilder.DropTable(
name: "Currencies");
@@ -712,9 +719,6 @@ namespace Atomx.Data.Migrations
migrationBuilder.DropTable(
name: "MessageTemplates");
migrationBuilder.DropTable(
name: "PaymentChannels");
migrationBuilder.DropTable(
name: "Permissions");

View File

@@ -344,6 +344,53 @@ namespace Atomx.Data.Migrations
b.ToTable("Categories");
});
modelBuilder.Entity("Atomx.Common.Entities.Channel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("Channels");
});
modelBuilder.Entity("Atomx.Common.Entities.Currency", b =>
{
b.Property<int>("Id")
@@ -383,6 +430,9 @@ namespace Atomx.Data.Migrations
b.Property<decimal>("Rate")
.HasColumnType("decimal(16, 4)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Symbolic")
.IsRequired()
.HasColumnType("varchar(8)");
@@ -603,6 +653,10 @@ namespace Atomx.Data.Migrations
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<string>("Attachments")
.IsRequired()
.HasColumnType("varchar(1024)");
b.Property<string>("Body")
.IsRequired()
.HasColumnType("text");
@@ -617,10 +671,16 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<int>("LanguageId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(256)");
@@ -636,54 +696,6 @@ namespace Atomx.Data.Migrations
b.ToTable("MessageTemplates");
});
modelBuilder.Entity("Atomx.Common.Entities.PaymentChannel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Account")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("PaymentChannels");
});
modelBuilder.Entity("Atomx.Common.Entities.Permission", b =>
{
b.Property<long>("Id")