Merge branch 'abp' into ai-hub

This commit is contained in:
chenchun
2025-12-10 15:11:44 +08:00
7 changed files with 61 additions and 67 deletions

View File

@@ -3,7 +3,6 @@ using Mapster;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SqlSugar; using SqlSugar;
using TencentCloud.Pds.V20210701.Models;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.EventBus.Local; using Volo.Abp.EventBus.Local;

View File

@@ -1,5 +1,4 @@
using TencentCloud.Tbm.V20180129.Models; using Volo.Abp.DependencyInjection;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events; using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Local; using Volo.Abp.EventBus.Local;

View File

@@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.VisualBasic; using Microsoft.VisualBasic;
using TencentCloud.Mna.V20210119.Models;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;

View File

@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SqlSugar; using SqlSugar;
using TencentCloud.Tcr.V20190924.Models;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching; using Volo.Abp.Caching;

View File

@@ -1,59 +1,59 @@
using System; // using System;
using System.Collections.Generic; // using System.Collections.Generic;
using System.Linq; // using System.Linq;
using System.Text; // using System.Text;
using System.Threading.Tasks; // using System.Threading.Tasks;
using TencentCloud.Common.Profile; // using TencentCloud.Common.Profile;
using TencentCloud.Common; // using TencentCloud.Common;
using TencentCloud.Sms.V20210111.Models; // using TencentCloud.Sms.V20210111.Models;
using TencentCloud.Sms.V20210111; // using TencentCloud.Sms.V20210111;
using Volo.Abp.Domain.Services; // using Volo.Abp.Domain.Services;
using Microsoft.Extensions.Logging; // using Microsoft.Extensions.Logging;
//
namespace Yi.Framework.Rbac.Domain.Managers // namespace Yi.Framework.Rbac.Domain.Managers
{ // {
public class TencentCloudManager : DomainService // public class TencentCloudManager : DomainService
{ // {
private ILogger<TencentCloudManager> _logger; // private ILogger<TencentCloudManager> _logger;
public TencentCloudManager(ILogger<TencentCloudManager> logger) // public TencentCloudManager(ILogger<TencentCloudManager> logger)
{ // {
_logger= logger; // _logger= logger;
} // }
//
public async Task SendSmsAsync() // public async Task SendSmsAsync()
{ // {
//
try // try
{ // {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey此处还需注意密钥对的保密 // // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露并威胁账号下所有资源的安全性。以下代码示例仅供参考建议采用更安全的方式来使用密钥请参见https://cloud.tencent.com/document/product/1278/85305 // // 代码泄露可能会导致 SecretId 和 SecretKey 泄露并威胁账号下所有资源的安全性。以下代码示例仅供参考建议采用更安全的方式来使用密钥请参见https://cloud.tencent.com/document/product/1278/85305
// 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 // // 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
Credential cred = new Credential // Credential cred = new Credential
{ // {
SecretId = "SecretId", // SecretId = "SecretId",
SecretKey = "SecretKey" // SecretKey = "SecretKey"
}; // };
// 实例化一个client选项可选的没有特殊需求可以跳过 // // 实例化一个client选项可选的没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile(); // ClientProfile clientProfile = new ClientProfile();
// 实例化一个http选项可选的没有特殊需求可以跳过 // // 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile(); // HttpProfile httpProfile = new HttpProfile();
httpProfile.Endpoint = ("sms.tencentcloudapi.com"); // httpProfile.Endpoint = ("sms.tencentcloudapi.com");
clientProfile.HttpProfile = httpProfile; // clientProfile.HttpProfile = httpProfile;
//
// 实例化要请求产品的client对象,clientProfile是可选的 // // 实例化要请求产品的client对象,clientProfile是可选的
SmsClient client = new SmsClient(cred, "", clientProfile); // SmsClient client = new SmsClient(cred, "", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象 // // 实例化一个请求对象,每个接口都会对应一个request对象
SendSmsRequest req = new SendSmsRequest(); // SendSmsRequest req = new SendSmsRequest();
//
// 返回的resp是一个SendSmsResponse的实例与请求对象对应 // // 返回的resp是一个SendSmsResponse的实例与请求对象对应
SendSmsResponse resp = await client.SendSms(req); // SendSmsResponse resp = await client.SendSms(req);
// 输出json格式的字符串回包 // // 输出json格式的字符串回包
_logger.LogInformation("腾讯云Sms返回"+AbstractModel.ToJsonString(resp)); // _logger.LogInformation("腾讯云Sms返回"+AbstractModel.ToJsonString(resp));
} // }
catch (Exception e) // catch (Exception e)
{ // {
_logger.LogError(e,e.ToString()); // _logger.LogError(e,e.ToString());
} // }
} // }
} // }
} // }

View File

@@ -8,7 +8,7 @@
<PackageReference Include="IPTools.China" Version="1.6.0" /> <PackageReference Include="IPTools.China" Version="1.6.0" />
<PackageReference Include="TencentCloudSDK" Version="3.0.966" /> <!-- <PackageReference Include="TencentCloudSDK" Version="3.0.966" />-->
<PackageReference Include="UAParser" Version="3.1.47" /> <PackageReference Include="UAParser" Version="3.1.47" />

View File

@@ -1,7 +1,5 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Shouldly; using Shouldly;
using TencentCloud.Ame.V20190916.Models;
using TencentCloud.Tiw.V20190919.Models;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Xunit; using Xunit;
using Yi.Framework.Rbac.Application.Contracts.Dtos.User; using Yi.Framework.Rbac.Application.Contracts.Dtos.User;