* +---------------------------------------------------------------------- */ namespace App\Http\Controller\AdminApi\Assess; use App\Http\Controller\AdminApi\AuthController; use App\Http\Requests\enterprise\assess\TargetRequest; use App\Http\Service\Assess\AssessTargetService; use crmeb\interfaces\ResourceControllerInterface; use crmeb\traits\ResourceControllerTrait; use Spatie\RouteAttributes\Attributes\Middleware; use Spatie\RouteAttributes\Attributes\Prefix; use Spatie\RouteAttributes\Attributes\Resource; /** * 指标模板 */ #[Prefix('ent/assess/target')] #[Resource('/', false, names: [ 'index' => '获取指标列表接口', 'create' => '获取指标创建接口', 'store' => '保存指标接口', 'edit' => '获取指标信息接口', 'update' => '修改指标接口', 'show' => '修改指标状态接口', 'destroy' => '删除指标接口', ], parameters: ['' => 'id'])] #[Middleware(['auth.admin', 'ent.auth', 'ent.log'])] class TargetController extends AuthController implements ResourceControllerInterface { use ResourceControllerTrait; public function __construct(AssessTargetService $services) { parent::__construct(); $this->service = $services; } /** * 搜索字段. * @return array|\string[][] */ protected function getSearchField(): array { return [ ['name', ''], ['cate_id', ''], ]; } /** * 设置. */ protected function getRequestClassName(): string { return TargetRequest::class; } /** * 提取字段. */ protected function getRequestFields(): array { return [ ['cate_id', 0], ['name', ''], ['content', ''], ['status', 1], ['uid', $this->uuid], ]; } }