app

package
v1.7.4-temp Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCourseService

func NewCourseService(
	userCli user.User,

	projectRepo spacerepo.Project,

	courseRepo repository.Course,
	playerRepo repository.Player,
	workRepo repository.Work,
	recordRepo repository.Record,
	producer message.MessageProducer,
	userRepo userrepo.User,
) *courseService

Types

type AsgDTO

type AsgDTO struct {
	AsgId      string `json:"asg_id"`
	CourseName string `json:"course_name"`
	Deadline   string `json:"deadline"`
	AsgName    string `json:"asg_name"`
	Desc       string `json:"desc"`
}

type AsgGetCmd

type AsgGetCmd struct {
	User  types.Account
	Cid   string
	AsgId string
}

type AsgListCmd

type AsgListCmd struct {
	User   types.Account
	Cid    string
	Status domain.WorkStatus
}

Assignment

type AsgWorkDTO

type AsgWorkDTO struct {
	Id       string  `json:"id"`
	Deadline string  `json:"deadline"`
	Name     string  `json:"name"`
	Desc     string  `json:"desc"`
	Score    float32 `json:"score"`
	Status   string  `json:"status"`
}

type CertInfoDTO

type CertInfoDTO struct {
	Owner  string `json:"owner"`
	Name   string `json:"name"`
	Cert   string `json:"cert"`
	IsPass bool   `json:"is_pass"`
}

type CourseAddRelatedProjectCmd added in v1.3.1

type CourseAddRelatedProjectCmd struct {
	Cid     string
	User    types.Account
	Project types.ResourceSummary
}

type CourseDTO

type CourseDTO struct {
	CourseSummaryDTO

	IsApply bool `json:"is_apply"`

	Teacher  string       `json:"teacher"`
	Doc      string       `json:"doc"`
	Forum    string       `json:"forum"`
	Sections []SectionDTO `json:"sections"`
}

type CourseGetCmd

type CourseGetCmd struct {
	User types.Account
	Cid  string
}

type CourseListCmd

type CourseListCmd struct {
	Status domain.CourseStatus
	Type   domain.CourseType
	User   types.Account
}

course

type CourseService

type CourseService interface {
	// player
	Apply(*PlayerApplyCmd) (code string, err error)

	// course
	List(*CourseListCmd) ([]CourseSummaryDTO, error)
	Get(*CourseGetCmd) (CourseDTO, error)
	AddRelatedProject(*CourseAddRelatedProjectCmd) (string, error)
	ListAssignments(*AsgListCmd) ([]AsgWorkDTO, error)
	GetSubmissions(*GetSubmissionCmd) (RelateProjectDTO, error)
	GetCertification(*CourseGetCmd) (CertInfoDTO, error)
	GetAssignment(*AsgGetCmd) (AsgDTO, error)
	AddPlayRecord(*RecordAddCmd) (string, error)
}

type CourseSummaryDTO

type CourseSummaryDTO struct {
	PlayerCount int    `json:"count"`
	Id          string `json:"id"`
	Name        string `json:"name"`
	Hours       int    `json:"hours"`
	Host        string `json:"host"`
	Desc        string `json:"desc"`
	Status      string `json:"status"`
	Poster      string `json:"poster"`
	Duration    string `json:"duration"`
	Type        string `json:"type"`
}

type GetSubmissionCmd

type GetSubmissionCmd struct {
	User   types.Account
	Cid    string
	Status domain.WorkStatus
}

type LessonDTO

type LessonDTO struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Desc  string `json:"desc"`
	Video string `json:"video"`

	Points []PointDTO `json:"points"`
}

Lesson

type PlayerApplyCmd

type PlayerApplyCmd domain.Player

player

func (*PlayerApplyCmd) Validate

func (cmd *PlayerApplyCmd) Validate() error

type PointDTO

type PointDTO struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Video string `json:"video"`
}

Point

type ProjectSummuryDTO

type ProjectSummuryDTO struct {
	Owner         string `json:"owner"`
	Name          string `json:"name"`
	CoverId       string `json:"cover_id"`
	CreatedAt     string `json:"create_at"`
	LikeCount     int    `json:"like_count"`
	ForkCount     int    `json:"fork_count"`
	DownloadCount int    `json:"download_count"`
}

type RecordAddCmd

type RecordAddCmd domain.Record

func (*RecordAddCmd) Validate

func (cmd *RecordAddCmd) Validate() error

type RelateProjectDTO

type RelateProjectDTO struct {
	RelatedProject []ProjectSummuryDTO `json:"related_project"`
}

type SectionDTO

type SectionDTO struct {
	Id   string `json:"id"`
	Name string `json:"name"`

	Lessons []LessonDTO `json:"lessons"`
}

Section

Jump to

Keyboard shortcuts

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