model

package
v0.0.0-...-3c2c734 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 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 BaseResponse

type BaseResponse struct {
	ID        uint      `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CreateOrganizationRequest

type CreateOrganizationRequest struct {
	Name        string  `json:"name" validate:"required"`
	Description *string `json:"description"`
}

type DeleteOrganizationRequest

type DeleteOrganizationRequest struct {
	ID uint `param:"id" validate:"required"`
}

type ErrorResponse

type ErrorResponse struct {
	Error            string                     `json:"error"`
	ValidationErrors []*ValidationErrorResponse `json:"validation_errors"`
}

func NewErrorResponse

func NewErrorResponse(err error, validationErrors []*ValidationErrorResponse) *ErrorResponse

type GetManyOrganizationRequest

type GetManyOrganizationRequest struct {
	PageRequest
}

type GetOrganizationRequest

type GetOrganizationRequest struct {
	ID uint `param:"id" validate:"required"`
}

type GetUserRequest

type GetUserRequest struct {
}

type JwtClaims

type JwtClaims struct {
	jwt.StandardClaims
	User JwtUser `json:"user"`
}

type JwtUser

type JwtUser struct {
	ID   uint `json:"id"`
	Role uint `json:"role"`
}

type OrganizationResponse

type OrganizationResponse struct {
	BaseResponse
	Name        string  `json:"name,omitempty"`
	Description *string `json:"description"`
}

type PageMeta

type PageMeta struct {
	Page      uint   `json:"page"`
	Size      uint   `json:"size"`
	TotalItem uint64 `json:"total_item"`
	TotalPage uint64 `json:"total_page"`
}

type PageRequest

type PageRequest struct {
	Page *uint `query:"page"`
	Size *uint `query:"size"`
}

type PageResponse

type PageResponse struct {
	Data     any       `json:"data,omitempty"`
	PageMeta *PageMeta `json:"meta,omitempty"`
}

func NewPageResponse

func NewPageResponse(data any, metadata *PageMeta) *PageResponse

type Response

type Response struct {
	Data any `json:"data,omitempty"`
}

func NewResponse

func NewResponse(data any) *Response

helper

type RoleResponse

type RoleResponse struct {
	BaseResponse
	Name string `json:"name"`
}

type UpdateOrganizationRequest

type UpdateOrganizationRequest struct {
	ID          uint    `json:"id" validate:"required"`
	Name        string  `json:"name" validate:"required"`
	Description *string `json:"description"`
}

type UserResponse

type UserResponse struct {
	BaseResponse
	Name          string                  `json:"name"`
	Email         string                  `json:"email"`
	Role          *RoleResponse           `json:"role"`
	Organizations []*OrganizationResponse `json:"organizations"`
}

type ValidationErrorResponse

type ValidationErrorResponse struct {
	Field string `json:"field"`
	Type  string `json:"type"`
	Tag   string `json:"tag"`
	Value string `json:"value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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