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.
 
 

29 lines
738 B

<?php
declare(strict_types=1);
namespace App\Controller;
use App\Model\UserRelationBind;
use App\Request\CommunityBindRequest;
use App\Service\UserRelationBindServiceInterface;
use Hyperf\Di\Annotation\Inject;
class CommunityController extends BaseController
{
/**
* @Inject
* @var UserRelationBindServiceInterface
*/
protected $userCommunityService;
public function bind(CommunityBindRequest $request)
{
$data = $request->validated();
$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]);
}
}