|
|
@ -4,8 +4,9 @@ declare(strict_types=1); |
|
|
|
|
|
|
|
|
namespace App\Controller; |
|
|
namespace App\Controller; |
|
|
|
|
|
|
|
|
|
|
|
use App\Model\UserRelationBind; |
|
|
use App\Request\CommunityBindRequest; |
|
|
use App\Request\CommunityBindRequest; |
|
|
use App\Service\CommunityServiceInterface; |
|
|
|
|
|
|
|
|
use App\Service\UserRelationBindServiceInterface; |
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
|
|
|
|
|
class CommunityController extends BaseController |
|
|
class CommunityController extends BaseController |
|
|
@ -13,13 +14,14 @@ class CommunityController extends BaseController |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Inject |
|
|
* @Inject |
|
|
* @var CommunityServiceInterface |
|
|
|
|
|
|
|
|
* @var UserRelationBindServiceInterface |
|
|
*/ |
|
|
*/ |
|
|
protected $communityService; |
|
|
|
|
|
|
|
|
protected $userCommunityService; |
|
|
|
|
|
|
|
|
public function bind(CommunityBindRequest $request) |
|
|
public function bind(CommunityBindRequest $request) |
|
|
{ |
|
|
{ |
|
|
$res = $this->communityService->bind($request->validated()); |
|
|
|
|
|
|
|
|
$data = $request->validated(); |
|
|
|
|
|
$res = $this->userCommunityService->bindLimitByUser(UserRelationBind::BIND_TYPE_COMMUNITY, $data['source_id'], $data['user_id'], $data['json_data']); |
|
|
return $this->success(['id' => $res->id]); |
|
|
return $this->success(['id' => $res->id]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|