handler

package
v0.0.0-...-3d0adf2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : config.go # Created : 2019/1/14 19:42 # Last Modified : 2019/1/14 19:42 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : handler.go # Created : 2019/1/11 14:53 # Last Modified : 2019/1/11 14:53 # Describe : 通用的组件,用来解析提交的数据,传给各个不同的handler # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : sms.go # Created : 2019/1/11 12:01 # Last Modified : 2019/1/11 12:01 # Describe : 处理和短信操作有关的数据 # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : template.go # Created : 2019/1/15 15:01 # Last Modified : 2019/1/15 15:01 # Describe : # # ====================================================

====================================================

# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : validate.go # Created : 2019/1/15 11:21 # Last Modified : 2019/1/15 11:21 # Describe : # # ====================================================

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonHandler

func JsonHandler(sh BodyHandler) http.HandlerFunc

JsonHandler 针对需要从request.Body中取json的handler

func MsgCancel

func MsgCancel(ctx context.Context, d map[string]string) (res []byte, err error)

@router(DELETE,"/msg/{id}") MsgCancel 取消发送短信

func MsgCancelByKey

func MsgCancelByKey(ctx context.Context, d map[string]string) (res []byte, err error)

@router(DELETE,"/msg/key/{key}")

func MsgDetailByKey

func MsgDetailByKey(ctx context.Context, d map[string]string) (res []byte, err error)

@router(GET,"/msg/key/{key}/page/{p}")

func MsgDetailByTo

func MsgDetailByTo(ctx context.Context, d map[string]string) (res []byte, err error)

@router(GET,"/msg/to/{to}/page/{p}")

func MsgEdit

func MsgEdit(ctx context.Context, body []byte) (res []byte, err error)

@router(PATCH,"/msg") SmsEdit 修改短信发送消息

func MsgIDDetail

func MsgIDDetail(ctx context.Context, d map[string]string) (res []byte, err error)

MsgIDDetail 根据id或取消消息的具体信息 @router(GET,"/msg/{id}")

func MsgProducer

func MsgProducer(ctx context.Context, body []byte) (res []byte, err error)

@router(POST,"/msg") MsgProducer 接收用户提交的json,并将json转化成消息插入到消息队列

func TemplateAdd

func TemplateAdd(ctx context.Context, data []byte) (res []byte, err error)

@router("POST","/version/template") TemplateAdd 添加模板

func URLHandler

func URLHandler(sh PathHandler) http.HandlerFunc

URLHandler handler所需要的数据在url中

Types

type BodyHandler

type BodyHandler func(ctx context.Context, data []byte) ([]byte, error)

BodyHandler 需要从request.Body中取数据的func

type PathHandler

type PathHandler func(ctx context.Context, data map[string]string) ([]byte, error)

PathHandler 从url中数据的func

Jump to

Keyboard shortcuts

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