service

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEntity

func GetEntity(entity string, id interface{}) interface{}

func GetEntityAs

func GetEntityAs[T any](entity string, id interface{}) *T

func RegisterEntity

func RegisterEntity(entity string, getter EntityGetter)

Types

type ContentTemplateService

type ContentTemplateService struct {
	service.BaseService
	ContentTemplateRepository *repository.ContentTemplateRepository `inject:"contentTemplateRepository"`
}

func (*ContentTemplateService) CreateContentTemplate

func (s *ContentTemplateService) CreateContentTemplate(template *domain.ContentTemplate) (*domain.ContentTemplate, error)

func (*ContentTemplateService) DeleteContentTemplate

func (s *ContentTemplateService) DeleteContentTemplate(id string) error

func (*ContentTemplateService) FindAll

func (s *ContentTemplateService) FindAll(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.ContentTemplate, error)

func (*ContentTemplateService) GetById

func (*ContentTemplateService) GetByTypeAndSceneAndTenantId

func (s *ContentTemplateService) GetByTypeAndSceneAndTenantId(typeName, scene, tenantId string) (*domain.ContentTemplate, error)

func (*ContentTemplateService) GetContentTemplate

func (s *ContentTemplateService) GetContentTemplate(typeName, scene string) (title, content string)

func (*ContentTemplateService) PatchContentTemplate

func (s *ContentTemplateService) PatchContentTemplate(id string, data map[string]interface{}) (result *domain.ContentTemplate, err error)

func (*ContentTemplateService) UpdateContentTemplate

func (s *ContentTemplateService) UpdateContentTemplate(template *domain.ContentTemplate) (*domain.ContentTemplate, error)

type EntityGetter

type EntityGetter func(id interface{}) interface{}

type EntityHelper

type EntityHelper struct {
	Getters map[string]EntityGetter
	// contains filtered or unexported fields
}

func (*EntityHelper) GetEntity

func (h *EntityHelper) GetEntity(entity string, id interface{}) interface{}

func (*EntityHelper) RegisterEntity

func (h *EntityHelper) RegisterEntity(entity string, getter EntityGetter)

type EventService

type EventService struct {
	service.BaseService
	EventRepository        *repository.EventRepository `inject:"eventRepository"`
	ContentTemplateService *ContentTemplateService     `inject:"contentTemplateService"`
}

func (*EventService) AccessEventCenter

func (s *EventService) AccessEventCenter(userId string)

func (*EventService) Check

func (s *EventService) Check(conds map[string]interface{}) (*domain.Event, error)

func (*EventService) CreateEvent

func (s *EventService) CreateEvent(event *domain.Event) (*domain.Event, error)

func (*EventService) DeleteEvent

func (s *EventService) DeleteEvent(event *domain.Event) error

func (*EventService) Find

func (s *EventService) Find(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.Event, error)

func (*EventService) FormatEvent

func (s *EventService) FormatEvent(event *domain.Event) *domain.Event

func (*EventService) GetById

func (s *EventService) GetById(id int64) (*domain.Event, error)

func (*EventService) HistoryEvents

func (s *EventService) HistoryEvents()

func (*EventService) OnAccessEventCenter

func (s *EventService) OnAccessEventCenter(event string, args ...interface{})

func (*EventService) PatchEvent

func (s *EventService) PatchEvent(id int64, data map[string]interface{}) (*domain.Event, error)

func (*EventService) TriggerEvent

func (s *EventService) TriggerEvent(event string, args ...interface{})

type LocaleFieldService

type LocaleFieldService struct {
	service.BaseService
	i18n.Translator

	LocaleFieldRepository *repository.LocaleFieldRepository `inject:"localeFieldRepository"`
	LocalCache            *cache.Cache
}

func (*LocaleFieldService) GetEntityAll

func (s *LocaleFieldService) GetEntityAll(entityName, entityId string) []*i18n.LocaleFieldValue

func (*LocaleFieldService) GetEntityFieldAll

func (s *LocaleFieldService) GetEntityFieldAll(entityName, entityId, field string) []*i18n.LocaleFieldValue

func (*LocaleFieldService) LoadTranslations

func (s *LocaleFieldService) LoadTranslations(locale, entityName string, entityIds ...string) map[string][]*i18n.LocaleFieldValue

func (*LocaleFieldService) SaveAll

func (s *LocaleFieldService) SaveAll(fields []*domain.LocaleField) []*domain.LocaleField

func (*LocaleFieldService) StoreTranslations

func (s *LocaleFieldService) StoreTranslations(translations []*i18n.LocaleFieldValue)

type MessageService

type MessageService struct {
	service.BaseService
	MessageRepository          *repository.MessageRepository          `inject:"messageRepository"`
	MessageAccessLogRepository *repository.MessageAccessLogRepository `inject:"messageAccessLogRepository"`
}

func (*MessageService) CreateMessage

