validated(); $result = $this->systemDictDataService->getList($params); return $this->SuccessPage($result->items(), $result->total()); } /** * 获取简单列表 */ public function simpleList(SystemDictDataRequest $request): JsonResponse { // 不需要验证 $params = $request->validated(); $result = $this->systemDictDataService->getByType($params['dict_type'] ?? '', $params['only_active'] ?? false); return $this->Success($result); } /** * 获取字典数据详情 */ public function detail(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->getById($params['id']); return $this->Success($result); } /** * 创建字典数据 */ public function create(SystemDictDataRequest $request): JsonResponse { $data = $request->validated(); $result = $this->systemDictDataService->create($data); return $this->Success($result); } /** * 更新字典数据 */ public function update(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->update($params['id'], $params); return $this->Success($result); } /** * 删除字典数据 */ public function delete(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $this->systemDictDataService->delete($params['id']); return $this->Success(); } /** * 批量删除字典数据 */ public function batchDelete(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $this->systemDictDataService->batchDelete($params['ids']); return $this->Success(); } /** * 更新字典数据状态 */ public function updateStatus(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $this->systemDictDataService->updateStatus($params['id'], $params['status']); return $this->Success(); } /** * 批量更新状态 */ public function batchUpdateStatus(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $this->systemDictDataService->batchUpdateStatus($params['ids'], $params['status']); return $this->Success(); } /** * 更新排序 */ public function updateSort(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $this->systemDictDataService->updateSort($params['id'], $params['sort']); return $this->Success(); } /** * 批量更新排序 */ public function batchUpdateSort(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $this->systemDictDataService->batchUpdateSort($params['sort_data']); return $this->Success(); } /** * 根据字典类型获取数据列表 */ public function getByType(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->getByType($params['dict_type'], $params['only_active'] ?? true); return $this->Success($result); } /** * 根据字典类型获取选项列表 */ public function options(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->getOptions($params['dict_type'], $params['only_active'] ?? true); return $this->Success($result); } /** * 根据字典类型和值获取标签 */ public function getLabel(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->getLabel($params['dict_type'], $params['value']); return $this->Success($result); } /** * 根据字典类型和值获取字典数据 */ public function getByTypeAndValue(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->getByTypeAndValue($params['dict_type'], $params['value']); return $this->Success($result); } /** * 获取字典数据统计信息 */ public function statistics(SystemDictDataRequest $request): JsonResponse { $params = $request->validated(); $result = $this->systemDictDataService->getStatistics($params['dict_type'] ?? null); return $this->Success($result); } /** * 获取分组统计信息 */ public function groupStatistics(): JsonResponse { $result = $this->systemDictDataService->getGroupStatistics(); return $this->Success($result); } }