models

package
v0.0.0-...-1b941cd Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB)

Migrate automigrates models using ORM

Types

type Convert

type Convert struct {
	Voice  string `sql:"type:text;"`
	Text   string `sql:"type:text;"`
	Speed  int    `sql:"type:int;"`
	Format string `sql:"type:text;"`
}

Post data model

func (Convert) Serialize

func (c Convert) Serialize() common.JSON

Serialize serializes post data

type ErrBody

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

type ReqBody

type ReqBody struct {
	Voice  string `json:"voice" binding:"required"`
	Text   string `json:"text" binding:"required"`
	Speed  string `json:"speed" binding:"required"`
	Format string `json:"format" binding:"required"`
}

type ResBody

type ResBody struct {
	Status  string `json:"status"`
	Message string `json:"message"`
	Text    string `json:"text"`
	Link    string `json:"link"`
}

type User

type User struct {
	gorm.Model
	Username     string
	DisplayName  string
	PasswordHash string
}

User data model

func (*User) Read

func (u *User) Read(m common.JSON)

func (*User) Serialize

func (u *User) Serialize() common.JSON

Serialize serializes user data

Jump to

Keyboard shortcuts

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