OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
48
app/Core/Support/EntityFormatterInterface.php
Normal file
48
app/Core/Support/EntityFormatterInterface.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Core\Support;
|
||||
|
||||
/**
|
||||
* Interface for entity formatters that convert domain models into markdown for AI consumption.
|
||||
*
|
||||
* This interface defines the contract for formatting domain entities (tickets, projects, users, etc.)
|
||||
* into structured markdown documents suitable for AI prompts and embeddings.
|
||||
*/
|
||||
interface EntityFormatterInterface
|
||||
{
|
||||
/**
|
||||
* Format the entity into a standard markdown representation.
|
||||
*
|
||||
* @return string Markdown formatted string representing the entity
|
||||
*/
|
||||
public function format(): string;
|
||||
|
||||
/**
|
||||
* Format the entity with additional context-aware information.
|
||||
*
|
||||
* @param array $context Additional context that might affect formatting (e.g., user preferences, specific fields to include/exclude)
|
||||
* @return string Context-aware markdown formatted string
|
||||
*/
|
||||
public function formatForContext(array $context = []): string;
|
||||
|
||||
/**
|
||||
* Get the type of entity this formatter handles.
|
||||
*
|
||||
* @return string Entity type (e.g., 'ticket', 'project', 'user')
|
||||
*/
|
||||
public function getEntityType(): string;
|
||||
|
||||
/**
|
||||
* Get the unique identifier of the entity being formatted.
|
||||
*
|
||||
* @return mixed Entity ID (could be int, string, or other identifier type)
|
||||
*/
|
||||
public function getEntityId(): mixed;
|
||||
|
||||
/**
|
||||
* Get a compact, one-line summary of the entity.
|
||||
*
|
||||
* @return string Brief summary suitable for lists or references
|
||||
*/
|
||||
public function getSummary(): string;
|
||||
}
|
||||
Reference in New Issue
Block a user