uint/uint64全部改为uint32

This commit is contained in:
2025-11-10 22:23:31 +08:00
parent 3e711551e7
commit ecd2d37c70
96 changed files with 775 additions and 785 deletions

View File

@@ -5,8 +5,8 @@ import "git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
// CreateDeviceRequest 定义了创建设备时需要传入的参数
type CreateDeviceRequest struct {
Name string `json:"name" validate:"required"`
DeviceTemplateID uint `json:"device_template_id" validate:"required"`
AreaControllerID uint `json:"area_controller_id" validate:"required"`
DeviceTemplateID uint32 `json:"device_template_id" validate:"required"`
AreaControllerID uint32 `json:"area_controller_id" validate:"required"`
Location string `json:"location,omitempty" validate:"omitempty"`
Properties map[string]interface{} `json:"properties,omitempty" validate:"omitempty"`
}
@@ -14,8 +14,8 @@ type CreateDeviceRequest struct {
// UpdateDeviceRequest 定义了更新设备时需要传入的参数
type UpdateDeviceRequest struct {
Name string `json:"name" validate:"required"`
DeviceTemplateID uint `json:"device_template_id" validate:"required"`
AreaControllerID uint `json:"area_controller_id" validate:"required"`
DeviceTemplateID uint32 `json:"device_template_id" validate:"required"`
AreaControllerID uint32 `json:"area_controller_id" validate:"required"`
Location string `json:"location,omitempty" validate:"omitempty"`
Properties map[string]interface{} `json:"properties,omitempty" validate:"omitempty"`
}
@@ -64,11 +64,11 @@ type UpdateDeviceTemplateRequest struct {
// DeviceResponse 定义了返回给客户端的单个设备信息的结构
type DeviceResponse struct {
ID uint `json:"id"`
ID uint32 `json:"id"`
Name string `json:"name"`
DeviceTemplateID uint `json:"device_template_id"`
DeviceTemplateID uint32 `json:"device_template_id"`
DeviceTemplateName string `json:"device_template_name"`
AreaControllerID uint `json:"area_controller_id"`
AreaControllerID uint32 `json:"area_controller_id"`
AreaControllerName string `json:"area_controller_name"`
Location string `json:"location"`
Properties map[string]interface{} `json:"properties"`
@@ -78,7 +78,7 @@ type DeviceResponse struct {
// AreaControllerResponse 定义了返回给客户端的单个区域主控信息的结构
type AreaControllerResponse struct {
ID uint `json:"id"`
ID uint32 `json:"id"`
Name string `json:"name"`
NetworkID string `json:"network_id"`
Location string `json:"location"`
@@ -90,7 +90,7 @@ type AreaControllerResponse struct {
// DeviceTemplateResponse 定义了返回给客户端的单个设备模板信息的结构
type DeviceTemplateResponse struct {
ID uint `json:"id"`
ID uint32 `json:"id"`
Name string `json:"name"`
Manufacturer string `json:"manufacturer"`
Description string `json:"description"`