models

package
v0.0.0-...-34e0d52 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID         uint     `json:"id" gorm:"primary_key"`
	Title      string   `json:"title"`
	CategoryID uint     `json:"category_id"`
	Category   Category `json:"category"`
}

Article table

type Category

type Category struct {
	ID           uint   `json:"id" gorm:"primary_key"`
	CategoryName string `json:"category_name"`
}

type CreditCard

type CreditCard struct {
	gorm.Model

	ID     uint   `json:"id" gorm:"primary_key"`
	Number string `json:"number"`
	UserID uint   `json:"user_id"`
}

type CreditCardOne

type CreditCardOne struct {
	Number string
	UserID uint
}

type Example

type Example struct {
	Id        int        `json:"id"`
	Data      string     `json:"data" binding:"required"`
	CreatedAt *time.Time `json:"created_at,string,omitempty"`
	UpdatedAt *time.Time `json:"updated_at_at,string,omitempty"`
}

func (*Example) TableName

func (e *Example) TableName() string

TableName Database Table Name of this model

type User

type User struct {
	ID          uint         `json:"id" gorm:"primary_key"`
	Name        string       `json:"name"`
	CreditCards []CreditCard `json:"credit_cards"`
}

User has many CreditCards, UserID is the foreign key

type UserOne

type UserOne struct {
	CreditCard CreditCard
}

Jump to

Keyboard shortcuts

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