DeleteGraphTemplate 删除模板
(ctx context.Context, eid, templateID int64)
| 174 | |
| 175 | // DeleteGraphTemplate 删除模板 |
| 176 | func DeleteGraphTemplate(ctx context.Context, eid, templateID int64) error { |
| 177 | err := model.DeleteGraphTemplate(eid, templateID) |
| 178 | if err != nil { |
| 179 | if err.Error() == "template not found" { |
| 180 | return ErrTemplateNotFound |
| 181 | } |
| 182 | logger.SysError(fmt.Sprintf("Failed to delete graph template: %v", err)) |
| 183 | return err |
| 184 | } |
| 185 | |
| 186 | logger.Info(ctx, fmt.Sprintf("Graph template deleted successfully, template_id: %d", templateID)) |
| 187 | return nil |
| 188 | } |
| 189 | |
| 190 | // generateEntityPreview 生成实体预览文本 |
| 191 | // 格式: "组织、部门、角色等4个" |