dao

package
v0.0.0-...-4c45443 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	CreatedAt time.Time `gorm:"not null"`
	CreatedBy string    `gorm:"not null"`
	UpdatedAt *time.Time
	UpdatedBy *string
}

type BaseModelSoftDeleted

type BaseModelSoftDeleted struct {
	CreatedAt time.Time `gorm:"not null"`
	CreatedBy string    `gorm:"not null"`
	UpdatedAt *time.Time
	UpdatedBy *string
	DeletedAt *time.Time
	DeletedBy *string
	IsDeleted bool
}

type GroupSensor

type GroupSensor struct {
	GroupLabel string `gorm:"not null"`
	GroupTh    uint32 `gorm:"not null"`
	NodeID     uint64 `gorm:"not null"`
}

func (GroupSensor) TableName

func (GroupSensor) TableName() string

type GroupSensors

type GroupSensors []GroupSensor

type Node

type Node struct {
	ID       uint64 `gorm:"PRIMARY_KEY"`
	Type     string `gorm:"not null"`
	Label    string `gorm:"not null"`
	Token    string `gorm:"not null"`
	Location *string
	BaseModelSoftDeleted
}

func NewNodeFromCreateDTO

func NewNodeFromCreateDTO(r nodeDTO.CreateDTO) Node

func (Node) TableName

func (Node) TableName() string

func (Node) ToResponseDTO

func (n Node) ToResponseDTO() nodeDTO.ResponseDTO

type NodeSensor

type NodeSensor struct {
	ID          uint64 `gorm:"PRIMARY_KEY"`
	Code        string `gorm:"not null"`
	Description string
	Category    string `gorm:"not null"`
	Unit        string `gorm:"not null"`
	GroupLabel  string `gorm:"not null"`
	GroupTh     uint32 `gorm:"not null"`
	NodeID      uint64 `gorm:"not null"`
	IsActive    bool   `gorm:"not null"`
	BaseModelSoftDeleted
}

func NewSensorFromCreateDTO

func NewSensorFromCreateDTO(c nodeSensorDTO.CreateDTO, groupTh uint32) NodeSensor

func (*NodeSensor) BeforeCreate

func (ns *NodeSensor) BeforeCreate(tx *gorm.DB) error

func (NodeSensor) TableName

func (NodeSensor) TableName() string

func (NodeSensor) ToResponseDTO

func (ns NodeSensor) ToResponseDTO() nodeSensorDTO.ResponseDTO

type NodeSensors

type NodeSensors []NodeSensor

func (NodeSensors) TableName

func (NodeSensors) TableName() string

func (NodeSensors) ToResponsesDTO

func (nss NodeSensors) ToResponsesDTO() []nodeSensorDTO.ResponseDTO

type Nodes

type Nodes []Node

func (Nodes) Len

func (ns Nodes) Len() int

func (Nodes) ToResponsesDTO

func (ns Nodes) ToResponsesDTO() []nodeDTO.ResponseDTO

type SensorData

type SensorData struct {
	ID         uint64    `gorm:"PRIMARY_KEY"`
	NodeID     uint64    `gorm:"not null"`
	NodeLabel  string    `gorm:"not null"`
	Code       string    `gorm:"not null"`
	Category   string    `gorm:"not null"`
	Value      float64   `gorm:"not null"`
	Unit       string    `gorm:"not null"`
	GroupLabel string    `gorm:"not null"`
	GroupTh    uint32    `gorm:"not null"`
	Timestamp  time.Time `gorm:"not null"`
	BaseModel
}

func NewFromCreateDTO

func NewFromCreateDTO(s sensorDataDTO.CreateDTO) SensorData

func (SensorData) TableName

func (SensorData) TableName() string

func (SensorData) ToResponseDTO

func (s SensorData) ToResponseDTO() sensorDataDTO.ResponseDTO

type SensorDataList

type SensorDataList []SensorData

func NewFromCreatesDTO

func NewFromCreatesDTO(ss []sensorDataDTO.CreateDTO) SensorDataList

func (SensorDataList) Len

func (sdl SensorDataList) Len() int

func (SensorDataList) ToResponsesDTO

func (sdl SensorDataList) ToResponsesDTO() []sensorDataDTO.ResponseDTO

type User

type User struct {
	ID        uint64    `gorm:"primaryKey;autoIncrement"`
	Username  string    `gorm:"not null"`
	Password  string    `gorm:"not null"`
	CreatedAt time.Time `gorm:"not null"`
	CreatedBy string    `gorm:"not null"`
	UpdatedAt *time.Time
	UpdatedBy *string
}

func NewUserFromCreateDTO

func NewUserFromCreateDTO(sur userDTO.CreateDTO) User

func (User) TableName

func (User) TableName() string

func (User) ToResponseDTO

func (u User) ToResponseDTO() userDTO.ResponseDTO

func (User) ToTokenResponseDTO

func (u User) ToTokenResponseDTO(token string) userDTO.TokenResponseDTO

Jump to

Keyboard shortcuts

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