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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildingAddRequest

type BuildingAddRequest struct {
	Name       string `json:"name" binding:"required"`
	LocationId int    `json:"location_id" binding:"required"`
	Remark     string `json:"remark"`
}

type BuildingAddResponse

type BuildingAddResponse struct {
	common.Response
}

type BuildingGetListRequest

type BuildingGetListRequest struct {
	Limit      int `form:"limit" binding:"required"`
	Offset     int `form:"offset" binding:"required"`
	LocationId int `form:"location_id"`
}

type BuildingGetListResponse

type BuildingGetListResponse struct {
	common.Response
	Limmit int                    `json:"limit"`
	Offset int                    `json:"offset"`
	Count  int                    `json:"count"`
	Data   []models.BuildingModel `json:"data"`
}

type BuildingGetRequest

type BuildingGetRequest struct {
	BuildingId int `form:"building_id" binding:"required"`
}

type BuildingGetResponse

type BuildingGetResponse struct {
	common.Response
	Data models.BuildingModel `json:"data"`
}

type BuildingUpdateRequest

type BuildingUpdateRequest struct {
	Name       string `json:"name" binding:"required"`
	LocationId int    `json:"location_id" binding:"required"`
	Remark     string `json:"remark"`
}

type BuildingUpdateResponse

type BuildingUpdateResponse struct {
	common.Response
}

type DeviceAddRequest

type DeviceAddRequest struct {
	Name       string `json:"name" binding:"required"`
	DeviceType int    `json:"device_type" binding:"required"`
	MacAddress string `json:"mac_address" binding:"required"`
	LocationId int    `json:"location_id"`
	BuildingId int    `json:"building_id"`
	FloorId    int    `json:"floor_id"`
	RoomId     int    `json:"room_id"`
	Remark     string `json:"remark"`
}

type DeviceAddResponse

type DeviceAddResponse struct {
	common.Response
}

type DeviceGetListRequest

type DeviceGetListRequest struct {
	Limit      int `form:"limit" binding:"required"`
	Offset     int `form:"offset" binding:"required"`
	LocationId int `form:"location_id"`
	BuildingId int `form:"building_id"`
	FloorId    int `form:"floor_id"`
	RoomId     int `form:"room_id"`
}

type DeviceGetListResponse

type DeviceGetListResponse struct {
	common.Response
	Limmit int                  `json:"limit"`
	Offset int                  `json:"offset"`
	Count  int                  `json:"count"`
	Data   []models.DeviceModel `json:"data"`
}

type DeviceGetRequest

type DeviceGetRequest struct {
	DeviceId int `form:"device_id" binding:"required"`
}

type DeviceGetResponse

type DeviceGetResponse struct {
	common.Response
	Data models.DeviceModel `json:"data"`
}

type DeviceUpdateRequest

type DeviceUpdateRequest struct {
	Name       string `json:"name" binding:"required"`
	DeviceType int    `json:"device_type" binding:"required"`
	MacAddress string `json:"mac_address" binding:"required"`
	LocationId int    `json:"location_id"`
	BuildingId int    `json:"building_id"`
	FloorId    int    `json:"floor_id"`
	RoomId     int    `json:"room_id"`
	Remark     string `json:"remark"`
}

type DeviceUpdateResponse

type DeviceUpdateResponse struct {
	common.Response
}

type FloorAddRequest

type FloorAddRequest struct {
	Name       string `json:"name" binding:"required"`
	LocationId int    `json:"location_id" binding:"required"`
	BuildingId int    `json:"building_id" bidding:"required"`
	Remark     string `json:"remark"`
}

type FloorAddResponse

type FloorAddResponse struct {
	common.Response
}

type FloorGetListRequest

type FloorGetListRequest struct {
	Limit      int `form:"limit" binding:"required"`
	Offset     int `form:"offset" binding:"required"`
	LocationId int `form:"location_id"`
	BuildingId int `form:"building_id"`
}

type FloorGetListResponse

type FloorGetListResponse struct {
	common.Response
	Limmit int                 `json:"limit"`
	Offset int                 `json:"offset"`
	Count  int                 `json:"count"`
	Data   []models.FloorModel `json:"data"`
}

type FloorGetRequest

type FloorGetRequest struct {
	FloorId int `form:"floor_id" binding:"required"`
}

type FloorGetResponse

type FloorGetResponse struct {
	common.Response
	Data models.FloorModel `json:"data"`
}

type FloorUpdateRequest

type FloorUpdateRequest struct {
	Name       string `json:"name" binding:"required"`
	LocationId int    `json:"location_id" binding:"required"`
	BuildingId int    `json:"building_id" bidding:"required"`
	Remark     string `json:"remark"`
}

type FloorUpdateResponse

type FloorUpdateResponse struct {
	common.Response
}

type GpioInfo

type GpioInfo struct {
	GpioNumber int `json:"gpio_number" binding:"required"`
	GpioStatus int `json:"gpio_status" binding:"required"`
}

type IPUpdateRequest

type IPUpdateRequest struct {
	IpAddress  string `json:"ip_address" binding:"required"`
	MacAddress string `json:"mac_address" binding:"required"`
}

type IPUpdateResponse

type IPUpdateResponse struct {
	common.Response
}

type LocationAddRequest

type LocationAddRequest struct {
	Name     string `json:"name" binding:"required"`
	Location string `json:"location" binding:"required"`
	Remark   string `json:"remark"`
}

type LocationAddResponse

type LocationAddResponse struct {
	common.Response
}

type LocationGetListRequest

type LocationGetListRequest struct {
	Limit  int `form:"limit" binding:"required"`
	Offset int `form:"offset" binding:"required"`
}

type LocationGetRequest

type LocationGetRequest struct {
	LocationId int `form:"location_id" binding:"required"`
}

type LocationGetResponse

type LocationGetResponse struct {
	common.Response
	Data models.LocationModel `json:"data"`
}

type LocationUpdateRequest

type LocationUpdateRequest struct {
	Name     string `json:"name"`
	Location string `json:"location"`
	Remark   string `json:"remark"`
}

type LocationUpdateResponse

type LocationUpdateResponse struct {
	common.Response
}

type ProjectService

type ProjectService struct {
	common.BaseService
}

func NewServiceMgr

func NewServiceMgr(c *gin.Context) *ProjectService

func (*ProjectService) BuildingAdd

func (cps *ProjectService) BuildingAdd(req *BuildingAddRequest) *BuildingAddResponse

增加建筑

func (*ProjectService) BuildingGet

func (cps *ProjectService) BuildingGet(req *BuildingGetRequest) *BuildingGetResponse

获取单个建筑信息

func (*ProjectService) BuildingGetList

获取建筑列表

func (*ProjectService) BuildingUpdate

func (cps *ProjectService) BuildingUpdate(id string, req *BuildingUpdateRequest) *BuildingUpdateResponse

更新建筑信息

func (*ProjectService) DeviceAdd

func (cps *ProjectService) DeviceAdd(req *DeviceAddRequest) *DeviceAddResponse

func (*ProjectService) DeviceGet

func (cps *ProjectService) DeviceGet(req *DeviceGetRequest) *DeviceGetResponse

func (*ProjectService) DeviceGetList

func (cps *ProjectService) DeviceGetList(req *DeviceGetListRequest) *DeviceGetListResponse

func (*ProjectService) DeviceUpdate

func (cps *ProjectService) DeviceUpdate(id string, req *DeviceUpdateRequest) *DeviceUpdateResponse

func (*ProjectService) FloorAdd

func (cps *ProjectService) FloorAdd(req *FloorAddRequest) *FloorAddResponse

func (*ProjectService) FloorGet

func (cps *ProjectService) FloorGet(req *FloorGetRequest) *FloorGetResponse

func (*ProjectService) FloorGetList

func (cps *ProjectService) FloorGetList(req *FloorGetListRequest) *FloorGetListResponse

func (*ProjectService) FloorUpdate

func (cps *ProjectService) FloorUpdate(id string, req *FloorUpdateRequest) *FloorUpdateResponse

func (*ProjectService) IPUpdate

func (cps *ProjectService) IPUpdate(req *IPUpdateRequest) *IPUpdateResponse

func (*ProjectService) LocationAdd

func (cps *ProjectService) LocationAdd(req *LocationAddRequest) *LocationAddResponse

func (*ProjectService) LocationGet

func (cps *ProjectService) LocationGet(req *LocationGetRequest) *LocationGetResponse

func (*ProjectService) LocationGetList

func (cps *ProjectService) LocationGetList(req *LocationGetListRequest) *locationGetListResponse

func (*ProjectService) LocationUpdate

func (cps *ProjectService) LocationUpdate(id string, req *LocationUpdateRequest) *LocationUpdateResponse

func (*ProjectService) RoomAdd

func (cps *ProjectService) RoomAdd(req *RoomAddRequest) *RoomAddResponse

func (*ProjectService) RoomGet

func (cps *ProjectService) RoomGet(req *RoomGetRequest) *RoomGetResponse

func (*ProjectService) RoomGetList

func (cps *ProjectService) RoomGetList(req *RoomGetListRequest) *RoomGetListResponse

func (*ProjectService) RoomUpdate

func (cps *ProjectService) RoomUpdate(id string, req *RoomUpdateRequest) *RoomUpdateResponse

func (*ProjectService) SwitchUpdate

func (cps *ProjectService) SwitchUpdate(req *SwitchUpdateRequest) *SwitchUpdateResponse

func (*ProjectService) UserAdd

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

func (*ProjectService) UserGet

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

type RoomAddRequest

type RoomAddRequest struct {
	Name       string `json:"name" binding:"required"`
	LocationId int    `json:"location_id" binding:"required"`
	BuildingId int    `json:"building_id" bidding:"required"`
	FloorId    int    `json:"floor_id" binding:"required"`
	RoomType   int    `json:"room_type" binding:"required"`
	Remark     string `json:"remark"`
}

type RoomAddResponse

type RoomAddResponse struct {
	common.Response
}

type RoomGetListRequest

type RoomGetListRequest struct {
	Limit      int `form:"limit" binding:"required"`
	Offset     int `form:"offset" binding:"required"`
	LocationId int `form:"location_id"`
	BuildingId int `form:"building_id"`
	FloorId    int `form:"floor_id"`
	RoomType   int `form:"room_type"`
}

type RoomGetListResponse

type RoomGetListResponse struct {
	common.Response
	Limmit int                `json:"limit"`
	Offset int                `json:"offset"`
	Count  int                `json:"count"`
	Data   []models.RoomModel `json:"data"`
}

type RoomGetRequest

type RoomGetRequest struct {
	RoomId int `form:"room_id" binding:"required"`
}

type RoomGetResponse

type RoomGetResponse struct {
	common.Response
	Data models.RoomModel `json:"data"`
}

type RoomTypeAddRequest

type RoomTypeAddRequest struct {
	Name   string `json:"name" binding:"required"`
	Remark string `json:"remark"`
}

type RoomTypeGetListRequest

type RoomTypeGetListRequest struct {
	Limit  int `form:"limit" binding:"required"`
	Offset int `form:"offset" binding:"required"`
}

type RoomTypeGetRequest

type RoomTypeGetRequest struct {
	RoomId int `form:"room_id" binding:"required"`
}

type RoomTypeUpdateRequest

type RoomTypeUpdateRequest struct {
	Name   string `json:"name" binding:"required"`
	Remark string `json:"remark:`
}

type RoomUpdateRequest

type RoomUpdateRequest struct {
	Name       string `json:"name" binding:"required"`
	LocationId int    `json:"location_id" binding:"required"`
	BuildingId int    `json:"building_id" bidding:"required"`
	FloorId    int    `json:"floor_id" binding:"required"`
	RoomType   int    `json:"room_type" binding:"required"`
	Remark     string `json:"remark"`
}

type RoomUpdateResponse

type RoomUpdateResponse struct {
	common.Response
}

type SwitchUpdateRequest

type SwitchUpdateRequest struct {
	IpAddress  string     `json:"ip_address" binding:"required"`
	MacAddress string     `json:"mac_address" binding:"required"`
	GpioInfos  []GpioInfo `json:"gpio_infos" binding:"required"`
}

type SwitchUpdateResponse

type SwitchUpdateResponse struct {
	common.Response
}

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