信息发布
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\traits\crud\CrudControllerTrait;
|
||||
use app\common\service\BannerService;
|
||||
|
||||
class BannerController extends BaseController
|
||||
{
|
||||
use CrudControllerTrait;
|
||||
|
||||
protected $service;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->service = new BannerService();
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮播图模块
|
||||
* @return \support\Response
|
||||
*/
|
||||
public function getBannerModule()
|
||||
{
|
||||
try {
|
||||
$raw = $this->service->getBannerModule();
|
||||
$data = $this->transformData($raw, method_exists($this, 'indexFormat')
|
||||
? [$this, 'indexFormat']
|
||||
: null);
|
||||
return $this->success($data);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user