Files
fdesk/app/common/utils/scaffold/templates/ServiceStub.stub
T

31 lines
592 B
Plaintext
Raw Normal View History

2025-07-21 16:43:43 +08:00
<?php
2025-07-21 19:11:29 +08:00
namespace app\{{serviceModule}}\service;
2025-07-21 16:43:43 +08:00
2025-07-21 19:11:29 +08:00
use app\{{validateModule}}\validate\{{validateName}}Validate;
2025-07-21 16:43:43 +08:00
use app\common\traits\crud\CrudServiceTrait;
2025-07-21 19:11:29 +08:00
use app\{{modelModule}}\model\{{modelName}};
2025-07-21 16:43:43 +08:00
2025-07-21 19:11:29 +08:00
class {{serviceName}}Service
2025-07-21 16:43:43 +08:00
{
use CrudServiceTrait;
/**
* 指定当前要操作的模型
*/
2025-07-21 19:11:29 +08:00
protected string $modelClass = {{modelName}}::class;
2025-07-21 16:43:43 +08:00
/**
* 验证器
*/
2025-07-21 19:11:29 +08:00
protected $validator = {{validateName}}Validate::class;
2025-07-21 16:43:43 +08:00
/**
* 获取验证器
*/
public function getValidator()
{
return new $this->validator;
}
}