mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-04 08:06:37 +08:00
短信发送
This commit is contained in:
@@ -7,8 +7,10 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common;
|
||||
using Yi.Framework.Common.Const;
|
||||
using Yi.Framework.Common.Helper;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.Common.QueueModel;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.DTOModel;
|
||||
using Yi.Framework.Interface;
|
||||
@@ -25,11 +27,13 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
|
||||
private IUserService _userService;
|
||||
private IMenuService _menuService;
|
||||
public AccountController(ILogger<UserController> logger, IUserService userService, IMenuService menuService)
|
||||
private RabbitMQInvoker _rabbitMQInvoker;
|
||||
public AccountController(ILogger<UserController> logger, IUserService userService, IMenuService menuService,RabbitMQInvoker rabbitMQInvoker)
|
||||
{
|
||||
_logger = logger;
|
||||
_userService = userService;
|
||||
_menuService = menuService;
|
||||
_rabbitMQInvoker = rabbitMQInvoker;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +87,14 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
return Result.Error();
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public Result SendSMS(SMSQueueModel test)
|
||||
{
|
||||
_rabbitMQInvoker.Send(new Common.IOCOptions.RabbitMQConsumerModel() { ExchangeName=RabbitConst.SMS_Exchange,QueueName=RabbitConst.SMS_Queue_Send} );
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 传入邮箱,需要先到数据库判断该邮箱是否被人注册过,到userservice写mail_exist方法,还有接口别忘了。这个接口不需要洞,只需要完成userservice写mail_exist与接口即可
|
||||
/// </summary>
|
||||
|
||||
@@ -28,6 +28,10 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
_quartzInvoker = quartzInvoker;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> startJob()
|
||||
{
|
||||
@@ -44,18 +48,30 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> getRunJobList()
|
||||
{
|
||||
return Result.Success().SetData(await _quartzInvoker.getRunJobList());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public Result getJobClass()
|
||||
{
|
||||
return Result.Success().SetData(_quartzInvoker.getJobClassList());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<Result> stopJob()
|
||||
{
|
||||
@@ -63,6 +79,10 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<Result> DeleteJob()
|
||||
{
|
||||
@@ -70,6 +90,10 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<Result> ResumeJob()
|
||||
{
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SetRoleByUser
|
||||
/// 给多个用户设置多个角色,ids有用户id与 角色列表ids,多对多,ids1用户,ids2为角色
|
||||
/// 用户设置给用户设置角色
|
||||
/// </summary>
|
||||
|
||||
@@ -70,7 +70,10 @@ namespace Yi.Framework.ApiMicroservice
|
||||
#endregion
|
||||
services.AddRabbitMQService();
|
||||
|
||||
|
||||
#region
|
||||
//短信服务配置
|
||||
#endregion
|
||||
services.AddSMSService();
|
||||
}
|
||||
|
||||
#region Autofac容器注入
|
||||
@@ -158,6 +161,7 @@ namespace Yi.Framework.ApiMicroservice
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
<param name="code"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.SendMail">
|
||||
<summary>
|
||||
发送邮件
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Email(System.String)">
|
||||
<summary>
|
||||
传入邮箱,需要先到数据库判断该邮箱是否被人注册过,到userservice写mail_exist方法,还有接口别忘了。这个接口不需要洞,只需要完成userservice写mail_exist与接口即可
|
||||
@@ -47,6 +53,42 @@
|
||||
<param name="file"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.JobController.startJob">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.JobController.getRunJobList">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.JobController.getJobClass">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.JobController.stopJob">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.JobController.DeleteJob">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.JobController.ResumeJob">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.MenuController.GetMenuInMould">
|
||||
<summary>
|
||||
这个是要递归的,但是要过滤掉删除的,所以,可以写一个通用过滤掉删除的方法
|
||||
@@ -203,6 +245,7 @@
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.UserController.SetRoleByUser(Yi.Framework.DTOModel.IdsListDto{System.Int32})">
|
||||
<summary>
|
||||
SetRoleByUser
|
||||
给多个用户设置多个角色,ids有用户id与 角色列表ids,多对多,ids1用户,ids2为角色
|
||||
用户设置给用户设置角色
|
||||
</summary>
|
||||
|
||||
@@ -13,11 +13,12 @@
|
||||
"Apollo_Enabled": false,
|
||||
"HealthCheck_Enabled": false,
|
||||
"Cors_Enabled": true,
|
||||
"RabbitMQ_Enabled": false,
|
||||
"RabbitMQ_Enabled": true,
|
||||
"Redis_Enabled": true,
|
||||
"RedisSeed_Enabled": true,
|
||||
"Kafka_Enabled": false,
|
||||
"MutiDB_Enabled": false,
|
||||
"SMS_Enabled": true,
|
||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||
"DbSelect": "Mysql",
|
||||
|
||||
@@ -46,6 +47,12 @@
|
||||
"DB": 1,
|
||||
"Password": "Qz52013142020."
|
||||
},
|
||||
"RabbitConn": {
|
||||
"HostName": "118.195.191.41",
|
||||
"UserName": "cc",
|
||||
"Password": "cc",
|
||||
"Port": 5672
|
||||
},
|
||||
"KafkaOptions": {
|
||||
"BrokerList": "192.168.3.230:9092",
|
||||
"TopicName": "kafkalog"
|
||||
@@ -65,5 +72,11 @@
|
||||
"DeregisterCriticalServiceAfter": 60,
|
||||
"Tag": "13"
|
||||
},
|
||||
"SMS": {
|
||||
"ID": "LTAI5tJvjPaXCyyPMfXLNbVA",
|
||||
"Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn",
|
||||
"Sign": "JiftCC",
|
||||
"Template": "SMS_221640732"
|
||||
},
|
||||
"IPLibraryServiceUrl": "http://gRPCIPLibraryService"
|
||||
}
|
||||
Reference in New Issue
Block a user