{
  "tplName": "Service",
  "tplCategory": "Service",
  "tpl": {
    "dir": "",
    "filename": "",
    "content": "<%\nvar entityName = toCamelCase(isBlank(prefix) ? table.name : subAfter(table.name, prefix));\nvar controllerClass = upperFirst(entityName) + \"Controller\";\nvar entityClass = upperFirst(entityName) + \"Entity\";\nvar entityInstance = entityName + \"Entity\";\nvar serviceClass = upperFirst(entityName) + \"Service\";\nvar serviceInstance = entityName + \"Service\";\nvar mapperClass = upperFirst(entityName) + \"Mapper\";\nvar baseUrl = entityName + \"Service\";\n%>\npackage ${basePackage}.service;\n\nimport lombok.extern.slf4j.Slf4j;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.stereotype.Service;\nimport com.baomidou.mybatisplus.extension.service.IService;\nimport com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport com.njzscloud.common.mp.support.PageParam;\nimport com.njzscloud.common.mp.support.PageResult;\nimport java.util.List;\nimport org.springframework.transaction.annotation.Transactional;\nimport ${basePackage}.entity.${entityClass};\nimport ${basePackage}.mapper.${mapperClass};\n\n/**\n * ${table.comment}\n */\n@Slf4j\n@Service\n@RequiredArgsConstructor\npublic class ${serviceClass} extends ServiceImpl<${mapperClass}, ${entityClass}> implements IService<${entityClass}> {\n\n    /**\n    * 新增\n    */\n    public void add(${entityClass} ${entityInstance}) {\n        this.save(${entityInstance});\n    }\n\n    /**\n    * 修改\n    */\n    public void modify(${entityClass} ${entityInstance}) {\n        this.updateById(${entityInstance});\n    }\n\n    /**\n    * 删除\n    */\n    @Transactional(rollbackFor = Exception.class)\n    public void del(List<Long> ids) {\n        this.removeBatchByIds(ids);\n    }\n\n    /**\n    * 详情\n    */\n    public ${entityClass} detail(Long id) {\n        return this.getById(id);\n    }\n\n    /**\n    * 分页查询\n    */\n    public PageResult<${entityClass}> paging(PageParam pageParam, ${entityClass} ${entityInstance}) {\n        return PageResult.of(this.page(pageParam.toPage(), Wrappers.<${entityClass}>query(${entityInstance})));\n    }\n}\n"
  },
  "modelData": {}
}
