OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
25
app/Domain/Connector/Models/Entity.php
Normal file
25
app/Domain/Connector/Models/Entity.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Connector\Models;
|
||||
|
||||
class Entity
|
||||
{
|
||||
public int $id;
|
||||
|
||||
public string $name;
|
||||
|
||||
public string $authData;
|
||||
|
||||
public string $notes;
|
||||
|
||||
// Leantime domain object
|
||||
public mixed $leantimeEntity;
|
||||
|
||||
// Array of field objects
|
||||
public array $fieldMappings = [];
|
||||
|
||||
// External domain object
|
||||
public mixed $providerEntity;
|
||||
|
||||
public function __construct() {}
|
||||
}
|
||||
18
app/Domain/Connector/Models/Field.php
Normal file
18
app/Domain/Connector/Models/Field.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Connector\Models;
|
||||
|
||||
class Field
|
||||
{
|
||||
public int $id;
|
||||
|
||||
public int $entityConnectionId;
|
||||
|
||||
public string $leantimeFields;
|
||||
|
||||
public string $providerEntity;
|
||||
|
||||
public string $typeConnector;
|
||||
|
||||
public function __construct() {}
|
||||
}
|
||||
20
app/Domain/Connector/Models/FieldTypes.php
Normal file
20
app/Domain/Connector/Models/FieldTypes.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Connector\Models;
|
||||
|
||||
final class FieldTypes
|
||||
{
|
||||
public static string $int = 'int';
|
||||
|
||||
public static string $shortString = 'varchar(255)';
|
||||
|
||||
public static string $array = 'array';
|
||||
|
||||
public static string $text = 'text';
|
||||
|
||||
public static string $email = 'email';
|
||||
|
||||
public static string $dateTime = 'dateTime';
|
||||
|
||||
public function __construct() {}
|
||||
}
|
||||
46
app/Domain/Connector/Models/Integration.php
Normal file
46
app/Domain/Connector/Models/Integration.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Connector\Models;
|
||||
|
||||
use Leantime\Core\Db\DbColumn;
|
||||
|
||||
class Integration
|
||||
{
|
||||
#[DbColumn('id')]
|
||||
public int $id;
|
||||
|
||||
#[DbColumn('providerId')]
|
||||
public ?string $providerId;
|
||||
|
||||
#[DbColumn('method')]
|
||||
public ?string $method;
|
||||
|
||||
#[DbColumn('entity')]
|
||||
public ?string $entity;
|
||||
|
||||
#[DbColumn('fields')]
|
||||
public ?string $fields;
|
||||
|
||||
#[DbColumn('schedule')]
|
||||
public ?string $schedule;
|
||||
|
||||
#[DbColumn('notes')]
|
||||
public ?string $notes;
|
||||
|
||||
#[DbColumn('auth')]
|
||||
public ?string $auth;
|
||||
|
||||
#[DbColumn('meta')]
|
||||
public ?string $meta;
|
||||
|
||||
#[DbColumn('createdOn')]
|
||||
public ?string $createdOn;
|
||||
|
||||
#[DbColumn('createdBy')]
|
||||
public ?string $createdBy;
|
||||
|
||||
#[DbColumn('lastSync')]
|
||||
public ?string $lastSync;
|
||||
|
||||
public function __construct() {}
|
||||
}
|
||||
74
app/Domain/Connector/Models/Provider.php
Normal file
74
app/Domain/Connector/Models/Provider.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Connector\Models;
|
||||
|
||||
class Provider
|
||||
{
|
||||
// Unique identifier of provider
|
||||
public $id;
|
||||
|
||||
// Friendly name
|
||||
public string $name;
|
||||
|
||||
public string $description;
|
||||
|
||||
// Image to show in UI
|
||||
public string $image;
|
||||
|
||||
// Entities available to sync/import as part of this provider
|
||||
// This should be a list of strings with the exact entity name as they appear in the provider api
|
||||
// project, issue, epic, ticket or similar
|
||||
public array $availableEntities = [];
|
||||
|
||||
public array $availableMethods = []; // import and/or sync
|
||||
|
||||
/**
|
||||
* Define the steps for provider integration. Some steps may not be needed for some providers
|
||||
* (for example CSV does not need a sync)
|
||||
* Only used for status indicator. Controller does not check this.
|
||||
*
|
||||
* @var array|string[]
|
||||
*/
|
||||
public array $steps = [
|
||||
'connect',
|
||||
'entity',
|
||||
'fields',
|
||||
'sync',
|
||||
'parse',
|
||||
'import',
|
||||
];
|
||||
|
||||
public array $stepDetails = [
|
||||
'connect' => [
|
||||
'title' => 'Connect',
|
||||
'position' => 1,
|
||||
],
|
||||
'entity' => [
|
||||
'title' => 'Entity Mapping',
|
||||
'position' => 2,
|
||||
],
|
||||
'fields' => [
|
||||
'title' => 'Field Matching',
|
||||
'position' => 3,
|
||||
],
|
||||
'sync' => [
|
||||
'title' => 'Synchonize',
|
||||
'position' => 4,
|
||||
],
|
||||
'parse' => [
|
||||
'title' => 'Validate',
|
||||
'position' => 5,
|
||||
],
|
||||
'import' => [
|
||||
'title' => 'Import',
|
||||
'position' => 6,
|
||||
],
|
||||
];
|
||||
|
||||
public array $button = [
|
||||
'url' => '',
|
||||
'text' => '',
|
||||
];
|
||||
|
||||
public function __construct() {}
|
||||
}
|
||||
Reference in New Issue
Block a user