Documentation
¶
Index ¶
- Constants
- func NewFailResultBytes(msg string) []byte
- func NewOkResultBytes(data interface{}, msg string) []byte
- func WriteFailResponse(rw http.ResponseWriter, msg string)
- func WriteOkResponse(rw http.ResponseWriter, data interface{}, msg string)
- type ApiException
- type ApiResult
- type HandleInterceptor
- type HttpProxy
- type QueryCondition
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 NewOkResultBytes ¶
func WriteFailResponse ¶
func WriteFailResponse(rw http.ResponseWriter, msg string)
func WriteOkResponse ¶
func WriteOkResponse(rw http.ResponseWriter, data interface{}, msg string)
Types ¶
type ApiException ¶
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 NewOkResult ¶
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代理
type QueryCondition ¶
type QueryCondition struct { QueryKey string QueryValue interface{} }
Click to show internal directories.
Click to hide internal directories.