2020-06-28 08:33:34 +08:00
|
|
|
|
<?php
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | 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 ]
|
|
|
|
|
// +----------------------------------------------------------------------
|
2020-06-28 08:33:49 +08:00
|
|
|
|
namespace catchAdmin\wechat\controller;
|
|
|
|
|
|
|
|
|
|
use catchAdmin\wechat\repository\WechatGraphicRepository;
|
|
|
|
|
use catchAdmin\wechat\repository\WechatUsersRepository;
|
|
|
|
|
use catcher\base\CatchController;
|
|
|
|
|
use catcher\base\CatchRequest;
|
|
|
|
|
use catcher\CatchResponse;
|
|
|
|
|
use catcher\library\WeChat;
|
|
|
|
|
use catcher\Utils;
|
|
|
|
|
use think\facade\Console;
|
|
|
|
|
use think\Request;
|
|
|
|
|
|
|
|
|
|
class Graphic extends CatchController
|
|
|
|
|
{
|
|
|
|
|
protected $graphic;
|
|
|
|
|
|
|
|
|
|
public function __construct(WechatGraphicRepository $graphic)
|
|
|
|
|
{
|
|
|
|
|
$this->graphic = $graphic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* list
|
|
|
|
|
*
|
|
|
|
|
* @time 2020年06月27日
|
|
|
|
|
* @param CatchRequest $request
|
|
|
|
|
* @return \think\response\Json
|
|
|
|
|
*/
|
|
|
|
|
public function index(CatchRequest $request)
|
|
|
|
|
{
|
|
|
|
|
return CatchResponse::paginate($this->graphic->getList($request->param()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function read($id)
|
|
|
|
|
{
|
|
|
|
|
return CatchResponse::success($this->graphic->findBy($id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function save(CatchRequest $request)
|
|
|
|
|
{
|
|
|
|
|
return CatchResponse::success($this->graphic->storeBy($request->param()));
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-30 08:40:00 +08:00
|
|
|
|
public function update($id, CatchRequest $request)
|
2020-06-28 08:33:49 +08:00
|
|
|
|
{
|
|
|
|
|
return CatchResponse::success($this->graphic->updateBy($id, $request->param()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function delete($id)
|
|
|
|
|
{
|
|
|
|
|
return CatchResponse::success($this->graphic->deleteBy($id));
|
|
|
|
|
}
|
|
|
|
|
}
|