เพิ่มworkflow
This commit is contained in:
parent
617176f1b0
commit
f8f63e312f
2 changed files with 34 additions and 18 deletions
36
.github/workflows/release_leave.yaml
vendored
36
.github/workflows/release_leave.yaml
vendored
|
|
@ -70,21 +70,21 @@ jobs:
|
||||||
docker compose pull
|
docker compose pull
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
# - uses: snow-actions/line-notify@v1.1.0
|
||||||
if: success()
|
# if: success()
|
||||||
with:
|
# with:
|
||||||
access_token: ${{ secrets.TOKEN_LINE }}
|
# access_token: ${{ secrets.TOKEN_LINE }}
|
||||||
message: |
|
# message: |
|
||||||
-Success✅✅✅
|
# -Success✅✅✅
|
||||||
Image: ${{env.IMAGE_NAME}}
|
# Image: ${{env.IMAGE_NAME}}
|
||||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
# Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
||||||
By: ${{secrets.DOCKER_USER}}
|
# By: ${{secrets.DOCKER_USER}}
|
||||||
- uses: snow-actions/line-notify@v1.1.0
|
# - uses: snow-actions/line-notify@v1.1.0
|
||||||
if: failure()
|
# if: failure()
|
||||||
with:
|
# with:
|
||||||
access_token: ${{ secrets.TOKEN_LINE }}
|
# access_token: ${{ secrets.TOKEN_LINE }}
|
||||||
message: |
|
# message: |
|
||||||
-Failure❌❌❌
|
# -Failure❌❌❌
|
||||||
Image: ${{env.IMAGE_NAME}}
|
# Image: ${{env.IMAGE_NAME}}
|
||||||
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
# Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
|
||||||
By: ${{secrets.DOCKER_USER}}
|
# By: ${{secrets.DOCKER_USER}}
|
||||||
|
|
@ -17,6 +17,7 @@ using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
|
||||||
namespace BMA.EHR.Leave.Service.Controllers
|
namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -333,6 +334,21 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
// save to database
|
// save to database
|
||||||
await _leaveRequestRepository.AddAsync(leaveRequest);
|
await _leaveRequestRepository.AddAsync(leaveRequest);
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
refId = leaveRequest.Id,
|
||||||
|
sysName = "LEAVE_LIST",
|
||||||
|
posLevelName = profile.PosLevel,
|
||||||
|
posTypeName = profile.PosType,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return Success(new { id = leaveRequest.Id });
|
return Success(new { id = leaveRequest.Id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue