From 5c2ccb1304542d279e14815c5a519a5de66dfb40 Mon Sep 17 00:00:00 2001 From: "jay.chang" Date: Thu, 16 May 2024 11:07:26 +0800 Subject: [PATCH] =?UTF-8?q?[Webapi]=E6=AD=B7=E5=8F=B2=E8=B3=87=E6=96=99?= =?UTF-8?q?=E5=B8=B8=E7=94=A8=E7=B5=84=E5=90=88=E6=AA=94=E9=87=8D=E8=A4=87?= =?UTF-8?q?=E5=90=8D=E7=A8=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/HistoryController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index 76c4d6c..80cf877 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -19,6 +19,7 @@ using System.Text; using System.Threading.Tasks; using System.Xml; using System.Diagnostics; +using Microsoft.CodeAnalysis; namespace FrontendWebApi.ApiControllers @@ -1610,6 +1611,14 @@ namespace FrontendWebApi.ApiControllers public async Task>>> SaveHistoryFavorite([FromBody] HistoryFavorite post) { ApiResult> apiResult = new ApiResult>(jwt_str); + var favorite = await frontendRepository.GetOneAsync("history_favorite", "favorite_name = @favorite_name and deleted = 0", new { favorite_name = post.favorite_name }); + if (favorite != null) + { + apiResult.Code = "5000"; + apiResult.Msg = "已有該組合名稱"; + + return Ok(apiResult); + } if (!jwtlife) { apiResult.Code = "5000";