Bubble.Library
1.6.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Bubble.Library --version 1.6.3
NuGet\Install-Package Bubble.Library -Version 1.6.3
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="Bubble.Library" Version="1.6.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bubble.Library --version 1.6.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bubble.Library, 1.6.3"
#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 Bubble.Library as a Cake Addin #addin nuget:?package=Bubble.Library&version=1.6.3 // Install Bubble.Library as a Cake Tool #tool nuget:?package=Bubble.Library&version=1.6.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
描述
一个帮助进行.NET Web API开发的Nuget包,正在持续完善中...<br>
功能说明
生命周期的依赖注入
- 共有三个接口:IScopeDependency、ISingletonDependency、ITransientDependency。
- 对于每一对Service和IService,在Service接口引入中根据需求再添加以上三种生命周期接口中的一种。
- 在项目启动程序Program.cs中,添加示例代码实现自动依赖注入:
RegisterLifeCycle.AddCustomServices(builder.Services);
或
使用Autofac
builder.Host.ConfigureContainer<ContainerBuilder>(b =>
{
b.RegisterModule<DependencyModule>();
});
EF Core
- Entity类<br>
实体类继承
Entity
类可默认包含int
类型的Id
字段主键,若需要其他类型的主键,比如string
类型,可继承Entity<string>
扩展类。 - IsDeleted接口<br>
实体类实现
IsDeleted
接口后,在使用EF Core查询会自动过滤IsDeleted=true
的数据。 - IHasCreationTime接口<br>
实体类实现
IHasCreationTime
接口后,在使用EF Core新增数据时,会自动赋值CreationTime=DateTime.Now
。 - IHasModificationTime接口<br>
实体类实现
IHasModificationTime
接口后,在使用EF Core修改数据时,会自动赋值LastModificationTime=DateTime.Now
。 - IHasDeletionTime接口<br>
实体类实现
IHasDeletionTime
接口后,在使用EF Core删除数据时,会自动赋值DeletionTime=DateTime.Now
,同时实现IsDeleted
接口的话,会将删除状态转换为修改状态,并把IsDeleted
设置为true
。
阿里云
短信验证码
Service注入ISmsService
可调用短信验证码相关函数:支持单个发送和批量发送短信验证码,批量发送一次最多支持100个。
OSS存储
Service注入IOssService
可调用OSS存储相关函数:目前支持有上传图片函数,后续会更新上传文件、视频等函数。
接口统一返回类ApiResult
接口继承ApiBaseController
类后,返回值会自动引入ApiResult
类:
Result
:返回值(当接口有返回值时有)IsSuccess
:接口执行成功标识Message
:错误信息,结合StringResponseException
异常,抛出的错误信息会体现在这。ErrorCode
:错误代码OperationId
:操作Id
快速登录
Service注入IQQService
可调用QQ相关函数,因逻辑可能每个人实现会有所不同,所以这里实现了以下四个基本的阶段函数:
GetAuthorizationLink
:入参QQAuthorizationCodeInputDto
,返回封装好的QQ授权的链接地址<br> 注:此步骤生成的state
,最好在回调接口中进行检验,可存储在redis中以便校验GetAccessTokenAsync
:入参QQAccessTokenInputDto
,返回QQAccessTokenOutputDto
包含AccessToken
等字段GetOpenIdAsync
:入参QQOpenIdInputDto
,返回QQOpenIdOutputDto
包含OpenId
等字段GetUserInfoAsync
:入参QQUserInfoInputDto
,返回QQUserInfoOutputDto
包含QQ用户的基本信息
待更新...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- AlibabaCloud.SDK.Dysmsapi20170525 (>= 2.0.23)
- Aliyun.OSS.SDK.NetCore (>= 2.13.0)
- Autofac (>= 7.0.1)
- Microsoft.AspNetCore.Mvc.Core (>= 2.1.38)
- Microsoft.EntityFrameworkCore (>= 7.0.7)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
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 |
---|---|---|
2.2.0 | 118 | 11/7/2023 |
2.1.1 | 135 | 11/4/2023 |
2.1.0 | 122 | 11/3/2023 |
2.0.1 | 108 | 11/2/2023 |
2.0.0 | 169 | 9/15/2023 |
1.6.10 | 187 | 8/14/2023 |
1.6.9 | 151 | 8/14/2023 |
1.6.8 | 137 | 8/14/2023 |
1.6.7 | 152 | 8/14/2023 |
1.6.6 | 174 | 8/12/2023 |
1.6.5 | 161 | 8/7/2023 |
1.6.4 | 172 | 7/24/2023 |
1.6.3 | 155 | 7/7/2023 |
1.6.2 | 145 | 6/30/2023 |
1.6.1 | 141 | 6/28/2023 |
1.6.0 | 152 | 6/28/2023 |
1.5.0 | 151 | 6/26/2023 |
1.4.5 | 139 | 6/22/2023 |
1.4.4 | 136 | 6/22/2023 |
1.4.3 | 149 | 6/22/2023 |
1.4.2 | 143 | 6/22/2023 |
1.4.1 | 135 | 6/22/2023 |
1.4.0 | 138 | 6/21/2023 |
1.3.0 | 144 | 6/19/2023 |
1.2.0 | 143 | 6/18/2023 |
1.1.0 | 162 | 6/12/2023 |
1.0.1 | 147 | 6/8/2023 |
1.0.0 | 159 | 6/7/2023 |