service

package
v0.0.0-...-a399bb4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllInfoLocations

type AllInfoLocations struct {
	LocationBuilding []LocationBuilding `json:"locations"`
}

type BuildingFloor

type BuildingFloor struct {
	BuildingId   int         `json:"building_id"`
	BuildingName string      `json:"building_name"`
	FloorRoom    []FloorRoom `json:"floors"`
}

type DeviceGpio

type DeviceGpio struct {
	DeviceId   int    `json:"device_id"`
	DeviceName string `json:"device_name"`
	GpioInfo   []Gpio `json:"gpio_info"`
}

type FloorRoom

type FloorRoom struct {
	FloorId    int          `json:"floor_id"`
	FloorName  string       `json:"floor_name"`
	RoomDevice []RoomDevice `json:"rooms`
}

type Gpio

type Gpio struct {
	GpioId     int     `json:"gpio_id"`
	GpioNumber int     `json:"gpio_number"`
	GpioStatus int     `json:"gpio_status"`
	GpioTime   float32 `json:"gpio_time"`
}

type KengAddRequest

type KengAddRequest struct {
	Name         string `json:"name" binding:"required"`
	DeviceId     int    `json:"device_id" binding:"required"`
	DeviceGpioId int    `json:"device_gpio_id" binding:"required"`
	RoomId       int    `json:"room_id" binding:"required"`
	Index        int    `json:"index" binding:"required"`
	Remark       string `json:"remark"`
}

type KengAddResponse

type KengAddResponse struct {
	common.Response
}

type KengGetFrontHistoryRequest

type KengGetFrontHistoryRequest struct {
	KengId int `form:"keng_id" binding:"required"`
}

type KengGetFrontHistoryResponse

type KengGetFrontHistoryResponse struct {
	common.Response
	Data []KengHistoryInfo `json:"data"`
}

type KengGetFrontRequest

type KengGetFrontRequest struct {
	LocationId int `form:"location_id" binding:"required"`
	BuildingId int `form:"building_id" binding:"required"`
}

type KengGetFrontResponse

type KengGetFrontResponse struct {
	common.Response
	Data []LocationBuilding `json:"data"`
}

type KengGetListRequest

type KengGetListRequest struct {
	Limit      int `form:"limit" binding:"required"`
	Offset     int `form:"offset" binding:"required"`
	BuildingId int `form:"building_id"`
	RoomId     int `form:"room_id"`
	DeviceId   int `form:"device_id"`
	FloorId    int `form:"floor_id"`
}

type KengGetListResponse

type KengGetListResponse struct {
	common.Response
	Data   []models.KengModel `json:"data"`
	Limit  int                `json:"limit"`
	Offset int                `json:"offset"`
	Count  int                `json:"count"`
}

type KengGetRequest

type KengGetRequest struct {
	KengId int `form:"keng_id" binding:"required"`
}

type KengGetResponse

type KengGetResponse struct {
	common.Response
	Data models.KengModel `json:"data"`
}

type KengHistoryInfo

type KengHistoryInfo struct {
	KengId     int       `json:"keng_id"`
	KengName   string    `json:"keng_name"`
	KengIndex  int       `json:"keng_index"`
	KengStatus int       `json:"keng_status"`
	TimePoint  time.Time `json:"time_point"`
}

type KengInfo

type KengInfo struct {
	KengId     int    `json:"keng_id"`
	KengName   string `json:"keng_name"`
	KengIndex  int    `json:"keng_index"`
	KengStatus int    `json:"keng_status"`
	KengTime   string `json:"keng_time"`
}

type KengUpdateRequest

type KengUpdateRequest struct {
	Name         string `json:"name" binding:"required"`
	DeviceId     int    `json:"device_id" binding:"required"`
	DeviceGpioId int    `json:"device_gpio_id" binding:"required"`
	RoomId       int    `json:"room_id" binding:"required"`
	Index        int    `json:"index" binding:"required"`
	Remark       string `json:"remark"`
}

type KengUpdateResponse

type KengUpdateResponse struct {
	common.Response
}

type LocationBuilding

type LocationBuilding struct {
	LocationId    int             `json:"location_id"`
	LocationName  string          `json:"location_name"`
	BuildingFloor []BuildingFloor `json:"buildings`
}

type ProjectService

type ProjectService struct {
	common.BaseService
}

func NewServiceMgr

func NewServiceMgr(c *gin.Context) *ProjectService

func (*ProjectService) KengAdd

func (cps *ProjectService) KengAdd(req *KengAddRequest) *KengAddResponse

func (*ProjectService) KengGet

func (cps *ProjectService) KengGet(req *KengGetRequest) *KengGetResponse

func (*ProjectService) KengGetFront

func (cps *ProjectService) KengGetFront(req *KengGetFrontRequest) *KengGetFrontResponse

func (*ProjectService) KengGetFrontHistory

func (*ProjectService) KengGetList

func (cps *ProjectService) KengGetList(req *KengGetListRequest) *KengGetListResponse

func (*ProjectService) KengUpdate

func (cps *ProjectService) KengUpdate(id string, req *KengUpdateRequest) *KengUpdateResponse

func (*ProjectService) UserAdd

func (cps *ProjectService) UserAdd(req *UserAddRequest) *UserAddResponse

func (*ProjectService) UserGet

func (cps *ProjectService) UserGet(req *UserGetRequest) *UserGetResponse

type RoomDevice

type RoomDevice struct {
	RoomId     int          `json:"room_id"`
	RoomName   string       `json:"room_name"`
	DeviceGpio []DeviceGpio `json:"device"`
	KengInfo   []KengInfo   `json:"keng_info"`
}

type UserAddRequest

type UserAddRequest struct {
	UserNickname string `json:"user_nickname" binding:"required"`
	Age          int    `json:"age" binding:"required"`
	Remark       string `json:"remark"`
}

type UserAddResponse

type UserAddResponse struct {
	common.Response
}

type UserGetRequest

type UserGetRequest struct {
	UserNickname string `form:"user_nickname" binding:"required"`
}

type UserGetResponse

type UserGetResponse struct {
	common.Response
	Data models.UserModel `json:"data"`
}

Jump to

Keyboard shortcuts

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