Files
iotlcm/admin-svr/server/internal/logic/iot/simcardbatch/change/range.go
T

33 lines
1.0 KiB
Go

package change
import (
"context"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/batchimport"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/logic/iot/simcardbatch/common/cardsource"
)
const maxRangeRows = 100000
func BuildRangeRows(ctx context.Context, startIccid, endIccid, startMsisdn, endMsisdn, startImsi, endImsi string) ([]batchimport.Row, error) {
return cardsource.BuildRangeRows(ctx, cardsource.RangeConfig{
StartIccid: startIccid,
EndIccid: endIccid,
StartMsisdn: startMsisdn,
EndMsisdn: endMsisdn,
StartImsi: startImsi,
EndImsi: endImsi,
MaxRows: maxRangeRows,
EmptyMessage: "range change data is empty",
OverLimitMessage: "range change count cannot exceed %d",
CountMismatchMessage: "ICCID range count(%d), MSISDN range count(%d), IMSI range count(%d) must match",
}, func(rowNo int, iccid, msisdn, imsi string) *Row {
return &Row{
RowNo: rowNo,
Iccid: iccid,
Msisdn: msisdn,
Imsi: imsi,
}
})
}