service

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRoadmapNotFound = repository.ErrRoadmapNotFound

Functions

This section is empty.

Types

type AdminService

type AdminService interface {
	Detail(ctx context.Context, id int64) (domain.Roadmap, error)
	Save(ctx context.Context, r domain.Roadmap) (int64, error)
	List(ctx context.Context, offset int, limit int) ([]domain.Roadmap, error)
	AddEdge(ctx context.Context, rid int64, edge domain.Edge) error
	DeleteEdge(ctx context.Context, id int64) error
}

func NewAdminService

func NewAdminService(repo repository.AdminRepository) AdminService

type BizService

type BizService interface {
	// GetBizs bizs 和 ids 的长度必须一样
	// 返回值是 biz-id-Biz 的结构
	GetBizs(ctx context.Context, bizs []string, ids []int64) (map[string]map[int64]domain.Biz, error)
}

BizService 作为一个聚合服务,下沉到这里以减轻 web 的逻辑负担

func NewConcurrentBizService

func NewConcurrentBizService(queSvc baguwen.Service, queSetSvc baguwen.QuestionSetService) BizService

type ConcurrentBizService

type ConcurrentBizService struct {
	// contains filtered or unexported fields
}

ConcurrentBizService 强调并发

func (*ConcurrentBizService) GetBizs

func (svc *ConcurrentBizService) GetBizs(ctx context.Context, bizs []string, ids []int64) (map[string]map[int64]domain.Biz, error)

func (*ConcurrentBizService) GetBizsByIds

func (svc *ConcurrentBizService) GetBizsByIds(ctx context.Context, biz string, ids []int64) (map[int64]domain.Biz, error)

GetBizsByIds 将来可能需要暴露出去,暂时保留定义为公共接口

type Service

type Service interface {
	Detail(ctx context.Context, biz string, bizId int64) (domain.Roadmap, error)
}

func NewService

func NewService(repo repository.Repository) Service

Jump to

Keyboard shortcuts

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