UserNotificationController.php 799 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\api\controller\user;
  3. use app\models\coin\UserCoinTransfer;
  4. use app\models\redis\UserHash;
  5. use app\models\system\DictCoin;
  6. use app\Request;
  7. use crmeb\services\JsonService;
  8. use think\facade\Config;
  9. use think\facade\Log;
  10. use think\facade\Cache;
  11. /**
  12. *
  13. * activities json 配置:
  14. mining:
  15. {
  16. "enabled": 1,
  17. "symbol": "btc",
  18. }
  19. * Class UserNotificationController
  20. * @package app\api\controller\user
  21. */
  22. class UserNotificationController {
  23. /**
  24. * 定时请求的状态接口
  25. * @param Request $request
  26. */
  27. public function snapshot(Request $request) {
  28. $uid = $request->uid();
  29. // 未读消息
  30. $unread = UserHash::unread_get($uid);
  31. return app('json')->successful([
  32. 'unread': intval($unread),
  33. ]));
  34. }
  35. }