model

package
v0.0.0-...-b336cc8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSuccess = "success"
	StatusFail    = "fail"
)
View Source
const (
	PRODUCT_SORT_NEWEST  = "newest"
	PRODUCT_SORT_POPULAR = "popular"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerValidator

type AnswerValidator struct {
	ID     int64  `json:"id" binding:"required"`
	Answer string `json:"answer" binding:"required"`
}

type Question

type Question struct {
	ID        int64     `json:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	Text      string    `json:"text" gorm:"default:''"`
	Answer    string    `json:"answer"`
	Upvotes   int       `json:"upvotes" gorm:"default:0"`
}

type QuestionUpvoteValidator

type QuestionUpvoteValidator struct {
	ID int64 `json:"id" binding:"required"`
}

type QuestionValidator

type QuestionValidator struct {
	Text string `json:"text" binding:"required"`
}

Validators

type Response

type Response struct {
	Data    interface{} `json:"data"`
	Status  string      `json:"status"`
	Message string      `json:"message"`
}

type ResponseContext

type ResponseContext struct {
	Ctx *gin.Context
}

func (*ResponseContext) ResponseData

func (self *ResponseContext) ResponseData(status string, message string, data interface{}) Response

type ServiceResponse

type ServiceResponse struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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