presenter

package
v0.0.0-...-2ba808a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderData

func RenderData(ctx *gin.Context, data, paging interface{})

RenderData returns data response

func RenderErrors

func RenderErrors(ctx *gin.Context, span tracer.Span, err error)

RenderErrors returns error response

Types

type ResponseCursor64Paging

type ResponseCursor64Paging struct {
	BeforeID    string `json:"before_id,omitempty"`
	IsLastPage  bool   `json:"is_last_page,omitempty"`
	AfterID     string `json:"after_id,omitempty"`
	IsFirstPage bool   `json:"is_first_page,omitempty"`
}

type ResponsePaging

type ResponsePaging struct {
	Total uint32 `json:"total"`
}

ResponsePaging holds paging response information

type User

type User struct {
	UserID      string `json:"user_id"`
	UserName    string `json:"username"`
	Email       string `json:"email"`
	PhoneNumber string `json:"phone_number"`
	AvatarLink  string `json:"avatar_link"`
	RoleCode    string `json:"role"`
}

InternalUser holds response information of internal users

func FormInternalUser

func FormInternalUser(internalUser entity.User) User

FormInternalUser convert an internal user entity struct to its presenter struct

func FormInternalUsers

func FormInternalUsers(internalUsers []entity.User) []User

FormInternalUsers converts a list of internal user entity struct to a list of its presenter struct

Jump to

Keyboard shortcuts

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