repository

package
v0.0.0-...-d83f0ff Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common interface {
	//project
	GetProject(id int) (*model.Project, error)
	CreateProject(project *model.Project) error
	DeleteProject(id int) error

	//tasks
	GetTasksByID(projectID int) ([]model.Task, error)
	CreateTask(task *model.Task) error
	GetTasksByProject(projectID int) ([]model.Task, error)
}

type ProjectRepository

type ProjectRepository struct {
	DB *gorm.DB
}

func NewProjectRepository

func NewProjectRepository(db *gorm.DB) *ProjectRepository

func (*ProjectRepository) CreateProject

func (r *ProjectRepository) CreateProject(project *model.Project) error

func (*ProjectRepository) DeleteProject

func (r *ProjectRepository) DeleteProject(id uint) error

func (*ProjectRepository) GetProject

func (r *ProjectRepository) GetProject(id uint) (*model.Project, error)

type TaskRepository

type TaskRepository struct {
	DB *gorm.DB
}

func NewTaskRepository

func NewTaskRepository(db *gorm.DB) *TaskRepository

func (*TaskRepository) CreateTask

func (tr *TaskRepository) CreateTask(task *model.Task) error

func (*TaskRepository) GetTasksByID

func (tr *TaskRepository) GetTasksByID(id uint) (model.Task, error)

func (*TaskRepository) GetTasksByProject

func (tr *TaskRepository) GetTasksByProject(projectID uint) ([]model.Task, error)

Jump to

Keyboard shortcuts

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