AbpBoilerplate.RocketChat 0.1.0

dotnet add package AbpBoilerplate.RocketChat --version 0.1.0
NuGet\Install-Package AbpBoilerplate.RocketChat -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AbpBoilerplate.RocketChat" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AbpBoilerplate.RocketChat --version 0.1.0
#r "nuget: AbpBoilerplate.RocketChat, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AbpBoilerplate.RocketChat as a Cake Addin
#addin nuget:?package=AbpBoilerplate.RocketChat&version=0.1.0

// Install AbpBoilerplate.RocketChat as a Cake Tool
#tool nuget:?package=AbpBoilerplate.RocketChat&version=0.1.0

RocketChat

适用于AbpBoilerplate的RocketChat Api库

Rocket.Chat 是一个免费、开源、可扩展、高度可定制且安全的平台,可让您与团队进行交流和协作、共享文件和实时聊天(https://www.rocket.chat/)

Rocket.Chat服务的安装请阅读Rocket.Chat 安装与设置启动项

快速开始

一. 在项目中引用AbpBoilerplate.RocketChat

dotnet add package AbpBoilerplate.RocketChat

二. 添加RocketChatModule模块依赖

[DependsOn(typeof(RocketChatModule))]
public class CoreModule : AbpModule

三. appsettings.json配置文件中,添加服务相关配置

"Im": {
    "Provider": "RocketChat",
    "Address": "http://localhost:3000/",            //rocketchat服务地址
    "WebSocketAddress": "ws://localhost:3000/",     //websocket地址
    "AdminUserName": "super",                       //AdminUser的用户名
    "AdminPassword": "123qwe",                      //AdminUser的密码
    "DefaultPassword": "123qwe"                     //创建用户时的默认密码
}
...

注意:AdminUserName和AdminPassword请填写配置RocketChat时的初始用户用名与密码。

四. 在构造函数中注入服务,可用的服务如下

public class ImManager : DomainService
{
	public ImManager(
		IRocketChatConfiguration rocketChatConfiguration,
		IocManager iocManager,
		IAuthenticationService authenticationService,
		IFileRestClientService fileRestClientService,
		IChatService chatService,
		IUsersService usersService,
		IChannelsService channelsService,
		IRoomService roomService,
		IAssetsService assetsService,
		IAutoTranslateService autoTranslateService,
		ICommandsService commandsService,
		IEmojisService emojisService)
...

五. 在编写的领域服务方法中调用,如发送消息方法可编写如下

public async Task<Result<MessageResult>> SendMessage(string content, string roomId)
{
	var model = new SendMessage();
	model.Message = new MessageInput()
	{
		Content = content,
		RoomId = roomId,
		TimeStamp = DateTime.Now,
	};
	model.RoomId = roomId;
	return await chatService.SendMessage(model);
}

作者信息

作者:林小

邮箱:jevonsflash@qq.com

License

The MIT License (MIT)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 342 12/16/2022