71 lines
3.0 KiB
Go
71 lines
3.0 KiB
Go
package iot
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/iot/v1"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
|
)
|
|
|
|
func (c *ControllerV1) TSimCardChangeExcelTemplate(ctx context.Context, req *v1.TSimCardChangeExcelTemplateReq) (res *v1.TSimCardChangeExcelTemplateRes, err error) {
|
|
err = service.IotTSimCardChange().DownloadExcelTemplate(ctx)
|
|
return nil, err
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangeExcelSubmit(ctx context.Context, req *v1.TSimCardChangeExcelSubmitReq) (res *v1.TSimCardChangeExcelSubmitRes, err error) {
|
|
data, err := service.IotTSimCardChange().SubmitExcel(ctx, &req.TSimCardChangeExcelSubmitParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangeExcelSubmitRes{TSimCardChangeExcelSubmitRes: data}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangeInputOptions(ctx context.Context, req *v1.TSimCardChangeInputOptionsReq) (res *v1.TSimCardChangeInputOptionsRes, err error) {
|
|
data, err := service.IotTSimCardChange().InputOptions(ctx, &req.TSimCardChangeInputOptionsParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangeInputOptionsRes{TSimCardChangeOptionsRes: data}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangeRangeOptions(ctx context.Context, req *v1.TSimCardChangeRangeOptionsReq) (res *v1.TSimCardChangeRangeOptionsRes, err error) {
|
|
data, err := service.IotTSimCardChange().RangeOptions(ctx, &req.TSimCardChangeRangeOptionsParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangeRangeOptionsRes{TSimCardChangeOptionsRes: data}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangeInputPrepare(ctx context.Context, req *v1.TSimCardChangeInputPrepareReq) (res *v1.TSimCardChangeInputPrepareRes, err error) {
|
|
data, err := service.IotTSimCardChange().PrepareInput(ctx, &req.TSimCardChangeInputPrepareParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangeInputPrepareRes{TSimCardChangeBatchPrepareRes: data}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangeRangePrepare(ctx context.Context, req *v1.TSimCardChangeRangePrepareReq) (res *v1.TSimCardChangeRangePrepareRes, err error) {
|
|
data, err := service.IotTSimCardChange().PrepareRange(ctx, &req.TSimCardChangeRangePrepareParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangeRangePrepareRes{TSimCardChangeBatchPrepareRes: data}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangeBatchSubmit(ctx context.Context, req *v1.TSimCardChangeBatchSubmitReq) (res *v1.TSimCardChangeBatchSubmitRes, err error) {
|
|
data, err := service.IotTSimCardChange().SubmitBatch(ctx, &req.TSimCardChangeBatchSubmitParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangeBatchSubmitRes{TSimCardChangeBatchSubmitRes: data}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardChangePrepareResult(ctx context.Context, req *v1.TSimCardChangePrepareResultReq) (res *v1.TSimCardChangePrepareResultRes, err error) {
|
|
data, err := service.IotTSimCardChange().PrepareResult(ctx, strings.TrimSpace(req.BatchNo))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.TSimCardChangePrepareResultRes{TSimCardChangePrepareResultRes: data}, nil
|
|
}
|