gentity

package
v1.0.37 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BatchInsertSQLTemplate = "insert into %s.%s(%s) values %s" // 1-库名,2-表名,3-字段,4-值
View Source
const DeleteSQLTemplate = "delete from %s.%s where %s" // 1-库名,2-表名,3-where条件
View Source
const ErrorCode = 500
View Source
const InsertSQLTemplate = "insert into %s.%s(%s) values(%s)" // 1-库名,2-表名,3-字段,4-值
View Source
const Limit string = "limit"
View Source
const Offset string = "offset"
View Source
const ReplaceSQLTemplate = "replace into %s.%s(%s) values(%s)" // 1-库名,2-表名,3-字段,4-值
View Source
const SelectSQLTemplate = "select %s from %s.%s %s %s %s" //  1-字段,2-库名,3-表名,4-where,5-order, 6-limit
View Source
const SuccessCode = 200
View Source
const UpdateSQLTemplate = "update %s.%s set %s where %s" // 1-库名,2-表名,3-字段=值,4-where条件

Variables

This section is empty.

Functions

func NewFailResultBytes

func NewFailResultBytes(msg string) []byte

func NewOkResultBytes

func NewOkResultBytes(data interface{}, msg string) []byte

func WriteFailResponse

func WriteFailResponse(rw http.ResponseWriter, msg string)

func WriteOkResponse

func WriteOkResponse(rw http.ResponseWriter, data interface{}, msg string)

Types

type ApiException

type ApiException struct {
	Code int32
	Msg  string
}

func NewApiException

func NewApiException(code int32, msg string) *ApiException

func NewException

func NewException(msg string) *ApiException

func (*ApiException) Error

func (error *ApiException) Error() string

type ApiResult

type ApiResult struct {
	Code    int32       `json:"code"`
	Success bool        `json:"success"`
	Msg     string      `json:"msg"`
	Data    interface{} `json:"data"`
}

func NewFailResult

func NewFailResult(msg string) ApiResult

func NewOkResult

func NewOkResult(data interface{}, msg string) ApiResult

type HandleInterceptor added in v1.0.36

type HandleInterceptor interface {
	PreHandle(rw http.ResponseWriter, req *http.Request) bool
	PostHandle(rw http.ResponseWriter, req *http.Request)
}

HandleInterceptor 拦截器

type HttpProxy added in v1.0.36

type HttpProxy struct {
	// contains filtered or unexported fields
}

HttpProxy http代理

func (*HttpProxy) ServeHTTP added in v1.0.36

func (pxy *HttpProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type QueryCondition

type QueryCondition struct {
	QueryKey   string
	QueryValue interface{}
}

Jump to

Keyboard shortcuts

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