models

package
v0.0.0-...-47a55c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectionData

type DetectionData struct {
	SessionId string
	Query     string
	Names     []string
}

DetectionData запрос пользователя с uuid для идентификации на пользовательской стороне

type DetectionQueryCreate

type DetectionQueryCreate struct {
	SessionId    int64
	Content      string          // запрос пользователя
	Label        string          // тип операции обработки мл модели
	Status       DetectionStatus // статус обработки мл модели
	DetectedKeys map[string]any  // ключи, которые выдает модель
}

DetectionQueryCreate минимальный набор данных для сохранения запроса

type DetectionQueryDao

type DetectionQueryDao struct {
	Id            int64           `db:"id"`
	SessionId     int64           `db:"session_id"`
	Content       string          `db:"content"`
	DetectedLabel string          `db:"label"`
	DetectedKeys  map[string]any  `db:"detected_keys"`
	Status        DetectionStatus `db:"status"`
	CreatedAt     time.Time       `db:"created_at"`
}

DetectionQueryDao запрос пользователя с результатом мл модели

type DetectionResult

type DetectionResult struct {
	SessionUUID string
	QueryId     int64
	Content     map[string]any
	Status      DetectionStatus
	Response    string
}

DetectionResult обработки пользовательского запроса к модели

type DetectionSessionDao

type DetectionSessionDao struct {
	Id        int64     `db:"id"`
	Uuid      uuid.UUID `db:"uuid"`
	UserId    int64     `db:"user_id"`
	CreatedAt time.Time `db:"created_at"`
}

DetectionSessionDao сессия обработки от начала запроса до конечного действия / сценария

type DetectionStatus

type DetectionStatus int

DetectionStatus состояние обработки запроса пользователя

const (
	// InternalErr ошибка в работе мл модели
	InternalErr DetectionStatus = iota
	// NotEnoughParams недостаточно параметров для выбранной операции
	NotEnoughParams
	// Success операция сгенерирована успешна
	Success
)

type InputField

type InputField struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	PlaceHolder string `json:"placeholder"`
	Label       string `json:"label"`
	InputMode   string `json:"inputmode"`
	SpellCheck  bool   `json:"spellcheck"`
}

InputField действие, которое можно совершить на странице

type InputFieldDao

type InputFieldDao struct {
	Id          int64  `db:"id"`
	Name        string `db:"name"`
	Type        string `db:"type"`
	PlaceHolder string `db:"placeholder"`
	Label       string `db:"label"`
	InputMode   string `db:"inputmode"`
	SpellCheck  bool   `db:"spellcheck"`
}

InputFieldDao представление действия в бд

type PageCreate

type PageCreate struct {
	Html string `json:"html"`
	Url  string `json:"url"`
}

PageCreate данные для обработки страницы

type PageDao

type PageDao struct {
	Id   int64  `db:"id"`
	Html string `db:"html"`
	Url  string `db:"url"`
}

func (*PageDao) Dto

func (pd *PageDao) Dto() PageDto

Dto преобразование UserDao -> UserDto

type PageDto

type PageDto struct {
	Id      int64        `json:"id"`
	Html    string       `json:"html"`
	Url     string       `json:"url"`
	Actions []InputField `json:"actions,omitempty"`
}

PageDto информация о страницы

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL