Merge branch 'abp' into ai-hub
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -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" />
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user