cabinets

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CreateReq

type CreateReq struct {
	CreatedAt      int64  `json:"created_at"`
	Name           string `json:"name"`
	DatacenterId   uint   `json:"datacenter_id"`
	DatacenterName string `json:"datacenter_name"`
	Id             int    `json:"id"`
	IsLock         int    `json:"is_lock"`
	Capacity       uint   `json:"capacity"`
	Contact        struct {
		Name  string `json:"name"`
		Tel   string `json:"tel"`
		Email string `json:"email"`
	} `json:"contact"`
	Electric     string `json:"electric"`
	ElectricUnit string `json:"electric_unit"`
	Remark       string `json:"remark"`
	Edited       bool   `json:"edited"`
}

func (*CreateReq) Body

func (r *CreateReq) Body() (body any)

func (*CreateReq) Method

func (r *CreateReq) Method() (method string)

func (*CreateReq) Url

func (r *CreateReq) Url() (url string)

func (*CreateReq) Values

func (r *CreateReq) Values() (values url.Values)

type DeleteReq

type DeleteReq struct{ Id uint }

func (*DeleteReq) Body

func (r *DeleteReq) Body() (body any)

func (*DeleteReq) Method

func (r *DeleteReq) Method() (method string)

func (*DeleteReq) Url

func (r *DeleteReq) Url() (url string)

func (*DeleteReq) Values

func (r *DeleteReq) Values() (values url.Values)

type ListReq

type ListReq struct {
	Page     uint `url:"page"`
	PageSize uint `url:"page_size"`
}

func (*ListReq) Body

func (r *ListReq) Body() (body any)

func (*ListReq) Method

func (r *ListReq) Method() (method string)

func (*ListReq) Url

func (r *ListReq) Url() (url string)

func (*ListReq) Values

func (r *ListReq) Values() (values url.Values)

type ListResp

type ListResp struct {
	Success  bool   `json:"success"`
	Error    string `json:"error"`
	Cabinets []struct {
		Id           uint   `json:"id"`
		Name         string `json:"name"`
		DatacenterId uint   `json:"datacenter_id"`
		Capacity     int    `json:"capacity"`
		Electric     string `json:"electric"`
		Remark       string `json:"remark"`
		IsLock       int    `json:"is_lock"`
		Contact      struct {
			Name  string `json:"name"`
			Tel   string `json:"tel"`
			Email string `json:"email"`
		} `json:"contact"`
		CreatedAt  int `json:"created_at"`
		UpdatedAt  int `json:"updated_at"`
		SpaceCount struct {
			Total int `json:"total"`
			Free  int `json:"free"`
			Using int `json:"using"`
			Real  int `json:"real"`
		} `json:"space_count"`
	} `json:"cabinets"`
	Total int `json:"total"`
}

func (ListResp) Err

func (r ListResp) Err() (err error)

func (ListResp) Ok

func (r ListResp) Ok() (ok bool)

type UpdateReq

type UpdateReq struct {
	Id           uint   `json:"-"`
	Name         string `json:"name"`          // 名称
	DatacenterId uint   `json:"datacenter_id"` // 机房id
	Electric     int    `json:"electric"`      // 电量
	Remark       string `json:"remark"`        // 备注
	IsLock       int    `json:"is_lock"`
	Contact      struct {
		Name  string `json:"name"`  // 联系人
		Tel   string `json:"tel"`   // 联系电话
		Email string `json:"email"` // 联系人邮箱
	} `json:"contact"`
}

func (*UpdateReq) Body

func (r *UpdateReq) Body() (body any)

func (*UpdateReq) Method

func (r *UpdateReq) Method() (method string)

func (*UpdateReq) Url

func (r *UpdateReq) Url() (url string)

func (*UpdateReq) Values

func (r *UpdateReq) Values() (values url.Values)

Jump to

Keyboard shortcuts

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