converter

package
v0.0.0-...-b4acfce Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	CourseConverter       *CourseConverter
	CourseResultConverter *CourseResultConverter
}

func NewConverter

func NewConverter() *Converter

func (*Converter) FetchIDs

func (c *Converter) FetchIDs(m []gorm.Model) []uint

func (*Converter) ManyToUserStat

func (c *Converter) ManyToUserStat(dtos []internal.User) []*internal.UserStatDTO

func (*Converter) ToDTO

func (u *Converter) ToDTO(dto internal.User) (*internal.UserDTO, error)

func (*Converter) ToModel

func (c *Converter) ToModel(dto *internal.UserDTO) *internal.User

func (*Converter) ToUserStat

func (c *Converter) ToUserStat(dto internal.User) *internal.UserStatDTO

type CourseConverter

type CourseConverter struct {
	TaskConverter *TaskConverter
}

func NewCourseConverter

func NewCourseConverter(taskConverter *TaskConverter) *CourseConverter

func (*CourseConverter) ManyToDTO

func (c *CourseConverter) ManyToDTO(courses []*internal.Course) ([]internal.CourseDTO, error)

func (*CourseConverter) ManyToModel

func (c *CourseConverter) ManyToModel(dtos []internal.CourseDTO) []internal.Course

func (*CourseConverter) ToDTO

func (*CourseConverter) ToModel

func (c *CourseConverter) ToModel(dto *internal.CourseDTO) *internal.Course

type CourseResultConverter

type CourseResultConverter struct{}

func NewCourseResultConverter

func NewCourseResultConverter() *CourseResultConverter

func (*CourseResultConverter) FetchIDs

func (*CourseResultConverter) ManyToDTO

func (*CourseResultConverter) ManyToModel

func (*CourseResultConverter) ToDTO

func (*CourseResultConverter) ToModel

type TaskConverter

type TaskConverter struct{}

func (*TaskConverter) ConvertToDTO

func (*TaskConverter) ConvertToDTO(dto internal.Task) internal.TaskDTO

func (*TaskConverter) ConvertToModel

func (*TaskConverter) ConvertToModel(dto internal.TaskDTO) internal.Task

func (*TaskConverter) ManyToDTO

func (t *TaskConverter) ManyToDTO(dto []internal.Task) []internal.TaskDTO

func (*TaskConverter) ManyToModel

func (t *TaskConverter) ManyToModel(dto []internal.TaskDTO) []internal.Task

Jump to

Keyboard shortcuts

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