|
|
|
@ -69,12 +69,15 @@ public class LocalMode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var deeplResp = JsonConvert.DeserializeObject<DeepLResponse>(responseBody);
|
|
|
|
|
|
|
|
|
|
var response = new Response
|
|
|
|
|
{
|
|
|
|
|
Code = resp.StatusCode.GetHashCode(),
|
|
|
|
|
Data = deeplResp?.Result?.Texts?.FirstOrDefault()?.Text ?? deeplResp?.Error?.Message ?? "Empty Response"
|
|
|
|
|
Code = resp.StatusCode.GetHashCode()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string defaultMessage = resp.StatusCode == System.Net.HttpStatusCode.OK ? "Empty Result" : "Empty Error Message";
|
|
|
|
|
response.Data = deeplResp?.Result?.Texts?.FirstOrDefault()?.Text ?? deeplResp?.Error?.Message ?? defaultMessage;
|
|
|
|
|
|
|
|
|
|
return JsonConvert.SerializeObject(response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|