railroad/usora 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

railroad/usora

Composer 安装命令:

composer require railroad/usora

包简介

User management system.

README 文档

README

Usora is a user management system including auth, user settings, user information, and single sign on.

Single Sign On

How it Works

Users can be signed in on any domain running this package with a single login attempt from any of the domains as long as they are all connected to the same usora database. This is possible by setting authentication cookies on all participating domains after the login succeeds using html img tags.

API Reference

Get Index of Users

GET user/index

Request Example(s)

$.ajax({
    url: 'https://www.musora.com' +
        '/usora/user/index?' +
        'limit=10' + '&' +
        'page=1' + '&' +
        'order_by_column=email' + '&' +
        'order_by_direction=asc',
    type: 'get',
    dataType: 'json',
    success: function(response) {
        // handle success
    },
    error: function(response) {
        // handle error
    }
});

Request Parameters

path|query|body key required default description|notes
query limit 25
query page 1
query order_by_column 'created_at'
query order_by_direction 'desc'

Response Example(s)

200 OK
{
   "status":"ok",
   "code":201,
   "results":{
      "id":217988,
      "content_id":202313,
      "key":"difficulty",
      "value":"1",
      "type":"integer",
      "position":1
   }
}

Get Single User by ID

GET user/show/{id}

Request Example(s)

var userId = 1;

$.ajax({
    url: 'https://www.musora.com' +
        '/usora/user/show/' . userId,
    type: 'get',
    dataType: 'json',
    success: function(response) {
        // handle success
    },
    error: function(response) {
        // handle error
    }
});

Request Parameters

path|query|body key required default description|notes
path yes Id of the user to be returned

Response Example(s)

200 OK
{
   "id":"1",
   "email":"pascale84@schimmel.com",
   "password":"$2y$10$hh5cU.fo.Jq48A267zkjiun\\/W.TwbRs4Pg02Nm.X7k.s5yKQxVMj2",
   "remember_token":"D5mpp6aZhvi5vOD7Fs4EDMw8782Be3hXcrRa7cUEaqt6eXlmQPmKbaU1RKdy",
   "session_salt":"0bPpeEbf13tpNi5zkN6bHSQ5Oq72s7YVrCkh2rkRA65Jttd16d0RGQNJbc1R",
   "display_name":"sed accusamus dolorem ut",
   "created_at":"1526460917",
   "updated_at":"1526460917",
   "fields":[]
}

Update User's Display Name

PUT user/update/{id}

Request Example(s)

var userId = 1;
var displayNameToSet = 'sed accusamus dolorem ut';

$.ajax({
    url: 'https://www.musora.com' +
        '/usora/user/update/' . userId,
    type: 'patch',
    data: {display_name: displayNameToSet},
    dataType: 'json',
    success: function(response) {
        // handle success
    },
    error: function(response) {
        // handle error
    }
});

Request Parameters

path|query|body key required default description|notes
path yes user id
body display_name yes new display name to set

Response Example(s)

200 OK
{
   "id":"1",
   "email":"pascale84@schimmel.com",
   "password":"$2y$10$hh5cU.fo.Jq48A267zkjiun\\/W.TwbRs4Pg02Nm.X7k.s5yKQxVMj2",
   "remember_token":"D5mpp6aZhvi5vOD7Fs4EDMw8782Be3hXcrRa7cUEaqt6eXlmQPmKbaU1RKdy",
   "session_salt":"0bPpeEbf13tpNi5zkN6bHSQ5Oq72s7YVrCkh2rkRA65Jttd16d0RGQNJbc1R",
   "display_name":"sed accusamus dolorem ut",
   "created_at":"1526460917",
   "updated_at":"1526460917",
   "fields":[

   ]
}

(todo: the rest of the endpoints)

Get details from "USORA USER MANAGEMENT SYSTEM - JSON API" section of https://musora.readme.io/v1.0.0/reference

  • put, user/store
  • patch, user/update/:id
  • delete, user/delete/:id
  • get, user-field/index/:id
  • get, user-field/show/:id
  • put, user-field/store
  • patch, user-field/update/:id
  • patch, user-field/update-or-create-by-key
  • delete, user-field/delete/:id
  • patch, user-field/update-or-create-multiple-by-key

Events

Name Parameters Listener exists Resultant action(s)
UserEvent id, eventType no n/a
EmailChangeRequest token, email no n/a

EmailChangeRequest

Captures that an EmailChangeRequest was made.

Trigger exists in request method of EmailChangeController

No Listener exists.

UserEvent

Capture any user-account change.

Trigger exists in:...

  1. Both UserQuery* methods
    1. insertGetId (eventType param value: "created")
    2. update (eventType param value: "updated")
  2. All three UserFieldQuery* methods (eventType param value: "field-updated" in each)
    1. insertGetId
    2. update
    3. delete

*namespace for each is Railroad\Usora\Repositories\Queries

No listener exists.

The End.

railroad/usora 适用场景与选型建议

railroad/usora 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 79.44k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「management」 「Users」 「musora」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 railroad/usora 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 railroad/usora 我们能提供哪些服务?
定制开发 / 二次开发

基于 railroad/usora 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 79.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 11
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-10