web

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOrUpdateAdjustmentRoleReq

type AddOrUpdateAdjustmentRoleReq struct {
	Id       int64              `json:"id"`
	GroupId  int64              `json:"group_id"`
	RotaRule RotaAdjustmentRule `json:"rota_rule"`
}

AddOrUpdateAdjustmentRoleReq 新增修改值班规则

type AddRoleReq

type AddRoleReq struct {
	Id       int64    `json:"id"`
	RotaRule RotaRule `json:"rota_rule"`
}

AddRoleReq 新增值班规则

type CreateRotaReq

type CreateRotaReq struct {
	Name    string `json:"name"`
	Desc    string `json:"desc"`
	Enabled bool   `json:"enabled"`
	Owner   int64  `json:"owner"`
}

CreateRotaReq 创建值班请求

type DeleteAdjustmentRoleReq

type DeleteAdjustmentRoleReq struct {
	Id      int64 `json:"id"`
	GroupId int64 `json:"group_id"`
}

type DeleteReq

type DeleteReq struct {
	Id int64 `json:"id"`
}

type DetailById

type DetailById struct {
	Id int64 `json:"id"`
}

type DetailReq

type DetailReq struct {
	Id int64 `json:"id"`
}

type GenerateShiftRosteredReq

type GenerateShiftRosteredReq struct {
	Id        int64 `json:"id"`
	StartTime int64 `json:"start_time"` // 开始时间
	EndTime   int64 `json:"end_time"`   // 结束时间
}

GenerateShiftRosteredReq 生成排班表请求

type Handler

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

func NewHandler

func NewHandler(svc service.Service) *Handler

func (*Handler) AddShiftAdjustmentRule

func (h *Handler) AddShiftAdjustmentRule(ctx *gin.Context, req AddOrUpdateAdjustmentRoleReq) (ginx.Result, error)

AddShiftAdjustmentRule 新增临时排班规则

func (*Handler) AddShiftSchedulingRule

func (h *Handler) AddShiftSchedulingRule(ctx *gin.Context, req AddRoleReq) (ginx.Result, error)

AddShiftSchedulingRule 新增排班规则

func (*Handler) Create

func (h *Handler) Create(ctx *gin.Context, req CreateRotaReq) (ginx.Result, error)

Create 创建排班表

func (*Handler) Delete

func (h *Handler) Delete(ctx *gin.Context, req DeleteReq) (ginx.Result, error)

func (*Handler) DeleteShiftAdjustmentRule

func (h *Handler) DeleteShiftAdjustmentRule(ctx *gin.Context, req DeleteAdjustmentRoleReq) (ginx.Result, error)

func (*Handler) Detail

func (h *Handler) Detail(ctx *gin.Context, req DetailReq) (ginx.Result, error)

func (*Handler) GenerateShiftRostered

func (h *Handler) GenerateShiftRostered(ctx *gin.Context, req GenerateShiftRosteredReq) (ginx.Result, error)

GenerateShiftRostered 生成排班表

func (*Handler) GetRuleListById

func (h *Handler) GetRuleListById(ctx *gin.Context, req DetailById) (ginx.Result, error)

GetRuleListById 获取常规规则列表

func (*Handler) List

func (h *Handler) List(ctx *gin.Context, req ListReq) (ginx.Result, error)

func (*Handler) PrivateRoutes

func (h *Handler) PrivateRoutes(server *gin.Engine)

func (*Handler) Update

func (h *Handler) Update(ctx *gin.Context, req UpdateReq) (ginx.Result, error)

func (*Handler) UpdateShiftAdjustmentRule

func (h *Handler) UpdateShiftAdjustmentRule(ctx *gin.Context, req AddOrUpdateAdjustmentRoleReq) (ginx.Result, error)

UpdateShiftAdjustmentRule 修改临时排班规则

func (*Handler) UpdateShiftSchedulingRole

func (h *Handler) UpdateShiftSchedulingRole(ctx *gin.Context, req UpdateShiftRuleReq) (ginx.Result, error)

type ListReq

type ListReq struct {
	Offset int64 `json:"offset,omitempty"`
	Limit  int64 `json:"limit,omitempty" validate:"required"`
}

type RetrieveRotas

type RetrieveRotas struct {
	Rotas []Rota `json:"rotas"`
	Total int64  `json:"total"`
}

type RetrieveShiftRostered

type RetrieveShiftRostered struct {
	FinalSchedule   []Schedule `json:"final_schedule"`
	CurrentSchedule Schedule   `json:"current_schedule"`
	NextSchedule    Schedule   `json:"next_schedule"`
	Members         []int64    `json:"members"`
}

type Rota

type Rota struct {
	Id              int64                `json:"id"`
	Name            string               `json:"name"`
	Desc            string               `json:"desc"`
	Enabled         bool                 `json:"enabled"`
	Owner           int64                `json:"owner"`
	Rules           []RotaRule           `json:"rules"`
	AdjustmentRules []RotaAdjustmentRule `json:"adjustment_rules"`
}

type RotaAdjustmentRule

type RotaAdjustmentRule struct {
	StartTime int64     `json:"start_time"`
	EndTime   int64     `json:"end_time"`
	RotaGroup RotaGroup `json:"rota_group"`
}

RotaAdjustmentRule 临时值班规则

type RotaGroup

type RotaGroup struct {
	Id      int64   `json:"id"`
	Name    string  `json:"name"`
	Members []int64 `json:"members"`
}

RotaGroup 值班组

type RotaRule

type RotaRule struct {
	StartTime  int64       `json:"start_time"`
	EndTime    int64       `json:"end_time"`
	RotaGroups []RotaGroup `json:"rota_groups"`
	Rotate     Rotate      `json:"rotate"`
}

RotaRule 值班规则

type Rotate

type Rotate struct {
	TimeUnit     uint8 `json:"time_unit"`
	TimeDuration uint8 `json:"time_duration"`
}

Rotate 轮换相关参数

type Schedule

type Schedule struct {
	Title     string    `json:"title"`
	StartTime int64     `json:"start_time"`
	EndTime   int64     `json:"end_time"`
	RotaGroup RotaGroup `json:"rota_group"`
}

type UpdateReq

type UpdateReq struct {
	Id      int64  `json:"id"`
	Name    string `json:"name"`
	Desc    string `json:"desc"`
	Enabled bool   `json:"enabled"`
	Owner   int64  `json:"owner"`
}

type UpdateShiftRuleReq

type UpdateShiftRuleReq struct {
	Id        int64      `json:"id"`
	RotaRules []RotaRule `json:"rota_rules"`
}

Jump to

Keyboard shortcuts

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