models

package
v0.0.0-...-7a5cd37 Latest Latest
Warning

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

Go to latest
Published: May 7, 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 Comment

type Comment struct {
	Id          int       `json:"id,omitempty"`
	Author      string    `json:"author"`
	CommentText string    `json:"comment_text"`
	NewsId      int       `json:"news_id"`
	ParentId    NullInt64 `json:"parent_id,omitempty"`
	Level       int       `json:"level,omitempty"`
}

type NewComment

type NewComment struct {
	Author      string    `json:"author" validate:"required"`
	CommentText string    `json:"comment_text" validate:"required"`
	NewsId      int       `json:"news_id" validate:"required"`
	ParentId    NullInt64 `json:"parent_id,omitempty"`
}

type NullInt64

type NullInt64 struct {
	sql.NullInt64
}

func (*NullInt64) MarshalJSON

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

MarshalJSON for NullInt64

func (*NullInt64) UnmarshalJSON

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

Unmarshalling into a pointer will let us detect null

Jump to

Keyboard shortcuts

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