Compare commits

..

No commits in common. "f639962b68ce341709b58b67e28f36007e3c5e88" and "da57773cd3f6699d797871172f0a087df44559f2" have entirely different histories.

6 changed files with 136 additions and 84 deletions

View File

@ -85,6 +85,7 @@
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.7.0" /> <PackageReference Include="Quartz.Extensions.Hosting" Version="3.7.0" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" /> <PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.1" /> <PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.1" />
<PackageReference Include="Serilog.Sinks.Email" Version="2.4.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" /> <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
</ItemGroup> </ItemGroup>

View File

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Serilog; using Serilog;
using Serilog.Events; using Serilog.Events;
//using Serilog.Sinks.Email; using Serilog.Sinks.Email;
using System; using System;
using System.Net; using System.Net;

View File

@ -23,9 +23,9 @@ using System.Linq;
using Spire.Doc; using Spire.Doc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using System; using System;
using System.Runtime.InteropServices;
using SharpCompress.Common; using SharpCompress.Common;
using SkiaSharp; using SkiaSharp;
using System.Runtime.InteropServices;
namespace IRaCIS.Core.Application.Service namespace IRaCIS.Core.Application.Service
{ {

View File

@ -0,0 +1,50 @@
using System.Runtime.InteropServices;
namespace IRaCIS.Core.Domain.Share
{
[StructLayout(LayoutKind.Sequential)]
public class NetResource
{
public int dwScope;
public int dwType;
public int dwDisplayType;
public int dwUsage;
public string lpLocalName;
public string lpRemoteName;
public string lpComment;
public string lpProvider;
}
public class WNetAddConnectionHelper
{
[DllImport("mpr.dll", EntryPoint = "WNetAddConnection2")]
private static extern uint WNetAddConnection2(NetResource lpNetResource, string lpPassword, string lpUsername, uint dwFlags);
[DllImport("mpr.dll")]
public static extern int WNetCancelConnection2A(string sharename, int dwFlags, int fForce);
public static void Connect()
{
var remoteName = @"\\192.168.1.119\Potomac_01";
NetResource netResource = new NetResource();
netResource.dwScope = 1;
netResource.dwType = 1;
netResource.dwDisplayType = 3;
netResource.dwUsage = 1;
netResource.lpLocalName = "W:";
netResource.lpRemoteName = remoteName.TrimEnd('\\');
WNetAddConnection2(netResource, "Everest@suzhou406", "share", 1);
}
public static int Disconnect()
{
return WNetCancelConnection2A("W:", 1, 1);
}
}
}

View File

@ -37,7 +37,8 @@ namespace IRaCIS.Core.Domain.Models
public DateTime CreateTime { get; set; } = DateTime.Now; public DateTime CreateTime { get; set; } = DateTime.Now;
public Guid UpdateUserId { get; set; } = Guid.Empty; public Guid UpdateUserId { get; set; } = Guid.Empty;
public DateTime UpdateTime { get; set; } = DateTime.Now; public DateTime UpdateTime { get; set; } = DateTime.Now;
[JsonIgnore]
public List<Subject> SubjectList { get; set; }
//导航属性 //导航属性
[JsonIgnore] [JsonIgnore]

View File

@ -1,30 +1,82 @@
kind: pipeline kind: pipeline
type: ssh type: docker
name: ssh-linux-uat-irc-build-image name: irc-netcore-api
platform:
os: Linux
arch: 386
clone: clone:
disable: true disable: true #禁用默认克隆
server:
host: 47.117.164.182
user: root
password:
from_secret: test_ssh_pwd
steps: steps:
- name: build-uat-irc - name: clone-repo
image: alpine/git
pull: if-not-exists
volumes:
- name: irc-test-work
path: /work
commands: commands:
- cd /opt/1panel/xc-deploy/Uat_IRC/devops-build-publish/Uat-To-Uat - if [ ! -e /work/netcore-repo/.git ]; then
- sh pull-build-uat-irc-image.sh v${DRONE_BUILD_NUMBER} git clone -b Test.IRC http://192.168.3.68:2000/XCKJ/irc-netcore-api.git /work/netcore-repo;
else
cd /work/netcore-repo;
git pull;
fi
- |
if [ ! -e Dockerfile ]; then
echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0
EXPOSE 80
WORKDIR /app
COPY publish .
ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]' > /work/Dockerfile
fi
- name: restore-publish
image: mcr.microsoft.com/dotnet/sdk:6.0
pull: if-not-exists
depends_on:
- clone-repo
volumes:
- name: nuget-packages
path: /root/.nuget/packages
- name: irc-test-work
path: /work
commands:
- cd /work/netcore-repo/IRaCIS.Core.API
- dotnet restore ./IRaCIS.Core.API.csproj
- rm -rf /work/publish
- cd /work/netcore-repo/IRaCIS.Core.API
- dotnet publish ./IRaCIS.Core.API.csproj -c Release --no-restore -o /work/publish
- name: docker-build
image: docker
pull: if-not-exists
depends_on:
- restore-publish
commands:
- cd /work
- docker build -t test-irc:v${DRONE_BUILD_NUMBER} .
volumes:
- name: irc-test-work
path: /work
- name: dockersock
path: /var/run/docker.sock
volumes:
- name: nuget-packages
host:
path: /opt/cicd/nuget/packages
- name: irc-test-work
host:
path: /opt/cicd/irc-test
- name: dockersock
host:
path: /var/run/docker.sock
trigger: trigger:
branch: branch:
- Uat_IRC_Net8 - master
--- ---
kind: pipeline kind: pipeline
type: ssh type: ssh
@ -35,8 +87,8 @@ platform:
arch: 386 arch: 386
clone: clone:
disable: true disable: true #禁用默认克隆
server: server:
host: 106.14.89.110 host: 106.14.89.110
user: root user: root
@ -46,13 +98,17 @@ server:
steps: steps:
- name: publish-test-irc - name: publish-test-irc
commands: commands:
- cd /opt/1panel/xc-deploy/Test_IRC/devops-build-publish;sh test-irc-update-or-create-stack.sh v${DRONE_BUILD_NUMBER} - echo start publish test-irc-api
- cd /opt/1panel/hang/devops/test-irc
- sh test-irc.sh v${DRONE_BUILD_NUMBER}
trigger: trigger:
branch: branch:
- Test_IRC_Net8 - Test.IRC
--- ---
kind: pipeline kind: pipeline
type: ssh type: ssh
name: ssh-linux-test-study-publish name: ssh-linux-test-study-publish
@ -73,68 +129,12 @@ server:
steps: steps:
- name: publish-test-study - name: publish-test-study
commands: commands:
- cd /opt/1panel/xc-deploy/Test_Study/devops-build-publish - echo start publish test-study-api
- cd /opt/1panel/hang/devops/test-study
- sh test-study.sh v${DRONE_BUILD_NUMBER} - sh test-study.sh v${DRONE_BUILD_NUMBER}
trigger: trigger:
branch: branch:
- Test.Study - Test.Study
---
kind: pipeline
type: ssh
name: ssh-linux-test-scp-publish
platform:
os: Linux
arch: 386
clone:
disable: true #禁用默认克隆
server:
host: 106.14.89.110
user: root
password:
from_secret: test_ssh_pwd
steps:
- name: publish-test-hir-scp
commands:
- cd /opt/1panel/xc-deploy/Test_HIR_SCP/devops-build-publish;sh pull-build-test-hir-scp-image.sh v${DRONE_BUILD_NUMBER}
- cd /opt/1panel/xc-deploy/Test_HIR_SCP ;sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER}
trigger:
branch:
- Test_HIR
---
kind: pipeline
type: ssh
name: ssh-linux-test-hir-publish
platform:
os: Linux
arch: 386
clone:
disable: true #禁用默认克隆
server:
host: 106.14.89.110
user: root
password:
from_secret: test_ssh_pwd
steps:
- name: publish-test-hir
commands:
- cd /opt/1panel/xc-deploy/Test_HIR/devops-build-publish;sh pull-build-test-hir-image.sh v${DRONE_BUILD_NUMBER}
- cd /opt/1panel/xc-deploy/Test_HIR ; sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER}
trigger:
branch:
- Test_HIR