func (s *MessageService) CreateMessage(message *domain.Message) (*domain.Message, error)

func (*MessageService) DeleteMessage

func (s *MessageService) DeleteMessage(message *domain.Message) error

func (*MessageService) Find

func (s *MessageService) Find(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.Message, error)

func (*MessageService) FindAvailable

func (s *MessageService) FindAvailable(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.Message, error)

func (*MessageService) FindSimples

func (s *MessageService) FindSimples(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.SimpleMessage, error)

func (*MessageService) FindSimplesAvailable

func (s *MessageService) FindSimplesAvailable(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.SimpleMessage, error)

func (*MessageService) GetById

func (s *MessageService) GetById(id int64) (*domain.Message, error)

func (*MessageService) HistoryMessages

func (s *MessageService) HistoryMessages()

func (*MessageService) OnMessageViewed added in v0.0.38

func (s *MessageService) OnMessageViewed(event string, argv ...interface{})

func (*MessageService) PatchMessage

func (s *MessageService) PatchMessage(id int64, data map[string]interface{}) (*domain.Message, error)

func (*MessageService) UpdateMessage added in v0.0.38

func (s *MessageService) UpdateMessage(message *domain.Message) (*domain.Message, error)

func (*MessageService) ValidateMessages

func (s *MessageService) ValidateMessages()

type OperationLogService

type OperationLogService struct {
	service.BaseService
	OperationLogRepository *repository.OperationLogRepository `inject:"operationLogRepository"`
	ContentTemplateService *ContentTemplateService            `inject:"contentTemplateService"`
}

func (*OperationLogService) Append

func (s *OperationLogService) Append(log *domain.OperationLog)

func (*OperationLogService) Find

func (s *OperationLogService) Find(conds map[string]interface{}, pageable query.Pageable) (int64, []*domain.OperationLog, error)

type SysOptionService

type SysOptionService struct {
	service.BaseService
	SysOptionRepository *repository.SysOptionRepository `inject:"sysOptionRepository"`
}

func (*SysOptionService) AddSysOption

func (s *SysOptionService) AddSysOption(option *domain.SysOption) (*domain.SysOption, error)

func (*SysOptionService) AddSysOptions

func (s *SysOptionService) AddSysOptions(options []domain.SysOption) (*[]domain.SysOption, error)

func (*SysOptionService) DeleteSysOption

func (s *SysOptionService) DeleteSysOption(option *domain.SysOption) (*domain.SysOption, error)

func (*SysOptionService) GetDefaultOptions

func (s *SysOptionService) GetDefaultOptions(tenantId string) (*domain.SysOptions, error)

func (*SysOptionService) GetSystemOptions

func (s *SysOptionService) GetSystemOptions() (*domain.SysOptions, error)

func (*SysOptionService) GetTenantOptions

func (s *SysOptionService) GetTenantOptions(tenantId string) (*domain.SysOptions, error)

func (*SysOptionService) RemoveAllTenantOptions

func (s *SysOptionService) RemoveAllTenantOptions(tenantId string) error

func (*SysOptionService) RemoveTenantOption

func (s *SysOptionService) RemoveTenantOption(tenantId string, key string) (*domain.SysOption, error)

func (*SysOptionService) SetTenantOption

func (s *SysOptionService) SetTenantOption(tenantId string, key string, value string) (*domain.SysOption, error)

func (*SysOptionService) SetTenantOptions

func (s *SysOptionService) SetTenantOptions(tenantOptions *domain.SysOptions) (*domain.SysOptions, error)

type UserOptionService

type UserOptionService struct {
	service.BaseService
	UserOptionRepository *repository.UserOptionRepository `inject:"userOptionRepository"`
}

func (*UserOptionService) AddUserOption

func (s *UserOptionService) AddUserOption(option *domain.UserOption) (*domain.UserOption, error)

func (*UserOptionService) AddUserOptions

func (s *UserOptionService) AddUserOptions(options []domain.UserOption) (*[]domain.UserOption, error)

func (*UserOptionService) GetDefaultUserOptions

func (s *UserOptionService) GetDefaultUserOptions() (*domain.UserOptions, error)

func (*UserOptionService) GetUserOptions

func (s *UserOptionService) GetUserOptions(userId string) (*domain.UserOptions, error)

func (*UserOptionService) RemoveAllUserOptions

func (s *UserOptionService) RemoveAllUserOptions(userId string) error

func (*UserOptionService) RemoveUserOption

func (s *UserOptionService) RemoveUserOption(userId string, key string) (*domain.UserOption, error)

func (*UserOptionService) SetUserOption

func (s *UserOptionService) SetUserOption(userId string, key string, value string) (*domain.UserOption, error)

func (*UserOptionService) SetUserOptions

func (s *UserOptionService) SetUserOptions(userOptions *domain.UserOptions) (*domain.UserOptions, error)

Jump to

Keyboard shortcuts

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