You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
868 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Controller\v3;
  4. use App\Controller\BaseController;
  5. use App\Model\v3\UserRelationBind;
  6. use App\Request\v3\CommunityBindRequest;
  7. use App\Service\v3\Interfaces\UserRelationBindServiceInterface;
  8. use Hyperf\Di\Annotation\Inject;
  9. class CommunityController extends BaseController
  10. {
  11. /**
  12. * @Inject
  13. * @var UserRelationBindServiceInterface
  14. */
  15. protected $userCommunityService;
  16. // public function bind(CommunityBindRequest $request)
  17. public function bind()
  18. {
  19. // $data = $request->validated();
  20. $data = $this->request->all();
  21. $jsonData = $data['json_data'] ?? json_encode([]);
  22. $res = $this->userCommunityService->bind(UserRelationBind::BIND_TYPE_COMMUNITY, $data['source_id'], $data['user_id'], $jsonData);
  23. return $this->success(['id' => $res->id]);
  24. }
  25. }