完善Dockerfile,更改数据库配置文件,日志记录增加Id主键

This commit is contained in:
YUN-PC5\user 2023-11-10 16:35:37 +08:00
parent b7ebad03d0
commit 43c9d3564b
4 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,7 @@
using System.Net.Sockets;
using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.SignalR.Client;
using NLog;
using SqlSugar;
using ZR.Admin.WebApi.Filters;
using ZR.Model;
@ -28,6 +29,7 @@ namespace ZR.Admin.WebApi.Controllers.System
private readonly IHubContext<MessageHub> _hubContext;
private readonly ISysNoticeLogService _sysNoticeLogService;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly Logger Logger = LogManager.GetCurrentClassLogger();
public SysNoticeController(ISysNoticeService sysNoticeService, IHubContext<MessageHub> hubContext, ISysNoticeLogService sysNoticeLogService, IWebHostEnvironment webHostEnvironment)
{
_sysNoticeService = sysNoticeService;

View File

@ -2,6 +2,8 @@
WORKDIR /app
EXPOSE 8888
#EXPOSE 443
VOLUME /app/adminlogs
VOLUME /app/wwwroot
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
@ -27,4 +29,6 @@ FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ZR.Admin.WebApi.dll"]
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y libfontconfig1

View File

@ -8,7 +8,7 @@
},
"dbConfigs": [
{
"Conn": "server=8.140.174.251;user=admin;pwd=admin123;database=ZrAdmin",
"Conn": "server=8.140.174.251;user=admin;pwd=admin123;database=ZrAdmin;port=33060",
"DbType": 0, // MySql = 0, SqlServer = 1, Oracle = 3PgSql = 4
"ConfigId": "0", //
"IsAutoCloseConnection": true

View File

@ -3,6 +3,10 @@
[SugarTable("sys_notice_log")]
public class SysNoticeLog
{
[SugarColumn(IsPrimaryKey = true)]
[JsonConverter(typeof(ValueToStringConverter))]
public long Id { get; set; }
[JsonConverter(typeof(ValueToStringConverter))]
public long NoticeId { get; set; }