phuocdaivl/sts-sdk
Composer 安装命令:
composer require phuocdaivl/sts-sdk
包简介
User management and Brand tenant
README 文档
README
User management and Brand tenant
Download & Install
composer require phuocdaivl/sts-sdk
Add service provider
Add the service provider to the providers array in the config/app.php config file as follows:
'providers' => [ ... DaiDP\StsSDK\Providers\StsServiceProvider::class, ]
Well done.
User management
Basic use:
$umSDK = app()->get(\DaiDP\StsSDK\UserManagement\UserManagementInterface::class);
Methods
The following methods are available on the UserManagement instance.
register()
Create new account
$data = [ 'username' => '0766808284', 'fullname' => 'Phước Đại', 'email' => '0766808284@gmail.com', 'password' => '12345678', 'confirmpassword' => '12345678' ]; $result = $umSDK->register($data);
resetPassword()
Set new password for account
$phone = '0766808284'; $password = 'abc123ABC'; $result = $umSDK->resetPassword($phone, $password);
Tenant management
Basic use:
$tmSDK = app()->get(\DaiDP\StsSDK\TenantManagement\TenantManagementInterface::class);
Methods
The following methods are available on the TenantManagement instance.
createTenant()
Create new database tenant
$name = 'tenant001'; $result = $tmSDK->createTenant($name);
createConnectionString()
Create new database connection of tenant
$idTenant = 'f06e16bc-1035-4de3-93cc-96bdd21da4a5'; $connectionString = 'Server=localhost;port=3306;Database=tenant_01;user=root;password='; $result = $tmSDK->createConnectionString($idTenant, $connectionString);
getConnectionStrings()
Get database connection string list
$serviceName = 'RetailProBrand'; $result = $tmSDK->getConnectionStrings($serviceName);
System user management
Basic use:
$sysuSDK = app()->get(\DaiDP\StsSDK\SystemUserManagement\SystemUserManagementInterface::class);
Methods
The following methods are available on the SystemUserManagement instance.
register()
Create new account
$data = [ 'email' => 'admin001@gmail.com', 'fullname' => 'Phước Đại', 'password' => '12345678', 'confirmpassword' => '12345678' ]; $result = $sysuSDK->register($data);
resetPassword()
Set new password for account
$email = 'admin001@gmail.com'; $password = 'abc123ABC'; $result = $sysuSDK->resetPassword($email, $password);
changePassword()
Change account password
$email = 'admin001@gmail.com'; $oldPassword = '12345678'; $newPassword = 'abc123ABC'; $result = $sysuSDK->changePassword($email, $oldPassword, $newPassword);
Tenant user management
Basic use:
$tumSDK = app()->get(\DaiDP\StsSDK\TenantUserManagement\TenantUserManagementInterface::class); $tumSDK->setTenantId('f06e16bc-1035-4de3-93cc-96bdd21da4a5'); // required
Methods
The following methods are available on the TenantUserManagement instance.
register()
Create new account
$data = [ 'username' => 'usertn001', 'email' => 'usertn001@gmail.com', 'fullname' => 'Phước Đại', 'password' => '12345678', 'confirmpassword' => '12345678' ]; $result = $tumSDK->register($data);
resetPassword()
Set new password for account
$username = 'usertn001'; $password = 'abc123ABC'; $result = $tumSDK->resetPassword($username, $password);
changePassword()
Change account password
$username = 'usertn001'; $oldPassword = '12345678'; $newPassword = 'abc123ABC'; $result = $tumSDK->changePassword($username, $oldPassword, $newPassword);
phuocdaivl/sts-sdk 适用场景与选型建议
phuocdaivl/sts-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 351 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phuocdaivl/sts-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phuocdaivl/sts-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 351
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-06