dto

package
v0.0.0-...-bceaf69 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 4 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 {
	Author *User `json:"author,omitempty"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt null.Time `json:"updatedAt"`
	Title     string    `json:"title"`
	Contents  string    `json:"contents"`
	Slug      string    `json:"slug"`
	AuthorID  uint      `json:"authorID"`
	ID        uint      `json:"id"`
}

type CreateArticle

type CreateArticle struct {
	Title    string `json:"title"`
	Contents string `json:"contents"`
	AuthorID uint   `json:"authorID"`
}

type InternalUser

type InternalUser struct {
	Avatar   null.String `json:"avatar"`
	Password string      `json:"password"`
	User
}

InternalUser contains private user info that should not be exposed to clients.

type RegisterUser

type RegisterUser struct {
	Email    string                                        `json:"email"`
	Username string                                        `json:"username"`
	Password string                                        `json:"password" copier:"-"`
	Avatar   typeutil.Undefined[null.Value[[]fsutil.File]] `json:"avatar" copier:"-"`
}

type UpdateArticle

type UpdateArticle struct {
	Title    typeutil.Undefined[string] `json:"title"`
	Contents typeutil.Undefined[string] `json:"contents"`
}

type UpdateUser

type UpdateUser struct {
	Email    typeutil.Undefined[string]                    `json:"email"`
	Username typeutil.Undefined[string]                    `json:"username"`
	Password typeutil.Undefined[string]                    `json:"password" copier:"-"`
	Avatar   typeutil.Undefined[null.Value[[]fsutil.File]] `json:"avatar" copier:"-"`
}

type User

type User struct {
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt null.Time `json:"updatedAt"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	ID        uint      `json:"id"`
}

User the public user DTO. Used to show profiles for example.

Jump to

Keyboard shortcuts

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