Documentation
¶
Index ¶
- type Service
- func (s Service) CloseTomatoByUserId(ctx context.Context, userId int) error
- func (s Service) CreateTomato(ctx context.Context, param TomatoCreate) (*ent.UserTomato, error)
- func (s Service) CreateUser(ctx context.Context, create UserCreate) (*ent.User, error)
- func (s Service) GetUserByUsername(ctx context.Context, username string) (*ent.User, error)
- func (s Service) GetWorkingTomatoByUserId(ctx context.Context, userId int) (*ent.UserTomato, error)
- func (s Service) GiveUpTomatoByUserId(ctx context.Context, userId int) error
- type TomatoCreate
- type UserCreate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (Service) CloseTomatoByUserId ¶
CloseTomatoByUserId close all tomato clock by user id.
func (Service) CreateTomato ¶
func (s Service) CreateTomato(ctx context.Context, param TomatoCreate) (*ent.UserTomato, error)
CreateTomato create a tomato clock if there is no working on tomato clock
func (Service) CreateUser ¶
CreateUser init user config and return it.
func (Service) GetUserByUsername ¶
GetUserByUsername returns user entity by username if exists. If user is not exists, it will return errors of not found
func (Service) GetWorkingTomatoByUserId ¶
GetWorkingTomatoByUserId get a working on tomato clock by user id
type TomatoCreate ¶
type TomatoCreate struct { // Duration unit is second Duration int // Color signed tomato clock type Color usertomato.Color UserId int // StartTime clock start time StartTime time.Time }
TomatoCreate create new tomato clock param
Click to show internal directories.
Click to hide internal directories.