api

package
v0.0.0-...-f4276bb Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 9 Imported by: 0

README

业务接口的实现

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

处理Http报文的处理器 又这个handler类来负责实现具体的API 接口

func NewHandler

func NewHandler() *Handler

为啥要用一个函数来构造 初始化一些基础数据 具体传递实现,在什么时候决定 典型的面向接口编程 使用ioc 替换掉 直接依赖

func (*Handler) CreateBlog

func (h *Handler) CreateBlog(c *gin.Context)

使用web框架: Gin

func (*Handler) DeleteBlog

func (h *Handler) DeleteBlog(c *gin.Context)

func (*Handler) DescribeBlog

func (h *Handler) DescribeBlog(c *gin.Context)

func (*Handler) Init

func (h *Handler) Init() error

让他从Ioc中获取依赖的对象

func (*Handler) Name

func (h *Handler) Name() string

func (*Handler) QueryBlog

func (h *Handler) QueryBlog(c *gin.Context)

使用web框架: Gin

func (*Handler) Registry

func (h *Handler) Registry(r gin.IRouter)

把你的请求和Http 路由对应上 r 就是一个gin http 的路由器 URL: /vblog/api/v1/blogs ---> 那个Handler(处理函数)

func (*Handler) UpdateBlog

func (h *Handler) UpdateBlog(c *gin.Context)

Jump to

Keyboard shortcuts

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