This commit is contained in:
GukSang.Jin
2026-03-18 13:53:44 +08:00
parent 54b3448e31
commit 0a884fa6cb
20 changed files with 1700 additions and 110 deletions

View File

@@ -98,4 +98,30 @@ public class ApiService
throw new Exception($"更新订单状态失败: {ex.Message}", ex);
}
}
public async Task<Package?> UpdatePackageAsync(Package package)
{
try
{
var response = await _httpClient.PutAsJsonAsync($"api/packages/{package.Id}", new
{
package.Price,
package.FirstSprayWaterTime,
package.AfterShampoo1SprayTime,
package.AfterShampoo2SprayTime,
package.AfterShampoo3SprayTime,
package.SprayShampoo1Time,
package.SprayShampoo2Time,
package.SprayShampoo3Time,
package.HotAirTime,
package.ColdAirTime,
package.UvSterilizationTime
});
response.EnsureSuccessStatusCode();
return await response.Content.ReadFromJsonAsync<Package>();
}
catch (HttpRequestException ex)
{
throw new Exception($"保存套餐配置失败: {ex.Message}", ex);
}
}
}