更新
This commit is contained in:
@@ -8,11 +8,48 @@ use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\logic\auth\AuthLogic;
|
||||
use app\adminapi\logic\firstvisit\WecomAcquisitionCustomerLogic;
|
||||
use app\adminapi\logic\firstvisit\WecomPromotionLogic;
|
||||
use app\common\service\qywx\QywxPromotionContactApiService;
|
||||
use app\common\service\qywx\QywxPromotionMediaService;
|
||||
|
||||
class WecomPromotionController extends BaseAdminController
|
||||
{
|
||||
private const PAGE_PERMISSION = 'firstvisit.wecomPromotion/overview';
|
||||
|
||||
public function tagOptions()
|
||||
{
|
||||
if (!$this->hasPagePermission()) {
|
||||
return $this->fail('权限不足');
|
||||
}
|
||||
return $this->run(fn () => $this->data((new QywxPromotionContactApiService())->tagOptions()));
|
||||
}
|
||||
|
||||
public function createTag()
|
||||
{
|
||||
if (!$this->hasPagePermission()) {
|
||||
return $this->fail('权限不足');
|
||||
}
|
||||
if (!$this->request->isPost()) {
|
||||
return $this->fail('请使用 POST 创建标签');
|
||||
}
|
||||
$name = $this->request->post('name', '');
|
||||
if (!is_string($name)) {
|
||||
return $this->fail('标签名称格式不正确');
|
||||
}
|
||||
return $this->run(fn () => $this->data((new QywxPromotionContactApiService())->createTag($name)));
|
||||
}
|
||||
|
||||
public function uploadWelcomeMedia()
|
||||
{
|
||||
if (!$this->hasPagePermission()) {
|
||||
return $this->fail('权限不足');
|
||||
}
|
||||
return $this->run(fn () => $this->data((new QywxPromotionMediaService())->upload(
|
||||
$this->request->file('file'),
|
||||
(string) $this->request->post('type', ''),
|
||||
$this->adminId
|
||||
)));
|
||||
}
|
||||
|
||||
public function overview()
|
||||
{
|
||||
if (!$this->hasPagePermission()) {
|
||||
|
||||
Reference in New Issue
Block a user