domain

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code   int    `json:"code"`
	Url    string `json:"url"`
	Method string `json:"method"`
}

type DayOff

type DayOff struct {
	ID        string         `gorm:"primaryKey;type:varchar(100)" json:"-"`
	UserID    string         `gorm:"type:varchar(100);not null" json:"user_id"`
	Year      int            `json:"year"`
	Month     int            `json:"month"`
	Date      int            `json:"date"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `json:"-"`
}

func (*DayOff) BeforeCreate

func (d *DayOff) BeforeCreate(_ *gorm.DB) (err error)

BeforeCreate will set snowflake id rather than numeric id.

type LoginRequest

type LoginRequest struct {
	Account  string `json:"account"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	BaseResponse
	Result LoginResult `json:"result"`
}

type LoginResult

type LoginResult struct {
	UserID       string `json:"userId"`
	Account      string `json:"account"`
	UserName     string `json:"userName"`
	Role         string `json:"role"`
	Avatar       string `json:"avatar"`
	OrganizeID   string `json:"organizeId"`
	OrganizeName string `json:"organizeName"`
	AccessToken  string `json:"accessToken"`
}

type PunchResponse

type PunchResponse struct {
	BaseResponse
	Result PunchResult `json:"result"`
}

type PunchResult

type PunchResult struct {
	IsSuccess bool   `json:"isSuccess"`
	ErrorType string `json:"errorType"`
	UserName  string `json:"userName"`
	Avatar    string `json:"avatar"`
}

type PunchUsecase

type PunchUsecase interface {
	Punch(discordUserID string) error
}

type User

type User struct {
	ID            string         `gorm:"primaryKey;type:varchar(100)" json:"-"`
	Nickname      string         `gorm:"type:varchar(100)" json:"nickname"`
	Account       string         `gorm:"type:varchat(100);unique;index;not null" json:"account"`
	Password      string         `gorm:"type:varchar(255);not null" json:"password"`
	DiscordUserID string         `gorm:"type:varchar(255);not null" json:"discord_user_id"`
	IsEnable      bool           `gorm:"index" json:"-"`
	Role          enums.RoleType `gorm:"type:int" json:"role"`
	CreatedAt     time.Time      `json:"-"`
	UpdatedAt     time.Time      `json:"-"`
	DeletedAt     gorm.DeletedAt `json:"-"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(_ *gorm.DB) (err error)

BeforeCreate will set snowflake id rather than numeric id.

Jump to

Keyboard shortcuts

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