32 lines
1.0 KiB
Go
32 lines
1.0 KiB
Go
package iot
|
|
|
|
import (
|
|
"context"
|
|
|
|
v1 "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) TSimCardCancellationList(ctx context.Context, req *v1.TSimCardCancellationListReq) (res *v1.TSimCardCancellationListRes, err error) {
|
|
list, total, err := service.IotTSimCardCancellation().List(ctx, &req.TSimCardCancellationListParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if list == nil {
|
|
list = []*model.TSimCardCancellationListModel{}
|
|
}
|
|
res = &v1.TSimCardCancellationListRes{Items: list}
|
|
res.Page = req.Page
|
|
res.PageSize = req.PageSize
|
|
res.Total = total
|
|
return res, nil
|
|
}
|
|
|
|
func (c *ControllerV1) TSimCardCancellationExport(ctx context.Context, req *v1.TSimCardCancellationExportReq) (res *v1.TSimCardCancellationExportRes, err error) {
|
|
if err = service.IotTSimCardCancellation().Export(ctx, &req.TSimCardCancellationFilter); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, nil
|
|
}
|