dept

package
v0.0.0-...-49281bb Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteSchema

type DeleteSchema struct {
	Rows []uint `json:"rows"`
}

type Dept

type Dept struct {
	DB *gorm.DB
}

func (Dept) Create

func (r Dept) Create(c *gin.Context)

Create @Tags 部门管理 @Summary 创建部门 @Description 部门 @Produce json @Security ApiKeyAuth @Param payload body sys.Role true "参数信息" @Success 200 object response.Data {"code": 2000, "status": "ok", "message": "success", "data": ""} @Failure 400 object response.Data {"code": 4001, "status": "error", "message": "error", "data": ""} @Router /api/v1/sys/dept [post]

func (Dept) Delete

func (r Dept) Delete(c *gin.Context)

Delete @Tags 部门管理 @Summary 删除部门 @Description 部门 @Produce json @Security ApiKeyAuth @Param id path int true "部门id" @Success 200 object response.Data {"code": 2000, "status": "ok", "message": "success", "data": ""} @Failure 400 object response.Data {"code": 4001, "status": "error", "message": "error", "data": ""} @Router /api/v1/sys/dept/{id} [delete]

func (Dept) GetAll

func (r Dept) GetAll(c *gin.Context)

GetAll @Tags 部门管理 @Summary 所有部门 @Description 部门 @Produce json @Security ApiKeyAuth @Success 200 object response.Data {"code": 2000, "status": "ok", "message": "success", "data": ""} @Failure 400 object response.Data {"code": 4001, "status": "error", "message": "error", "data": ""} @Router /api/v1/sys/depts [get]

func (Dept) Query

func (r Dept) Query(c *gin.Context)

Query @Tags 部门管理 @Summary 部门列表 @Description 部门 @Produce json @Security ApiKeyAuth @Param name query string false "部门名" @Success 200 object response.Data {"code": 2000, "status": "ok", "message": "success", "data": ""} @Failure 400 object response.Data {"code": 4001, "status": "error", "message": "error", "data": ""} @Router /api/v1/sys/dept [get]

func (Dept) Update

func (r Dept) Update(c *gin.Context)

Update @Tags 部门管理 @Summary 更新部门 @Description 部门 @Produce json @Security ApiKeyAuth @Param payload body sys.Role true "参数信息" @Success 200 object response.Data {"code": 2000, "status": "ok", "message": "success", "data": ""} @Failure 400 object response.Data {"code": 4001, "status": "error", "message": "error", "data": ""} @Router /api/v1/sys/dept [put]

type IDept

type IDept interface {
	GetAll(c *gin.Context)
	Query(c *gin.Context)
	Create(c *gin.Context)
	Update(c *gin.Context)
	Delete(c *gin.Context)
}

func NewService

func NewService(DB *gorm.DB) IDept

type PostSchema

type PostSchema struct {
	Name     string          `json:"name" binding:"required"`
	Code     string          `json:"code" binding:"required"`
	ParentID uint            `json:"parent_id"`
	Sort     int             `json:"sort"`
	Leader   string          `json:"leader"`
	Status   bool            `json:"status"`
	Path     models.IntArray `json:"path"`
}

func (PostSchema) TableName

func (PostSchema) TableName() string

type PutSchema

type PutSchema struct {
	//ID          uint   `json:"id" binding:"required"`
	Name     *string          `json:"name"`
	Code     *string          `json:"code"`
	ParentID *uint            `json:"parent_id"`
	Sort     *int             `json:"sort"`
	Leader   *string          `json:"leader"`
	Status   *bool            `json:"status"`
	Path     *models.IntArray `json:"path"`
}

func (PutSchema) TableName

func (PutSchema) TableName() string

type ShowData

type ShowData struct {
	ID   uint   `json:"id" form:"id"`
	Name string `json:"name" form:"name"`
	Code string `json:"code" form:"code"`
}

func (ShowData) TableName

func (ShowData) TableName() string

Jump to

Keyboard shortcuts

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