代码修改后的版本,全部提交

This commit is contained in:
ss001
2026-02-07 15:48:27 +08:00
parent cccbaa37c9
commit c2cda58c65
15604 changed files with 2455502 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Hcm.V20181106
{
using Newtonsoft.Json;
using System.Threading.Tasks;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Hcm.V20181106.Models;
public class HcmClient : AbstractClient{
private const string endpoint = "hcm.tencentcloudapi.com";
private const string version = "2018-11-06";
/// <summary>
/// Client constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
public HcmClient(Credential credential, string region)
: this(credential, region, new ClientProfile())
{
}
/// <summary>
/// Client Constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
/// <param name="profile">Client profiles.</param>
public HcmClient(Credential credential, string region, ClientProfile profile)
: base(endpoint, version, credential, region, profile)
{
}
/// <summary>
/// 速算题目批改接口根据用户上传的图片或图片的URL识别图片中的数学算式进而给出算式的正确性评估。
/// </summary>
/// <param name="req"><see cref="EvaluationRequest"/></param>
/// <returns><see cref="EvaluationResponse"/></returns>
public async Task<EvaluationResponse> Evaluation(EvaluationRequest req)
{
JsonResponseModel<EvaluationResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "Evaluation");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<EvaluationResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 速算题目批改接口根据用户上传的图片或图片的URL识别图片中的数学算式进而给出算式的正确性评估。
/// </summary>
/// <param name="req"><see cref="EvaluationRequest"/></param>
/// <returns><see cref="EvaluationResponse"/></returns>
public EvaluationResponse EvaluationSync(EvaluationRequest req)
{
JsonResponseModel<EvaluationResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "Evaluation");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<EvaluationResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
}
}

View File

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Hcm.V20181106.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class EvaluationRequest : AbstractModel
{
/// <summary>
/// 图片唯一标识一张图片一个SessionId
/// </summary>
[JsonProperty("SessionId")]
public string SessionId{ get; set; }
/// <summary>
/// 图片数据需要使用base64对图片的二进制数据进行编码与url参数二者填一即可
/// </summary>
[JsonProperty("Image")]
public string Image{ get; set; }
/// <summary>
/// 业务应用ID与账号应用APPID无关是用来方便客户管理服务的参数新的 HcmAppid 可以在[控制台](https://console.cloud.tencent.com/hcm)【应用管理】下新建。
/// </summary>
[JsonProperty("HcmAppid")]
public string HcmAppid{ get; set; }
/// <summary>
/// 图片url与Image参数二者填一即可
/// </summary>
[JsonProperty("Url")]
public string Url{ get; set; }
/// <summary>
/// 横屏拍摄开关,若开启则支持传输横屏拍摄的图片;
/// </summary>
[JsonProperty("SupportHorizontalImage")]
public bool? SupportHorizontalImage{ get; set; }
/// <summary>
/// 拒绝非速算图(如风景图、人物图)开关,若开启,则遇到非速算图会快速返回拒绝的结果,但极端情况下可能会影响评估结果(比如算式截图贴到风景画里可能被判为非速算图直接返回了)。
/// </summary>
[JsonProperty("RejectNonArithmeticImage")]
public bool? RejectNonArithmeticImage{ get; set; }
/// <summary>
/// 异步模式标识0同步模式1异步模式。默认为同步模式
/// </summary>
[JsonProperty("IsAsync")]
public long? IsAsync{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SessionId", this.SessionId);
this.SetParamSimple(map, prefix + "Image", this.Image);
this.SetParamSimple(map, prefix + "HcmAppid", this.HcmAppid);
this.SetParamSimple(map, prefix + "Url", this.Url);
this.SetParamSimple(map, prefix + "SupportHorizontalImage", this.SupportHorizontalImage);
this.SetParamSimple(map, prefix + "RejectNonArithmeticImage", this.RejectNonArithmeticImage);
this.SetParamSimple(map, prefix + "IsAsync", this.IsAsync);
}
}
}

View File

@@ -0,0 +1,65 @@
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Hcm.V20181106.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class EvaluationResponse : AbstractModel
{
/// <summary>
/// 图片唯一标识一张图片一个SessionId
/// </summary>
[JsonProperty("SessionId")]
public string SessionId{ get; set; }
/// <summary>
/// 识别出的算式信息;
/// 注意:此字段可能返回 null表示取不到有效值。
/// </summary>
[JsonProperty("Items")]
public ItemInfo[] Items{ get; set; }
/// <summary>
/// 任务 id用于查询接口
/// </summary>
[JsonProperty("TaskId")]
public string TaskId{ get; set; }
/// <summary>
/// 唯一请求 ID每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
/// </summary>
[JsonProperty("RequestId")]
public string RequestId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SessionId", this.SessionId);
this.SetParamArrayObj(map, prefix + "Items.", this.Items);
this.SetParamSimple(map, prefix + "TaskId", this.TaskId);
this.SetParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
}

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Hcm.V20181106.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class ItemCoord : AbstractModel
{
/// <summary>
/// 算式高度
/// </summary>
[JsonProperty("Height")]
public long? Height{ get; set; }
/// <summary>
/// 算式宽度
/// </summary>
[JsonProperty("Width")]
public long? Width{ get; set; }
/// <summary>
/// 算式图的左上角横坐标
/// </summary>
[JsonProperty("X")]
public long? X{ get; set; }
/// <summary>
/// 算式图的左上角纵坐标
/// </summary>
[JsonProperty("Y")]
public long? Y{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Height", this.Height);
this.SetParamSimple(map, prefix + "Width", this.Width);
this.SetParamSimple(map, prefix + "X", this.X);
this.SetParamSimple(map, prefix + "Y", this.Y);
}
}
}

View File

@@ -0,0 +1,72 @@
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Hcm.V20181106.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class ItemInfo : AbstractModel
{
/// <summary>
/// 识别的算式是否正确
/// </summary>
[JsonProperty("Item")]
public string Item{ get; set; }
/// <summary>
/// 识别的算式
/// </summary>
[JsonProperty("ItemString")]
public string ItemString{ get; set; }
/// <summary>
/// 识别的算式在图片上的位置信息
/// </summary>
[JsonProperty("ItemCoord")]
public ItemCoord ItemCoord{ get; set; }
/// <summary>
/// 推荐的答案,暂不支持多个关系运算符、无关系运算符、单位换算错题的推荐答案返回。
/// </summary>
[JsonProperty("Answer")]
public string Answer{ get; set; }
/// <summary>
/// 算式题型编号如加减乘除四则题型具体题型及编号如下1 加减乘除四则 2 加减乘除已知结果求运算因子3 判断大小 4 约等于估算 5 带余数除法 6 分数四则运算 7 单位换算 8 竖式加减法 9 竖式乘除法 10 脱式计算 11 解方程
/// 注意:此字段可能返回 null表示取不到有效值。
/// </summary>
[JsonProperty("ExpressionType")]
public string ExpressionType{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Item", this.Item);
this.SetParamSimple(map, prefix + "ItemString", this.ItemString);
this.SetParamObj(map, prefix + "ItemCoord.", this.ItemCoord);
this.SetParamSimple(map, prefix + "Answer", this.Answer);
this.SetParamSimple(map, prefix + "ExpressionType", this.ExpressionType);
}
}
}