logologo
Bắt đầu
Hướng dẫn
Phát triển
Plugin
API
English
简体中文
日本語
한국어
Deutsch
Français
Español
Português
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
Bắt đầu
Hướng dẫn
Phát triển
Plugin
API
logologo
Tổng quan API

@nocobase/auth

AuthManager
Auth
BaseAuth

@nocobase/cache

CacheManager
Cache

@nocobase/cli

Giao diện dòng lệnh NocoBase
Biến Môi Trường Toàn Cầu

@nocobase/client

Ứng dụng
Plugin

@nocobase/database

bộ sưu tập
Trường

interfaces

BaseInterface
Các Toán Tử Lọc

RelationRepository

BelongsToManyRepository
belongs-to-repository
HasManyRepository
HasOneRepository
Repository

shared

create-options
destroy-options
find-one
Bắt đầu với Bộ sưu tập
transaction
update-options

@nocobase/data-source-manager

DataSourceManager
DataSource (trừu tượng)
ICollectionManager
ICollection
IField
IModel
IRepository

@nocobase/flow-engine

Trình quản lý nguồn dữ liệu
Ngữ cảnh luồng
FlowEngine
FlowModel
Tài nguyên luồng

@nocobase/logger

Logger

@nocobase/server

AppCommand
Ứng dụng
AuditManager
Ngữ cảnh
Di chuyển
Plugin

@nocobase/sdk

Auth
Storage
Previous PageTrường
Next PageCác Toán Tử Lọc
TIP

Tài liệu này được dịch bởi AI. Đối với bất kỳ thông tin không chính xác nào, vui lòng tham khảo phiên bản tiếng Anh

#BaseInterface

#Tổng quan

BaseInterface là lớp cơ sở cho tất cả các loại Interface. Người dùng có thể kế thừa lớp này để triển khai logic Interface tùy chỉnh của riêng mình.

class CustomInterface extends BaseInterface {
  async toValue(value: string, ctx?: any): Promise<any> {
    // Logic toValue tùy chỉnh
  }

  toString(value: any, ctx?: any) {
    // Logic toString tùy chỉnh
  }
}
// Đăng ký Interface
db.interfaceManager.registerInterfaceType('customInterface', CustomInterface)

#API

#toValue(value: string, ctx?: any): Promise

Chuyển đổi một chuỗi bên ngoài thành giá trị thực tế của interface. Giá trị này có thể được truyền trực tiếp cho Repository để thực hiện các thao tác ghi.

#toString(value: any, ctx?: any)

Chuyển đổi giá trị thực tế của interface thành kiểu chuỗi (string). Kiểu chuỗi này có thể được sử dụng cho mục đích xuất dữ liệu hoặc hiển thị.