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
32 lines
868 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\v3;
|
|
|
|
use App\Controller\BaseController;
|
|
use App\Model\v3\UserRelationBind;
|
|
use App\Request\v3\CommunityBindRequest;
|
|
use App\Service\v3\Interfaces\UserRelationBindServiceInterface;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
class CommunityController extends BaseController
|
|
{
|
|
|
|
/**
|
|
* @Inject
|
|
* @var UserRelationBindServiceInterface
|
|
*/
|
|
protected $userCommunityService;
|
|
|
|
// public function bind(CommunityBindRequest $request)
|
|
public function bind()
|
|
{
|
|
// $data = $request->validated();
|
|
$data = $this->request->all();
|
|
$jsonData = $data['json_data'] ?? json_encode([]);
|
|
$res = $this->userCommunityService->bind(UserRelationBind::BIND_TYPE_COMMUNITY, $data['source_id'], $data['user_id'], $jsonData);
|
|
return $this->success(['id' => $res->id]);
|
|
}
|
|
|
|
}
|