enums.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. use App\Repositories\Enums\ResponseCodeEnum;
  11. return [
  12. ResponseCodeEnum::class => [
  13. // 成功
  14. ResponseCodeEnum::HTTP_OK => 'Success.', // 自定义 HTTP 状态码返回消息
  15. ResponseCodeEnum::HTTP_UNAUTHORIZED => 'Unauthorized.',
  16. // 业务操作成功
  17. ResponseCodeEnum::SERVICE_REGISTER_SUCCESS => 'Register success.',
  18. ResponseCodeEnum::SERVICE_LOGIN_SUCCESS => 'Login success.',
  19. // 客户端错误
  20. ResponseCodeEnum::CLIENT_PARAMETER_ERROR => 'Parameter error.',
  21. ResponseCodeEnum::CLIENT_CREATED_ERROR => 'Created error.',
  22. ResponseCodeEnum::CLIENT_DELETED_ERROR => 'Deleted error.',
  23. // 服务端错误
  24. ResponseCodeEnum::SYSTEM_ERROR => 'System error.',
  25. ResponseCodeEnum::SYSTEM_UNAVAILABLE => 'System unavailable.',
  26. // 业务操作失败:授权业务
  27. ResponseCodeEnum::SERVICE_REGISTER_ERROR => 'Register error.',
  28. ResponseCodeEnum::SERVICE_LOGIN_ERROR => 'Login error,',
  29. ],
  30. ];