Browse Source
feat(distillation): 新增蒸馏词管理功能
feat(distillation): 新增蒸馏词管理功能
- 新增蒸馏词、目标转化词、扩展词、关联问题的数据模型与DAO类 - 在 DistillationWord 模型中增加关联关系方法 (trans, expand, questions) - 控制器 DistillationWordController 实现增删改查及下拉数据接口 - 服务层 DistillationWordService 完成业务逻辑处理,包括事务操作 - 验证器 DistillationWordValidate 更新字段校验规则 - 路由配置新增蒸馏词相关API路径及权限控制 - 支持主关键词、目标转化词、扩展词的保存与更新逻辑 - 列表查询支持模糊搜索和统计关联问题数量 - 提供纯数据列表接口用于前端下拉选项 - 增加软删除机制,确保数据一致性回滚处理master
10 changed files with 314 additions and 60 deletions
-
39app/controller/DistillationWordController.php
-
17app/dao/DistillationExpandWordDao.php
-
17app/dao/DistillationQuestionsDao.php
-
17app/dao/DistillationTransWordDao.php
-
33app/model/DistillationQuestions.php
-
15app/model/DistillationWord.php
-
37app/route/route.php
-
138app/service/DistillationWordService.php
-
15app/validate/DistillationWordValidate.php
@ -0,0 +1,17 @@ |
|||
<?php |
|||
|
|||
namespace app\dao; |
|||
|
|||
use app\model\DistillationExpandWord; |
|||
use plugin\piadmin\app\base\BaseDao; |
|||
|
|||
class DistillationExpandWordDao extends BaseDao |
|||
{ |
|||
|
|||
protected function setModel(): string |
|||
{ |
|||
return DistillationExpandWord::class; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
<?php |
|||
|
|||
namespace app\dao; |
|||
|
|||
use app\model\DistillationQuestions; |
|||
use plugin\piadmin\app\base\BaseDao; |
|||
|
|||
class DistillationQuestionsDao extends BaseDao |
|||
{ |
|||
|
|||
protected function setModel(): string |
|||
{ |
|||
return DistillationQuestions::class; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
<?php |
|||
|
|||
namespace app\dao; |
|||
|
|||
use app\model\DistillationTransWord; |
|||
use plugin\piadmin\app\base\BaseDao; |
|||
|
|||
class DistillationTransWordDao extends BaseDao |
|||
{ |
|||
|
|||
protected function setModel(): string |
|||
{ |
|||
return DistillationTransWord::class; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
<?php |
|||
|
|||
namespace app\model; |
|||
|
|||
use plugin\piadmin\app\base\BaseModel; |
|||
|
|||
/** |
|||
* 蒸馏词关联目标转化词模型 |
|||
*/ |
|||
class DistillationQuestions extends BaseModel |
|||
{ |
|||
/** |
|||
* The table associated with the model. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $table = 'geo_distillation_questions'; |
|||
|
|||
/** |
|||
* The primary key associated with the table. |
|||
* |
|||
* @var string |
|||
*/ |
|||
protected $primaryKey = 'id'; |
|||
|
|||
/** |
|||
* Indicates if the model should be timestamped. |
|||
* |
|||
* @var bool |
|||
*/ |
|||
public $timestamps = true; |
|||
|
|||
} |
|||
@ -1,31 +1,26 @@ |
|||
<?php |
|||
|
|||
use app\controller\ActionArticleController; |
|||
use app\controller\ActionOptimizeController; |
|||
use app\controller\BrandLibraryController; |
|||
use app\controller\OrderController; |
|||
use app\controller\PlatformController; |
|||
use app\controller\ProjectBrandController; |
|||
use app\controller\ProjectController; |
|||
use app\controller\ProjectKeywordController; |
|||
use app\controller\ProjectResultBrandController; |
|||
use app\controller\ProjectResultContentController; |
|||
use app\controller\ProjectResultController; |
|||
use app\controller\ProjectResultReferenceSiteController; |
|||
use app\controller\ProjectTaskController; |
|||
use app\controller\ProjectWordCloudController; |
|||
use app\controller\SiteController; |
|||
use app\controller\ProjectTopicController; |
|||
use app\controller\ProjectUserController; |
|||
use app\controller\UserController; |
|||
use app\controller\UserGroupController; |
|||
use app\controller\VipController; |
|||
use app\controller\DistillationWordController; |
|||
use plugin\piadmin\app\middleware\AdminAuthorizationMiddleware; |
|||
use plugin\piadmin\app\middleware\PermissionsMiddleware; |
|||
use Webman\Route; |
|||
|
|||
Route::group('/service/v1', function () { |
|||
|
|||
//蒸馏词
|
|||
Route::group('/distillation', function () { |
|||
//新增
|
|||
Route::post('/save', [DistillationWordController::class, 'save'])->setParams(['perm' => ['distillationSave']]); |
|||
//修改
|
|||
Route::post('/update', [DistillationWordController::class, 'update'])->setParams(['perm' => ['distillationUpdate']]); |
|||
//列表
|
|||
Route::get('/index', [DistillationWordController::class, 'index'])->setParams(['perm' => ['distillationIndex']]); |
|||
//详情
|
|||
Route::get('/read', [DistillationWordController::class, 'read'])->setParams(['perm' => ['distillationRead']]); |
|||
//删除
|
|||
Route::post('/delete', [DistillationWordController::class, 'delete'])->setParams(['perm' => ['distillationDelete']]); |
|||
//下拉数据
|
|||
Route::get('/pure/index', [DistillationWordController::class, 'pureIndex'])->setParams(['perm' => 'distillationPureIndex']); |
|||
}); |
|||
})->middleware([ |
|||
AdminAuthorizationMiddleware::class, |
|||
PermissionsMiddleware::class |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue