-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mysql-version
- Loading branch information
Showing
160 changed files
with
4,788 additions
and
4,453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# 进入docker-compose.yml文件的文件夹,$1代表外部传入的参数 | ||
echo -e "\033[36m start deploying... \033[0m" | ||
cd $1 | ||
|
||
# pull newest image | ||
echo -e "\033[36m step1: pull newest image \033[0m" | ||
sudo docker-compose pull >> /dev/null 2>&1 | ||
if [[ $? != 0 ]]; then | ||
exit 0 | ||
fi | ||
|
||
# beaucuse we doesn't need build image in server, so doesn't need "--build" | ||
echo -e "\033[36m step2: recreating container \033[0m" | ||
sudo docker-compose up --force-recreate -d >> /dev/null 2>&1 | ||
if [[ $? != 0 ]]; then | ||
exit 0 | ||
fi | ||
|
||
# remove dangling images | ||
echo -e "\033[36m step3: remove dangling images \033[0m" | ||
danglings=$(sudo docker images -f "dangling=true" -q) | ||
if test -n "$danglings"; then | ||
sudo docker rmi $(sudo docker images -f "dangling=true" -q) >>/dev/null 2>&1 | ||
if [[ $? != 0 ]]; then | ||
echo 'failed to remove danglings container...' | ||
exit $? | ||
fi | ||
fi | ||
|
||
echo -e "\033[36m done! \033[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build | ||
WORKDIR /src | ||
COPY ["Doublelives.Api/Doublelives.Api.csproj", "Doublelives.Api/"] | ||
COPY ["Doublelives.Core/Doublelives.Core.csproj", "Doublelives.Core/"] | ||
COPY ["Doublelives.Infrastructure/Doublelives.Infrastructure.csproj", "Doublelives.Infrastructure/"] | ||
COPY ["Doublelives.Cos/Doublelives.Cos.csproj", "Doublelives.Cos/"] | ||
COPY ["Doublelives.Domain/Doublelives.Domain.csproj", "Doublelives.Domain/"] | ||
COPY ["Doublelives.Shared/Doublelives.Shared.csproj", "Doublelives.Shared/"] | ||
COPY ["Doublelives.Service/Doublelives.Service.csproj", "Doublelives.Service/"] | ||
COPY ["Doublelives.Data/Doublelives.Data.csproj", "Doublelives.Data/"] | ||
COPY ["Doublelives.Migrations/Doublelives.Migrations.csproj", "Doublelives.Migrations/"] | ||
RUN dotnet restore "Doublelives.Api/Doublelives.Api.csproj" | ||
COPY . . | ||
WORKDIR /src/Doublelives.Api | ||
RUN dotnet build "Doublelives.Api.csproj" -c Release -o /app | ||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "Doublelives.Api.csproj" -c Release -o /app | ||
COPY ./publish ./app | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app . | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["dotnet", "Doublelives.Api.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
dl-api-csharp/Doublelives.Api/Controllers/DeptController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using AutoMapper; | ||
using Doublelives.Api.Models.Dept; | ||
using Doublelives.Service.Depts; | ||
using Doublelives.Service.WorkContextAccess; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
|
||
namespace Doublelives.Api.Controllers | ||
{ | ||
public class DeptController : AuthControllerBase | ||
{ | ||
private readonly IDeptService _deptService; | ||
private readonly IMapper _mapper; | ||
|
||
public DeptController( | ||
IWorkContextAccessor workContextAccessor, | ||
IDeptService deptService, | ||
IMapper mapper) | ||
: base(workContextAccessor) | ||
{ | ||
_deptService = deptService; | ||
_mapper = mapper; | ||
} | ||
|
||
/// <summary>获取部门层级</summary> | ||
[HttpGet("list")] | ||
public IActionResult List() | ||
{ | ||
var dtos = _deptService.List(); | ||
var model = _mapper.Map<List<DeptViewModel>>(dtos); | ||
|
||
return Ok(model); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 16 additions & 6 deletions
22
dl-api-csharp/Doublelives.Api/Controllers/NoticeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
using Doublelives.Api.Infrastructure; | ||
using Doublelives.Api.MockResponse; | ||
using AutoMapper; | ||
using Doublelives.Api.Models.Notice; | ||
using Doublelives.Service.Notices; | ||
using Doublelives.Service.WorkContextAccess; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.Collections.Generic; | ||
|
||
namespace Doublelives.Api.Controllers | ||
{ | ||
public class NoticeController : AuthControllerBase | ||
{ | ||
public NoticeController(IWorkContextAccessor workContextAccessor) | ||
private readonly INoticeService _noticeService; | ||
private readonly IMapper _mapper; | ||
|
||
public NoticeController( | ||
IWorkContextAccessor workContextAccessor, | ||
INoticeService noticeService, | ||
IMapper mapper) | ||
: base(workContextAccessor) | ||
{ | ||
_noticeService = noticeService; | ||
_mapper = mapper; | ||
} | ||
|
||
[HttpGet("list")] | ||
public IActionResult List() | ||
public IActionResult List(string title) | ||
{ | ||
var model = MockResponseHelper.GetMockModel<NoticeViewModel>("noticelist"); | ||
var result = _noticeService.List(title); | ||
var list = _mapper.Map<List<NoticeViewModel>>(result); | ||
|
||
return Ok(model); | ||
return Ok(list); | ||
} | ||
} | ||
} |
Oops, something went wrong.