Browse Source

feat(api): 新增企业画像和知识库下拉数据接口

master
zhangf@suq.cn 1 week ago
parent
commit
9cf4785d48
  1. 5
      app/controller/EnterprisePortraitCategoryController.php
  2. 4
      app/controller/KnowledgeLibraryController.php
  3. 5
      app/route/route.php
  4. 8
      app/service/EnterprisePortraitCategoryService.php
  5. 8
      app/service/KnowledgeLibraryService.php
  6. 2
      plugin/piadmin/app/base/BaseDao.php

5
app/controller/EnterprisePortraitCategoryController.php

@ -49,5 +49,8 @@ class EnterprisePortraitCategoryController
return success($service->deleteData($id));
}
public function pureIndex(EnterprisePortraitCategoryService $service)
{
return success($service->selectData());
}
}

4
app/controller/KnowledgeLibraryController.php

@ -33,4 +33,8 @@ class KnowledgeLibraryController
return success($service->deleteData($id));
}
public function pureIndex(KnowledgeLibraryService $service)
{
return success($service->selectData());
}
}

5
app/route/route.php

@ -1,5 +1,6 @@
<?php
use app\controller\AiCommandController;
use app\controller\DistillationQuestionsController;
use app\controller\EnterprisePortraitCategoryController;
use app\controller\EnterprisePortraitLibraryController;
@ -48,6 +49,8 @@ Route::group('/service/v1', function () {
Route::get('/index', [KnowledgeLibraryController::class, 'index'])->setParams(['perm' => ['knowledgeIndex']]);
//删除
Route::post('/delete', [KnowledgeLibraryController::class, 'delete'])->setParams(['perm' => ['knowledgeDelete']]);
//下拉数据
Route::get('/pure/index', [KnowledgeLibraryController::class, 'pureIndex'])->setParams(['perm' => 'knowledgePureIndex']);
});
//企业画像图库
@ -64,6 +67,8 @@ Route::group('/service/v1', function () {
Route::get('/read', [EnterprisePortraitCategoryController::class, 'read'])->setParams(['perm' => ['enterpriseCategoryRead']]);
//删除
Route::post('/delete', [EnterprisePortraitCategoryController::class, 'delete'])->setParams(['perm' => ['enterpriseCategoryDelete']]);
//下拉数据
Route::get('/pure/index', [EnterprisePortraitCategoryController::class, 'pureIndex'])->setParams(['perm' => 'enterpriseCategoryPureIndex']);
});
//新增

8
app/service/EnterprisePortraitCategoryService.php

@ -117,4 +117,12 @@ class EnterprisePortraitCategoryService extends BaseService
return ['id' => $id];
}
public function selectData()
{
$query = [
'delete_time' => 0
];
$list = $this->dao->getList($query);
return $list;
}
}

8
app/service/KnowledgeLibraryService.php

@ -78,4 +78,12 @@ class KnowledgeLibraryService extends BaseService
return ['id' => $id];
}
public function selectData()
{
$query = [
'delete_time' => 0
];
$list = $this->dao->getList($query);
return $list;
}
}

2
plugin/piadmin/app/base/BaseDao.php

@ -693,7 +693,7 @@ abstract class BaseDao
public function getList($where, $field='*', $page=0, $limit=0, $order='id desc',$with=[],$withCOunt=[]): array
{
$query = $this->search($where)->with($with)->withCount($withCOunt)->field($field)->order($order);
$query = $this->search($where)->field($field)->with($with)->withCount($withCOunt)->order($order);
if($page !== 0 && $limit !== 0){
$query = $query->page($page,$limit);
}

Loading…
Cancel
Save