微信标签管理

This commit is contained in:
JaguarJack
2020-06-21 18:04:30 +08:00
parent 4392f25e97
commit fbf9c11191
10 changed files with 400 additions and 11 deletions

View File

@@ -1,10 +1,94 @@
<?php
/**
* @filename Tags.php
* @createdAt 2020/6/21
* @project https://github.com/yanwenwu/catch-admin
* @document http://doc.catchadmin.com
* @author JaguarJack <njphper@gmail.com>
* @copyright By CatchAdmin
* @license https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt
*/
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\wechat\controller;
use think\Request;
use catcher\CatchResponse;
use catcher\base\CatchController;
use catchAdmin\wechat\repository\WechatTagsRepository;
class Tags extends CatchController
{
protected $repository;
public function __construct(WechatTagsRepository $repository)
{
$this->repository = $repository;
}
/**
* 列表
*
* @time 2020/06/21 14:45
*
* @return \think\Response
*/
public function index()
{
return CatchResponse::paginate($this->repository->getList());
}
/**
* 保存
*
* @time 2020/06/21 14:45
* @param Request Request
* @return \think\Response
*/
public function save(Request $request)
{
return CatchResponse::success($this->repository->storeBy($request->post()));
}
/**
* 读取
*
* @time 2020/06/21 14:45
* @param $id
* @return \think\Response
*/
public function read($id)
{
return CatchResponse::success($this->repository->findBy($id));
}
/**
* 更新
*
* @time 2020/06/21 14:45
* @param Request $request
* @return \think\Response
*/
public function update(Request $request, $id)
{
return CatchResponse::success($this->repository->updateBy($id, $request->post()));
}
/**
* 删除
*
* @time 2020/06/21 14:45
* @param $id
* @return \think\Response
*/
public function delete($id)
{
return CatchResponse::success($this->repository->deleteBy($id));
}
public function sync()
{
return CatchResponse::success($this->repository->sync());
}
}

View File

@@ -14,6 +14,7 @@ use catchAdmin\wechat\repository\WechatUsersRepository;
use catcher\base\CatchController;
use catcher\CatchResponse;
use catcher\Utils;
use think\facade\Console;
class Users extends CatchController
{
@@ -60,6 +61,13 @@ class Users extends CatchController
return CatchResponse::success($this->user->block($id));
}
public function sync()
{
Console::call('sync:users');
return CatchResponse::success('', 'success');
}
public function subscribe()
{