เพิ่มworkflow

This commit is contained in:
kittapath 2024-10-17 12:28:15 +07:00
parent 617176f1b0
commit f8f63e312f
2 changed files with 34 additions and 18 deletions

View file

@ -70,21 +70,21 @@ jobs:
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- uses: snow-actions/line-notify@v1.1.0
if: success()
with:
access_token: ${{ secrets.TOKEN_LINE }}
message: |
-Success✅✅✅
Image: ${{env.IMAGE_NAME}}
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
- uses: snow-actions/line-notify@v1.1.0
if: failure()
with:
access_token: ${{ secrets.TOKEN_LINE }}
message: |
-Failure❌❌❌
Image: ${{env.IMAGE_NAME}}
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
# - uses: snow-actions/line-notify@v1.1.0
# if: success()
# with:
# access_token: ${{ secrets.TOKEN_LINE }}
# message: |
# -Success✅✅✅
# Image: ${{env.IMAGE_NAME}}
# Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
# By: ${{secrets.DOCKER_USER}}
# - uses: snow-actions/line-notify@v1.1.0
# if: failure()
# with:
# access_token: ${{ secrets.TOKEN_LINE }}
# message: |
# -Failure❌❌❌
# Image: ${{env.IMAGE_NAME}}
# Version: ${{ steps.gen_ver.outputs.IMAGE_VER }}
# By: ${{secrets.DOCKER_USER}}

View file

@ -17,6 +17,7 @@ using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Swashbuckle.AspNetCore.Annotations;
using System.Security.Claims;
using System.Net.Http.Headers;
namespace BMA.EHR.Leave.Service.Controllers
{
@ -333,6 +334,21 @@ namespace BMA.EHR.Leave.Service.Controllers
// save to database
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 });
}