api

package
v0.0.0-...-6a8978f Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 9 Imported by: 0

README

模块协议数据处理

用户使用我们服务API(HTTP): JSON ON HTTP

协议层的 序列化和反序列化 用户的请求(HTTP协议) ---> 内部的对象 返回的对象(内部对象) ---> 包装成HTTP协议数据

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPAPI

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

HTTPAPI 定义用来 对外暴露HTTP服务,注册给协议Server(HTTP Server, Gin)

func NewHTTPAPI

func NewHTTPAPI() *HTTPAPI

func (*HTTPAPI) CreateBlog

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

obj := newXXXObject() json.Unmarshal(payload, ojb)

func (*HTTPAPI) DeleteBlog

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

func (*HTTPAPI) DescribeBlog

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

func (*HTTPAPI) Init

func (h *HTTPAPI) Init() error

把HTTP API 托管到IOC init时获取依赖注入

func (*HTTPAPI) Name

func (h *HTTPAPI) Name() string

func (*HTTPAPI) PatchBlog

func (h *HTTPAPI) PatchBlog(c *gin.Context)

func (*HTTPAPI) PutBlog

func (h *HTTPAPI) PutBlog(c *gin.Context)

func (*HTTPAPI) QueryBlog

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

c.Request.URL.Query().Get("keywords") page_size, page_number req := blog.NewQueryBlogRequest() req.Keywords = c.Query("keywords") req.PageSize = c.Query("page_size") req.PageNumber = c.Query("page_number") req.Status = c.Query("status")

func (*HTTPAPI) Registry

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

URI 注册给 Gin

func (*HTTPAPI) UpdateBlogStatus

func (h *HTTPAPI) UpdateBlogStatus(c *gin.Context)

Jump to

Keyboard shortcuts

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