jncinet/qihucms-information
Composer 安装命令:
composer require jncinet/qihucms-information
包简介
qihucms information.
关键字:
README 文档
README
安装
$ composer require jncinet/qihucms-information
开始
数据迁移
$ php artisan migrate
发布资源
$ php artisan vendor:publish --provider="Qihucms\Information\InformationServiceProvider"
定时删除一个月前的消息
$ php artisan information:checkMessage
后台菜单
- 会员消息
information/messages - 会员好友
information/friends - 好友验证问题
information/friend-policies
使用
路由参数说明
好友列表
请求:GET 地址:information/friends?status=1,好友状态&limit=15每页条数&page=页码 返回值: { data: [ { 'id' => 1, 'user_id' => 2, 'friend' => {好友会员资料}, 'friend_name' => "好友1", // 好友备注名 'status' => 1, // 好友状态 'information_messages_count' => 0, // 消息总数 'information_messages_first' => "你好", // 最新消息 'created_at' => "1秒前", }, ... ], links:{}, meta:{} }
添加好友
如果会员设置了加好友规则,则须通过验证才能成为好友。
请求:POST
地址:information/friends
参数:
{
friend_id: 要添加会员ID,
password: 好友验证密码,
answer: 好友验证问题答案
}
返回值:
{
'id' => 1,
'user_id' => 2,
'friend' => {好友会员资料},
'friend_name' => "好友1", // 好友备注名
'status' => 1, // 好友状态
'information_messages_count' => 0, // 消息总数
'information_messages_first' => "你好", // 最新消息
'created_at' => "1秒前",
}
审核好友申请
请求:GET
地址:information/friends/{id=好友ID}?status={有此参数无论何值均为不通过,无此参数即为通过}
返回值:
{
status: SUCCESS,
result: {
friend_id: 好友ID,
status: 1, // ['待确认', '已通过', '已拒绝', '已删除']
}
}
修改好友备注名称
请求:PATCH|PUT 地址:information/friends/{id=好友ID} 参数:{ friend_name: '备注名' } 返回值: { status: SUCCESS, result: { friend_id: 好友ID, friend_name: '备注名' } }
删除好友
请求:DELETE
地址:information/friends/{id=好友ID}
返回值:
{
status: SUCCESS,
result: {
friend_id: 好友ID,
}
}
有消息的好友列表
请求:GET
地址:information/messages/{id=好友关系ID}
返回值:
{
data: [
{
'id' => 1,
'user_id' => 2,
'information_friend' => {好友会员资料},
'friend_name' => "好友1", // 好友备注名
'status' => 1, // 好友状态
'information_messages_count' => 0, // 消息总数
'information_messages_first' => "你好", // 最新消息
'created_at' => "1秒前",
},
...
],
links:{},
meta:{}
}
好友消息列表
请求:GET 地址:information/messages?limit=15每页条数&page=页码 返回值: { data: [ { 'id' => 1, 'user_id' => 2, 'information_friend' => { 'id' => 1, 'user_id' => 2, 'friend' => {好友会员资料}, 'friend_name' => "好友1", // 好友备注名 'status' => 1, // 好友状态 'information_messages_count' => 0, // 消息总数 'information_messages_first' => "你好", // 最新消息 'created_at' => "1秒前", }, 'type' => 0, // ['文本', '图片', '视频', '音频', '分享连接'] 'message' => "消息内容", 'status' => 1, // 消息状态 'created_at' => "1秒前", }, ... ], links:{}, meta:{} }
发布消息
请求:POST
地址:information/messages
参数:{
'information_friend_id' => '好友关系ID',
'type' => 0, // '消息类型'
'message' => '消息内容',
}
返回:{
'id' => 1,
'user_id' => 2,
'information_friend' => {
'id' => 1,
'user_id' => 2,
'friend' => {好友会员资料},
'friend_name' => "好友1", // 好友备注名
'status' => 1, // 好友状态
'information_messages_count' => 0, // 消息总数
'information_messages_first' => "你好", // 最新消息
'created_at' => "1秒前",
},
'type' => 0, // ['文本', '图片', '视频', '音频', '分享连接']
'message' => "消息内容",
'status' => 1, // 消息状态
'created_at' => "1秒前",
}
更新消息阅读状态
请求:PATCH|PUT
地址:information/messages/{id=好友关系ID}
返回:{
"id": 1 // 好友关系ID
}
清空消息
- 请求方式:DELETE
- 请求地址:information/messages/{id=好友关系ID}?all=true
- 返回值
{
"id": 1 // 好友关系ID
"all": true
}
批量删除消息
- 请求方式:DELETE
- 请求地址:information/messages/{id=好友关系ID}?ids=1,2,3
- 返回值
{
"id": 1 // 好友关系ID
"ids": [1,2,3]
}
删除消息一条消息
- 请求方式:DELETE
- 请求地址:information/messages/{id=消息ID}
- 返回值
{
"id": 1 // 消息ID
}
事件调用
// 添加好友 Qihucms\Information\Events\AddFriend; // 发送消息 Qihucms\Information\Events\SendMessage;
数据库
好友策略表:information_friend_policies
| Field | Type | Length | AllowNull | Default | Comment |
|---|---|---|---|---|---|
| id | bigint | 会员ID | |||
| user_id | bigint | 会员ID | |||
| question | varchar | 66 | Y | NULL | 问题 |
| answer | varchar | 255 | Y | NULL | 答案 |
| password | varchar | 255 | Y | NULL | 密码 |
| created_at | timestamp | Y | NULL | 创建时间 | |
| updated_at | timestamp | Y | NULL | 更新时间 |
好友关系表:information_friends
| Field | Type | Length | AllowNull | Default | Comment |
|---|---|---|---|---|---|
| id | bigint | ||||
| user_id | bigint | 会员ID | |||
| friend_id | bigint | 好友ID | |||
| friend_name | varchar | 66 | Y | NULL | 好友备注名称 |
| status | tinyint | 0 | 状态 | ||
| created_at | timestamp | Y | NULL | 创建时间 | |
| updated_at | timestamp | Y | NULL | 更新时间 |
好友消息表:information_messages
| Field | Type | Length | AllowNull | Default | Comment |
|---|---|---|---|---|---|
| id | bigint | ||||
| user_id | bigint | 会员ID | |||
| information_friend_id | bigint | 好友关系 | |||
| message | text | 好友备注名称 | |||
| type | tinyint | 0 | 信息类型 | ||
| status | tinyint | 0 | 接收状态 | ||
| created_at | timestamp | Y | NULL | 创建时间 | |
| updated_at | timestamp | Y | NULL | 更新时间 |
jncinet/qihucms-information 适用场景与选型建议
jncinet/qihucms-information 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「information」 「qihucms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jncinet/qihucms-information 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jncinet/qihucms-information 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jncinet/qihucms-information 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package for extracting link previews with customizable parsers, and caching support
Find informations about an email address owner
Convert and operate with FIPS codes for states, counties, etc.
Get IP address information from multi geoip providers
eZ Publish Legacy extension which provides a simple solution for extending thet default eZ Publish Binary File Datatype with support for uploadable files for collected information nodes. Great for smart developers!
A module for the Silverstripe CMS to provide related website owner data
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-22