31 lines
592 B
Plaintext
31 lines
592 B
Plaintext
<?php
|
|
|
|
namespace app\{{serviceModule}}\service;
|
|
|
|
use app\{{validateModule}}\validate\{{validateName}}Validate;
|
|
use app\common\traits\crud\CrudServiceTrait;
|
|
use app\{{modelModule}}\model\{{modelName}};
|
|
|
|
class {{serviceName}}Service
|
|
{
|
|
|
|
use CrudServiceTrait;
|
|
|
|
/**
|
|
* 指定当前要操作的模型
|
|
*/
|
|
protected string $modelClass = {{modelName}}::class;
|
|
|
|
/**
|
|
* 验证器
|
|
*/
|
|
protected $validator = {{validateName}}Validate::class;
|
|
|
|
/**
|
|
* 获取验证器
|
|
*/
|
|
public function getValidator()
|
|
{
|
|
return new $this->validator;
|
|
}
|
|
} |