chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package iot
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/iot/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) TSimCardAllocateExcelTemplate(ctx context.Context, req *v1.TSimCardAllocateExcelTemplateReq) (res *v1.TSimCardAllocateExcelTemplateRes, err error) {
|
||||
err = service.IotTSimCardAllocate().DownloadExcelTemplate(ctx)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimCardAllocateTargetList(ctx context.Context, req *v1.TSimCardAllocateTargetListReq) (res *v1.TSimCardAllocateTargetListRes, err error) {
|
||||
items, err := service.IotTSimCardAllocate().ListTargets(ctx, &req.TSimCardAllocateTargetListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimCardAllocateTargetListRes{Items: items, MaxInputRows: model.SimCardAllocateMaxInputRows}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimCardAllocateInputPrepare(ctx context.Context, req *v1.TSimCardAllocateInputPrepareReq) (res *v1.TSimCardAllocateInputPrepareRes, err error) {
|
||||
if err = req.ValidateInput(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data, err := service.IotTSimCardAllocate().PrepareInput(ctx, &req.TSimCardAllocatePrepareParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimCardAllocateInputPrepareRes{TSimCardAllocateBatchModel: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimCardAllocateExcelSubmit(ctx context.Context, req *v1.TSimCardAllocateExcelSubmitReq) (res *v1.TSimCardAllocateExcelSubmitRes, err error) {
|
||||
data, err := service.IotTSimCardAllocate().PrepareExcel(ctx, &req.TSimCardAllocateExcelSubmitParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimCardAllocateExcelSubmitRes{TSimCardAllocateBatchModel: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimCardAllocateBatchSubmit(ctx context.Context, req *v1.TSimCardAllocateBatchSubmitReq) (res *v1.TSimCardAllocateBatchSubmitRes, err error) {
|
||||
data, err := service.IotTSimCardAllocate().SubmitBatch(ctx, &req.TSimCardAllocateBatchSubmitParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimCardAllocateBatchSubmitRes{TSimCardAllocateBatchModel: data}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user