point

package
v0.0.0-...-902682f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePointRepo

func CreatePointRepo(conn *gorm.DB) point.Repository

func ToListDomain

func ToListDomain(data []Point) (result []point.Domain)

Types

type Point

type Point struct {
	Id        int `gorm:"primaryKey"`
	UserId    int `gorm:"unique"`
	Point     float64
	CreatedAt time.Time
	UpdatedAt time.Time
}

func FromDomain

func FromDomain(domain point.Domain) Point

func (*Point) ToDomain

func (po *Point) ToDomain() point.Domain

type PointRepo

type PointRepo struct {
	DB *gorm.DB
}

func (*PointRepo) Create

func (rep *PointRepo) Create(ctx context.Context, pointC *point.Domain) (point.Domain, error)

func (*PointRepo) Delete

func (rep *PointRepo) Delete(ctx context.Context, id int) error

func (*PointRepo) GetAll

func (rep *PointRepo) GetAll(ctx context.Context) ([]point.Domain, error)

func (*PointRepo) GetByUserId

func (rep *PointRepo) GetByUserId(ctx context.Context, id int) (point.Domain, error)

func (*PointRepo) Update

func (rep *PointRepo) Update(ctx context.Context, pointU point.Domain) (point.Domain, error)

Jump to

Keyboard shortcuts

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