PHPackages                             jncinet/qihucms-information - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jncinet/qihucms-information

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jncinet/qihucms-information
===========================

qihucms information.

1.0.1(5y ago)04MITPHP

Since Dec 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jncinet/qihucms-information)[ Packagist](https://packagist.org/packages/jncinet/qihucms-information)[ Docs](https://www.qihucms.com)[ RSS](/packages/jncinet-qihucms-information/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

会员好友、消息
=======

[](#会员好友消息)

安装
--

[](#安装)

```
$ 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

[](#好友策略表information_friend_policies)

FieldTypeLengthAllowNullDefaultCommentidbigint会员IDuser\_idbigint会员IDquestionvarchar66YNULL问题answervarchar255YNULL答案passwordvarchar255YNULL密码created\_attimestampYNULL创建时间updated\_attimestampYNULL更新时间### 好友关系表：information\_friends

[](#好友关系表information_friends)

FieldTypeLengthAllowNullDefaultCommentidbigintuser\_idbigint会员IDfriend\_idbigint好友IDfriend\_namevarchar66YNULL好友备注名称statustinyint0状态created\_attimestampYNULL创建时间updated\_attimestampYNULL更新时间### 好友消息表：information\_messages

[](#好友消息表information_messages)

FieldTypeLengthAllowNullDefaultCommentidbigintuser\_idbigint会员IDinformation\_friend\_idbigint好友关系messagetext好友备注名称typetinyint0信息类型statustinyint0接收状态created\_attimestampYNULL创建时间updated\_attimestampYNULL更新时间

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1955d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63541651e21494722aa0d364dca6dbaa132d0ee4e9f85a741b5eff8c587f57ba?d=identicon)[jncinet](/maintainers/jncinet)

---

Tags

informationqihucms

### Embed Badge

![Health badge](/badges/jncinet-qihucms-information/health.svg)

```
[![Health](https://phpackages.com/badges/jncinet-qihucms-information/health.svg)](https://phpackages.com/packages/jncinet-qihucms-information)
```

###  Alternatives

[zenstruck/bytes

Parse, manipulate, humanize, and format bytes.

25662.7k8](/packages/zenstruck-bytes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
