modelUtil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 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 ErrorParam

type ErrorParam struct {
	Field   string `json:"field" example:"key"`
	Message string `json:"message" example:"msg"`
}

type ResultModel

type ResultModel struct {
	Success     bool          `json:"success" example:"true"`
	Data        interface{}   `json:"data,omitempty" example:""`
	Message     string        `json:"message,omitempty" example:""`
	ErrorParams []*ErrorParam `json:"errorParams,omitempty" example:""`
}

func FailureResultWithError

func FailureResultWithError(e error) *ResultModel

func FailureResultWithStr

func FailureResultWithStr(msg string, v ...interface{}) *ResultModel

func SuccessResult

func SuccessResult(data interface{}) *ResultModel

func ToSimResultModel

func ToSimResultModel(r cm.Result) *ResultModel

type ResultPageModel

type ResultPageModel struct {
	Success    bool        `json:"success" example:"true"`
	Data       interface{} `json:"data" example:""`
	PageNum    int         `json:"pageNum" example:""`
	PageSize   int         `json:"pageSize" example:""`
	TotalCount int         `json:"totalCount" example:""`
}

func SuccessPageResult

func SuccessPageResult(data interface{}, pageNum int, pageSize int, totalCount int) *ResultPageModel

Jump to

Keyboard shortcuts

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