flowcontroller

package
v0.0.0-...-7a729f8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareMiddleWare

func PrepareMiddleWare() gin.HandlerFunc

自定义 JSON 封装中间件

func ResponseJSONMiddleWare

func ResponseJSONMiddleWare() gin.HandlerFunc

自定义 JSON 封装中间件

func Router

func Router(r *gin.Engine, rootPath string, mappingMethods string, handlers ...gin.HandlerFunc)

路由注册,样例如下 Router("/v1/crud/:service", "get:GetAll;post:Post", gin.HandlerFunc...) Router("/v1/crud/:service/:id:int", "get:GetOne;put:Put;delete:Delete", gin.HandlerFunc...) Router("/v1/crud/:service/deletelist", "delete:DeleteList", gin.HandlerFunc...) Router("/v1/crud/:service/:id/:action", "post:Action;get:Action", gin.HandlerFunc...)

func UseMiddleWare

func UseMiddleWare(r *gin.Engine)

Types

type FlowController

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

FlowController operations for model

func (*FlowController) Action

func (f *FlowController) Action(c *gin.Context)

Action ... @Title 独立动作 @Description handle a action @Param body body params true "body for Service content" @Success 201 {int} OK(step info) @Failure 403 body is empty @router /:service/:id/:action [post]

func (*FlowController) Delete

func (f *FlowController) Delete(c *gin.Context)

Delete ... @Title Delete @Description delete the Service @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:service/:id [delete]

func (*FlowController) DeleteList

func (f *FlowController) DeleteList(c *gin.Context)

DeleteList ... @Title multi-Delete @Description delete multi Services @Param ids string true "The ids you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:service/deletelist [delete]

func (*FlowController) Export

func (f *FlowController) Export(c *gin.Context)

Export ... @Title export @Description get Service @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} Service @Failure 403 @router /:service/export [get]

func (*FlowController) GetAll

func (f *FlowController) GetAll(c *gin.Context)

GetAll ... @Title Get All @Description get Service @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} Service @Failure 403 @router /:service [get]

func (*FlowController) GetMapMethod

func (c *FlowController) GetMapMethod(method string) gin.HandlerFunc

according the method name to get the function

func (*FlowController) GetOne

func (f *FlowController) GetOne(c *gin.Context)

GetOne ... @Title Get One @Description get Service by id @Param id path string true "The key for staticblock" @Success 200 {object} Service @Failure 403 :id is empty @router /:service/:id [get]

func (*FlowController) Import

func (f *FlowController) Import(c *gin.Context)

Import ... @Title 导出excel,批量创建对象 @Description batch create Service @Param service string Service true "body for Service content" @Success 201 {int} Service @Failure 403 body is empty @router /:service/import [post]

func (*FlowController) Mapping

func (c *FlowController) Mapping(method string, fn gin.HandlerFunc)

Mapping the method to function

func (*FlowController) Post

func (f *FlowController) Post(c *gin.Context)

Post ... @Title 创建一条流程 @Description create Service @Param service string Service true "body for Service content" @Success 201 {int} Service @Failure 403 body is empty @router /:service [post]

func (*FlowController) Put

func (f *FlowController) Put(c *gin.Context)

Put ... @Title Put @Description update the Service @Param id path string true "The id you want to update" @Param body body Service true "body for Service content" @Success 200 {object} Service @Failure 403 :id is not int @router /:service/:id [put]

Jump to

Keyboard shortcuts

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