models

package
v0.0.0-...-6c4e2a1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEntity

type BaseEntity struct {
	Id        uint           `gorm:"primarykey"`
	CreatedAt time.Time      `gorm:"autocreatetime"`
	UpdatedAt time.Time      `gorm:"autoupdatetime"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
	IsActive  bool           `gorm:"default:true"`
}

type BaseRequest

type BaseRequest struct {
	Platform   string `json:"Platform"`
	Controller string `json:"Controller"`
	Method     string `json:"Method"`
	Token      string `json:"Token"`
	ApiKey     string `json:"ApiKey"`
}

type Create

type Create struct {
	BaseRequest
}

type Delete

type Delete struct {
	BaseRequest
	Id          int `json:"Id"`
	IsPermenant bool
}

type NullBool

type NullBool struct {
	sql.NullBool
}

Nullable Bool that overrides sql.NullBool

func (NullBool) MarshalJSON

func (nb NullBool) MarshalJSON() ([]byte, error)

func (*NullBool) UnmarshalJSON

func (nb *NullBool) UnmarshalJSON(data []byte) error

type NullFloat64

type NullFloat64 struct {
	sql.NullFloat64
}

Nullable Float64 that overrides sql.NullFloat64

func (NullFloat64) MarshalJSON

func (nf NullFloat64) MarshalJSON() ([]byte, error)

func (*NullFloat64) UnmarshalJSON

func (nf *NullFloat64) UnmarshalJSON(data []byte) error

type NullInt64

type NullInt64 struct {
	sql.NullInt64
}

Nullable Int64 that overrides sql.NullInt64

func (NullInt64) MarshalJSON

func (ni NullInt64) MarshalJSON() ([]byte, error)

func (*NullInt64) UnmarshalJSON

func (ni *NullInt64) UnmarshalJSON(data []byte) error

type NullString

type NullString struct {
	sql.NullString
}

Nullable String that overrides sql.NullString

func (NullString) MarshalJSON

func (ns NullString) MarshalJSON() ([]byte, error)

func (*NullString) UnmarshalJSON

func (ns *NullString) UnmarshalJSON(data []byte) error

type Read

type Read struct {
	BaseRequest
	IsActiveRequired bool   `json:"IsActiveRequired"`
	OnlyIsPassive    bool   `json:"OnlyIsPassive"`
	IsOrderByAsc     bool   `json:"IsOrderByAsc"`
	OrderBy          string `json:"OrderBy"`
	Page             int    `json:"Page"`
	Count            int    `json:"Count"`
	SearchValue      string `json:"SearchValue"`
	GetChildrenCount bool   `json:"GetChildrenCount"`
	GetChildren      bool   `json:"GetChildren"`
	Id               int    `json:"Id"`
	ParentId         int    `json:"ParentId"`
}

func NewRead

func NewRead() Read

type Response

type Response struct {
	Success      bool        `json:"Success"`
	Message      string      `json:"Message"`
	Result       interface{} `json:"Result"`
	Count        int         `json:"Count"`
	MaxCount     int         `json:"MaxCount"`
	Page         int         `json:"Page"`
	MaxPage      int         `json:"MaxPage"`
	IsOrderByAsc bool        `json:"IsOrderByAsc"`
	OrderBy      string      `json:"OrderBy"`
	Request      interface{} `json:"Request"`
	Error        error       `json:"Error"`
	ErrorMessage string      `json:"ErrorMessage"`
}

func NewResponse

func NewResponse() Response

func (*Response) Fill

func (r *Response) Fill(
	what string,
	data interface{},
	request interface{},
	err error,
	count int,
	maxCount int,
	page int,
	maxPage int,
	orderBy string,
	isOrderByAsc bool,
)

func (*Response) Respond

func (r *Response) Respond(
	w http.ResponseWriter)

type Update

type Update struct {
	Create
}

Jump to

Keyboard shortcuts

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