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

@@ -41,17 +41,17 @@ type Service interface {
// CreatePlan 创建一个新的计划
CreatePlan(ctx context.Context, plan *models.Plan) (*models.Plan, error)
// GetPlanByID 根据ID获取计划详情
GetPlanByID(ctx context.Context, id uint) (*models.Plan, error)
GetPlanByID(ctx context.Context, id uint32) (*models.Plan, error)
// ListPlans 获取计划列表,支持过滤和分页
ListPlans(ctx context.Context, opts repository.ListPlansOptions, page, pageSize int) ([]models.Plan, int64, error)
// UpdatePlan 更新计划, wantPlanType 表示期望被修改的计划是什么类型
UpdatePlan(ctx context.Context, plan *models.Plan, wantPlanType models.PlanType) (*models.Plan, error)
// DeletePlan 删除计划(软删除)
DeletePlan(ctx context.Context, id uint) error
DeletePlan(ctx context.Context, id uint32) error
// StartPlan 启动计划
StartPlan(ctx context.Context, id uint) error
StartPlan(ctx context.Context, id uint32) error
// StopPlan 停止计划
StopPlan(ctx context.Context, id uint) error
StopPlan(ctx context.Context, id uint32) error
}
// planServiceImpl 是 Service 接口的具体实现。
@@ -150,7 +150,7 @@ func (s *planServiceImpl) CreatePlan(ctx context.Context, planToCreate *models.P
// 优化无需查询完整的设备对象只需构建包含ID的结构体即可建立关联
devices := make([]models.Device, len(deviceIDs))
for i, id := range deviceIDs {
devices[i] = models.Device{Model: gorm.Model{ID: id}}
devices[i] = models.Device{Model: models.Model{ID: id}}
}
taskModel.Devices = devices
}
@@ -174,7 +174,7 @@ func (s *planServiceImpl) CreatePlan(ctx context.Context, planToCreate *models.P
}
// GetPlanByID 根据ID获取计划详情
func (s *planServiceImpl) GetPlanByID(ctx context.Context, id uint) (*models.Plan, error) {
func (s *planServiceImpl) GetPlanByID(ctx context.Context, id uint32) (*models.Plan, error) {
planCtx, logger := logs.Trace(ctx, s.ctx, "GetPlanByID")
const actionType = "领域层:获取计划详情"
@@ -262,7 +262,7 @@ func (s *planServiceImpl) UpdatePlan(ctx context.Context, planToUpdate *models.P
// 优化无需查询完整的设备对象只需构建包含ID的结构体即可建立关联
devices := make([]models.Device, len(deviceIDs))
for i, id := range deviceIDs {
devices[i] = models.Device{Model: gorm.Model{ID: id}}
devices[i] = models.Device{Model: models.Model{ID: id}}
}
taskModel.Devices = devices
}
@@ -290,7 +290,7 @@ func (s *planServiceImpl) UpdatePlan(ctx context.Context, planToUpdate *models.P
}
// DeletePlan 删除计划(软删除)
func (s *planServiceImpl) DeletePlan(ctx context.Context, id uint) error {
func (s *planServiceImpl) DeletePlan(ctx context.Context, id uint32) error {
planCtx, logger := logs.Trace(ctx, s.ctx, "DeletePlan")
const actionType = "领域层:删除计划"
@@ -328,7 +328,7 @@ func (s *planServiceImpl) DeletePlan(ctx context.Context, id uint) error {
}
// StartPlan 启动计划
func (s *planServiceImpl) StartPlan(ctx context.Context, id uint) error {
func (s *planServiceImpl) StartPlan(ctx context.Context, id uint32) error {
planCtx, logger := logs.Trace(ctx, s.ctx, "StartPlan")
const actionType = "领域层:启动计划"
@@ -383,7 +383,7 @@ func (s *planServiceImpl) StartPlan(ctx context.Context, id uint) error {
}
// StopPlan 停止计划
func (s *planServiceImpl) StopPlan(ctx context.Context, id uint) error {
func (s *planServiceImpl) StopPlan(ctx context.Context, id uint32) error {
planCtx, logger := logs.Trace(ctx, s.ctx, "StopPlan")
const actionType = "领域层:停止计划"