From 13637973784950bed0a11e89c43371ac4962bfd1 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 17 Apr 2026 17:31:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E5=85=A5=20Service=20?= =?UTF-8?q?=E5=92=8C=20Worker=20=E4=BC=A0=E9=80=92=20realname=5Fpolicy=20?= =?UTF-8?q?=E5=86=99=E5=85=A5=E8=B5=84=E4=BA=A7=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- internal/service/device_import/service.go | 11 ++++++----- internal/service/iot_card_import/service.go | 19 ++++++++++--------- internal/task/device_import.go | 19 ++++++++++--------- internal/task/iot_card_import.go | 1 + 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/internal/service/device_import/service.go b/internal/service/device_import/service.go index 1fb8c96..64ee08f 100644 --- a/internal/service/device_import/service.go +++ b/internal/service/device_import/service.go @@ -44,11 +44,12 @@ func (s *Service) CreateImportTask(ctx context.Context, req *dto.ImportDeviceReq fileName := filepath.Base(req.FileKey) task := &model.DeviceImportTask{ - TaskNo: taskNo, - Status: model.ImportTaskStatusPending, - BatchNo: req.BatchNo, - FileName: fileName, - StorageKey: req.FileKey, + TaskNo: taskNo, + Status: model.ImportTaskStatusPending, + BatchNo: req.BatchNo, + FileName: fileName, + StorageKey: req.FileKey, + RealnamePolicy: req.RealnamePolicy, } task.Creator = userID task.Updater = userID diff --git a/internal/service/iot_card_import/service.go b/internal/service/iot_card_import/service.go index 04070ca..2307890 100644 --- a/internal/service/iot_card_import/service.go +++ b/internal/service/iot_card_import/service.go @@ -76,15 +76,16 @@ func (s *Service) CreateImportTask(ctx context.Context, req *dto.ImportIotCardRe } task := &model.IotCardImportTask{ - TaskNo: taskNo, - Status: model.ImportTaskStatusPending, - CarrierID: req.CarrierID, - CarrierType: carrier.CarrierType, - CarrierName: carrier.CarrierName, - BatchNo: req.BatchNo, - FileName: fileName, - StorageKey: req.FileKey, - CardCategory: cardCategory, + TaskNo: taskNo, + Status: model.ImportTaskStatusPending, + CarrierID: req.CarrierID, + CarrierType: carrier.CarrierType, + CarrierName: carrier.CarrierName, + BatchNo: req.BatchNo, + FileName: fileName, + StorageKey: req.FileKey, + CardCategory: cardCategory, + RealnamePolicy: req.RealnamePolicy, } task.Creator = userID task.Updater = userID diff --git a/internal/task/device_import.go b/internal/task/device_import.go index 943bb01..18e4f0a 100644 --- a/internal/task/device_import.go +++ b/internal/task/device_import.go @@ -279,15 +279,16 @@ func (h *DeviceImportHandler) processBatch(ctx context.Context, task *model.Devi txIotCardStore := postgres.NewIotCardStore(tx, nil) device := &model.Device{ - VirtualNo: row.VirtualNo, - IMEI: row.IMEI, - DeviceName: row.DeviceName, - DeviceModel: row.DeviceModel, - DeviceType: row.DeviceType, - MaxSimSlots: row.MaxSimSlots, - Manufacturer: row.Manufacturer, - BatchNo: task.BatchNo, - Status: constants.DeviceStatusInStock, + VirtualNo: row.VirtualNo, + IMEI: row.IMEI, + DeviceName: row.DeviceName, + DeviceModel: row.DeviceModel, + DeviceType: row.DeviceType, + MaxSimSlots: row.MaxSimSlots, + Manufacturer: row.Manufacturer, + BatchNo: task.BatchNo, + Status: constants.DeviceStatusInStock, + RealnamePolicy: task.RealnamePolicy, } device.Creator = task.Creator device.Updater = task.Creator diff --git a/internal/task/iot_card_import.go b/internal/task/iot_card_import.go index 09b0be6..3910f1a 100644 --- a/internal/task/iot_card_import.go +++ b/internal/task/iot_card_import.go @@ -358,6 +358,7 @@ func (h *IotCardImportHandler) processBatch(ctx context.Context, task *model.Iot ActivationStatus: constants.ActivationStatusInactive, RealNameStatus: constants.RealNameStatusNotVerified, NetworkStatus: constants.NetworkStatusOffline, + RealnamePolicy: task.RealnamePolicy, } iotCard.BaseModel.Creator = task.Creator iotCard.BaseModel.Updater = task.Creator