PHPackages                             xueyoubang/return-code - 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. xueyoubang/return-code

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

xueyoubang/return-code
======================

规范后端 通用返回码

1.1.2(6y ago)1292MITPHPPHP &gt;=7.0

Since Apr 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/hetengji/return-code)[ Packagist](https://packagist.org/packages/xueyoubang/return-code)[ RSS](/packages/xueyoubang-return-code/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

规范后端 通用返回码

```
    /**
     * Notes: 统一数据返回格式
     * author XXXX
     * Date: 2019/8/8
     * Time: 10:14
     * @param int $code
     * @param string $msg
     * @param array $data
     * @return \Illuminate\Http\JsonResponse
     */
    public function buildResponse($code = 200, $msg = '操作成功', $data=[],$jsonp='') {
        $res = array(
            "meta" => array("code"=>$code,"message"=>$msg,"callback"=>"bamaso"),
            "data" => $data
        );
        if (!$jsonp) {
            return response()->json($res);
        } else {
            return response()->json($res)->setCallback($jsonp);
        }
    }
    /**
     * Notes:课程首页信息获取
     * author XXXX
     * Date: 2019/8/14
     * Time: 11:32
     * @return \Illuminate\Http\JsonResponse
     */
    public function course()
    {
        $data = $this->course->course();
        if ($data) {
            return $this->buildResponse(ReturnCode::SUCCESS, ReturnCode::errorCode(ReturnCode::SUCCESS), $data);
        }
        return $this->buildResponse(ReturnCode::NOT_EXISTS , ReturnCode::errorCode(ReturnCode::NOT_EXISTS), '');
    }
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

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

2230d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77f90f65e3ea141ae2bb9f23ce3a8c0a39f8a3720256a4cda9852eb2e1a4350c?d=identicon)[hetengji](/maintainers/hetengji)

### Embed Badge

![Health badge](/badges/xueyoubang-return-code/health.svg)

```
[![Health](https://phpackages.com/badges/xueyoubang-return-code/health.svg)](https://phpackages.com/packages/xueyoubang-return-code)
```

PHPackages © 2026

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