handler

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package handler ... 1. 一个处理器一个文件,不要分目录/包 2. 处理器逻辑尽量简单,复杂逻辑放到模块包中

Index

Constants

View Source
const (
	CommonRespCodeSuccess       CommonRespCode = 0
	CommonRespCodeServerUnknown                = 1 // 服务端未知错误 BadGateway
	CommonRespCodeClientUnknown                = 2 // 客户端未知错误 BadRequest
)

公共返回码 定义 0 ~ 100 保留, 作为 框架层的返回码

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonReq

type CommonReq struct {
	Version  string `json:"version,omitempty"`
	Token    string `json:"token,omitempty"`
	Username string `json:"username,omitempty"`
	Ts       int64  `json:"ts,omitempty"`
}

CommonReq 公共请求

type CommonResp

type CommonResp struct {
	Code CommonRespCode `json:"code"`
	Msg  string         `json:"msg,omitempty"`
	Ts   int64          `json:"ts,omitempty"`
}

CommonResp 公共响应

func GetCommonResp

func GetCommonResp(code CommonRespCode, err error) *CommonResp

GetCommonResp 通用返回

func GetcommonRespSuccess

func GetcommonRespSuccess() *CommonResp

GetcommonRespSuccess 成功返回

type CommonRespCode

type CommonRespCode int

CommonRespCode 公共返回码

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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