Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
2a701e3ce2 | |||
319aed04f7 | |||
9762e793cb | |||
6618b04a26 | |||
a88862d6b0 | |||
272a3328be | |||
1a71ef9f24 | |||
20da8d1acb | |||
50c4cfd10b | |||
1858a7439f | |||
a946293f16 |
56
.gitea/workflows/develop.yml
Normal file
56
.gitea/workflows/develop.yml
Normal file
@ -0,0 +1,56 @@
|
||||
name: Backend_develop # 工作流的名称
|
||||
|
||||
# 当有代码推送到仓库的 develop 分支时,这个 Actions 工作流会被触发并执行
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "backend_runner"
|
||||
steps:
|
||||
- name: test
|
||||
shell: powershell
|
||||
run: |
|
||||
echo "Git clone_start"
|
||||
|
||||
# 設定變數
|
||||
$projectPath = "D:\Code\Project\TCM"
|
||||
$backendPath = "D:\Code\Project\TCM\Backend"
|
||||
$apiPath = "D:\Code\Server\TCM\API"
|
||||
|
||||
cd D:\Code\Project\TCM
|
||||
if (Test-Path "Backend") { Remove-Item -Recurse -Force "Backend" } # 刪除原資料
|
||||
if (-not (Test-Path "Backend")) {New-Item -Path "Backend" -ItemType Directory -Force} # 建立資料夾
|
||||
echo " Cloneing ..."
|
||||
git clone -b develop http://leovip125.ddns.net:8418/TCM/Backend.git
|
||||
echo "Clone End"
|
||||
|
||||
# .NET 發布
|
||||
echo "發布 start"
|
||||
|
||||
# 切換到 Backend 目錄
|
||||
cd $backendPath
|
||||
if ($LASTEXITCODE -ne 0) { exit 1}
|
||||
|
||||
# 還原與建置
|
||||
dotnet restore
|
||||
if ($LASTEXITCODE -ne 0) {exit 1 }
|
||||
|
||||
dotnet build --configuration Release
|
||||
if ($LASTEXITCODE -ne 0) { exit 1}
|
||||
|
||||
# 移除舊的 API 發布資料夾
|
||||
if (Test-Path $apiPath) { Remove-Item -Recurse -Force $apiPath }
|
||||
|
||||
# 確保目標資料夾存在
|
||||
New-Item -Path $apiPath -ItemType Directory -Force | Out-Null
|
||||
|
||||
# 發布
|
||||
dotnet publish -c Release -o $apiPath
|
||||
if ($LASTEXITCODE -ne 0) {exit 1 }
|
||||
|
||||
echo "發布 end"
|
||||
|
||||
|
56
.gitea/workflows/main.yml
Normal file
56
.gitea/workflows/main.yml
Normal file
@ -0,0 +1,56 @@
|
||||
name: Backend_main # 工作流的名称
|
||||
|
||||
# 当有代码推送到仓库的 develop 分支时,这个 Actions 工作流会被触发并执行
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "backend_runner"
|
||||
steps:
|
||||
- name: test
|
||||
shell: powershell
|
||||
run: |
|
||||
echo "Git clone_start"
|
||||
|
||||
# 設定變數
|
||||
$projectPath = "D:\Code\Project\TCM_main"
|
||||
$backendPath = "D:\Code\Project\TCM_main\Backend"
|
||||
$apiPath = "D:\Code\Server\TCM\API_main"
|
||||
|
||||
cd D:\Code\Project\TCM_main
|
||||
if (Test-Path "Backend") { Remove-Item -Recurse -Force "Backend" } # 刪除原資料
|
||||
if (-not (Test-Path "Backend")) {New-Item -Path "Backend" -ItemType Directory -Force} # 建立資料夾
|
||||
echo " Cloneing ..."
|
||||
git clone -b main http://leovip125.ddns.net:8418/TCM/Backend.git
|
||||
echo "Clone End"
|
||||
|
||||
# .NET 發布
|
||||
echo "發布 start"
|
||||
|
||||
# 切換到 Backend 目錄
|
||||
cd $backendPath
|
||||
if ($LASTEXITCODE -ne 0) { exit 1}
|
||||
|
||||
# 還原與建置
|
||||
dotnet restore
|
||||
if ($LASTEXITCODE -ne 0) {exit 1 }
|
||||
|
||||
dotnet build --configuration Release
|
||||
if ($LASTEXITCODE -ne 0) { exit 1}
|
||||
|
||||
# 移除舊的 API 發布資料夾
|
||||
if (Test-Path $apiPath) { Remove-Item -Recurse -Force $apiPath }
|
||||
|
||||
# 確保目標資料夾存在
|
||||
New-Item -Path $apiPath -ItemType Directory -Force | Out-Null
|
||||
|
||||
# 發布
|
||||
dotnet publish -c Release -o $apiPath
|
||||
if ($LASTEXITCODE -ne 0) {exit 1 }
|
||||
|
||||
echo "發布 end"
|
||||
|
||||
|
@ -36,6 +36,7 @@ namespace TCM_API.Controllers.lamiter
|
||||
var data = await(from a in _context.company_detail_table
|
||||
join b in _context.user_table on a.guid equals b.guid into joined
|
||||
from b in joined.DefaultIfEmpty()
|
||||
orderby a.data_create_time
|
||||
select new
|
||||
{
|
||||
company_name = a.company_name,
|
||||
|
@ -33,6 +33,7 @@ namespace TCM_API.Controllers.manage
|
||||
{
|
||||
|
||||
var data = await (from c in _context.health_detail_table
|
||||
orderby c.data_create_time
|
||||
select new
|
||||
{
|
||||
health_name = c.health_name,
|
||||
@ -52,15 +53,16 @@ namespace TCM_API.Controllers.manage
|
||||
{
|
||||
|
||||
var data = await (from a in _context.health_detail_table
|
||||
join b in _context.user_table on a.guid equals b.guid into joined
|
||||
from b in joined.DefaultIfEmpty() // LEFT JOIN
|
||||
where a.company_guid == guid
|
||||
select new
|
||||
{
|
||||
health_name = a.health_name,
|
||||
guid = a.guid,
|
||||
level = b.level
|
||||
}).ToListAsync();
|
||||
join b in _context.user_table on a.guid equals b.guid into joined
|
||||
from b in joined.DefaultIfEmpty() // LEFT JOIN
|
||||
where a.company_guid == guid
|
||||
orderby a.data_create_time
|
||||
select new
|
||||
{
|
||||
health_name = a.health_name,
|
||||
guid = a.guid,
|
||||
level = b.level
|
||||
}).ToListAsync();
|
||||
|
||||
return Ok(data);
|
||||
}
|
||||
|
@ -125,6 +125,13 @@ if (app.Environment.IsDevelopment())
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "TCM_API");
|
||||
});
|
||||
}
|
||||
|
||||
app.UseSwagger();
|
||||
//app.UseSwaggerUI();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "TCM_API");
|
||||
});
|
||||
//在 ASP.NET Core 中啟用 CORS (跨原始來源要求)
|
||||
// Shows UseCors with CorsPolicyBuilder.
|
||||
app.UseCors(builder =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user