113 lines
4.2 KiB
Go
113 lines
4.2 KiB
Go
// Package gen
|
|
// @Link https://github.com/xiujiecn/xiu-admin
|
|
// @Copyright Copyright (c) 2026 LiXiujie
|
|
// @Author Lxj <xxx@example.com>
|
|
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
|
|
// @AutoGenerate Version
|
|
package iot
|
|
|
|
import (
|
|
"context"
|
|
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/iot/v1"
|
|
iotin "git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
|
)
|
|
|
|
// List 查看SIM流量套餐管理列表
|
|
func (c *ControllerV1) TSimFlowPackageInfoList(ctx context.Context, req *v1.TSimFlowPackageInfoListReq) (res *v1.TSimFlowPackageInfoListRes, err error) {
|
|
list, totalCount, err := service.IotTSimFlowPackageInfo().List(ctx, &req.TSimFlowPackageInfoListParam)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
if list == nil {
|
|
list = []*iotin.TSimFlowPackageInfoListModel{}
|
|
}
|
|
|
|
res = new(v1.TSimFlowPackageInfoListRes)
|
|
res.Items = list
|
|
res.PageResult.Page = req.Page
|
|
res.PageResult.PageSize = req.PageSize
|
|
res.PageResult.Total = totalCount
|
|
return
|
|
}
|
|
|
|
// Export 导出SIM流量套餐管理列表
|
|
func (c *ControllerV1) TSimFlowPackageInfoExport(ctx context.Context, req *v1.TSimFlowPackageInfoExportReq) (res *v1.TSimFlowPackageInfoExportRes, err error) {
|
|
err = service.IotTSimFlowPackageInfo().Export(ctx, &req.TSimFlowPackageInfoListParam)
|
|
return
|
|
}
|
|
|
|
// Edit 更新SIM流量套餐管理
|
|
func (c *ControllerV1) TSimFlowPackageInfoEdit(ctx context.Context, req *v1.TSimFlowPackageInfoEditReq) (res *v1.TSimFlowPackageInfoEditRes, err error) {
|
|
err = service.IotTSimFlowPackageInfo().Edit(ctx, &req.TSimFlowPackageInfoEditParam)
|
|
return
|
|
}
|
|
|
|
// View 获取指定SIM流量套餐管理信息
|
|
func (c *ControllerV1) TSimFlowPackageInfoView(ctx context.Context, req *v1.TSimFlowPackageInfoViewReq) (res *v1.TSimFlowPackageInfoViewRes, err error) {
|
|
data, err := service.IotTSimFlowPackageInfo().View(ctx, &req.TSimFlowPackageInfoViewParam)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
res = new(v1.TSimFlowPackageInfoViewRes)
|
|
res.TSimFlowPackageInfoViewModel = data
|
|
return
|
|
}
|
|
|
|
// Delete 删除SIM流量套餐管理
|
|
func (c *ControllerV1) TSimFlowPackageInfoDelete(ctx context.Context, req *v1.TSimFlowPackageInfoDeleteReq) (res *v1.TSimFlowPackageInfoDeleteRes, err error) {
|
|
err = service.IotTSimFlowPackageInfo().Delete(ctx, &req.TSimFlowPackageInfoDeleteParam)
|
|
return
|
|
}
|
|
|
|
func (c *ControllerV1) TSimFlowPackageInfoSyncDeptPackages(ctx context.Context, req *v1.TSimFlowPackageInfoSyncDeptPackagesReq) (res *v1.TSimFlowPackageInfoSyncDeptPackagesRes, err error) {
|
|
err = service.IotTSimFlowPackageInfo().SyncDeptPackages(ctx)
|
|
return
|
|
}
|
|
|
|
func (c *ControllerV1) TSimFlowPackageInfoFlowPackageList(ctx context.Context, req *v1.TSimFlowPackageInfoFlowPackageListReq) (res *v1.TSimFlowPackageInfoFlowPackageListRes, err error) {
|
|
list, err := service.IotTSimFlowPackageInfo().FlowPackageList(ctx, &req.TSimFlowPackageInfoFlowPackageListParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
res = &v1.TSimFlowPackageInfoFlowPackageListRes{
|
|
Items: list,
|
|
}
|
|
return
|
|
}
|
|
|
|
func (c *ControllerV1) TSimFlowPackageInfoFlowPackageAddList(ctx context.Context, req *v1.TSimFlowPackageInfoFlowPackageAddListReq) (res *v1.TSimFlowPackageInfoFlowPackageAddListRes, err error) {
|
|
list, err := service.IotTSimFlowPackageInfo().FlowPackageAddList(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
res = &v1.TSimFlowPackageInfoFlowPackageAddListRes{
|
|
Items: list,
|
|
}
|
|
return
|
|
}
|
|
|
|
func (c *ControllerV1) TSimFlowPackageInfoRenewablePackageOptions(ctx context.Context, req *v1.TSimFlowPackageInfoRenewablePackageOptionsReq) (res *v1.TSimFlowPackageInfoRenewablePackageOptionsRes, err error) {
|
|
list, err := service.IotTSimFlowPackageInfo().RenewablePackageOptions(ctx, &req.TSimFlowPackageInfoRenewablePackageOptionsParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
res = &v1.TSimFlowPackageInfoRenewablePackageOptionsRes{
|
|
Items: list,
|
|
}
|
|
return
|
|
}
|
|
|
|
func (c *ControllerV1) TSimFlowPackageInfoGetFlowPackageOptions(ctx context.Context, req *v1.TSimFlowPackageInfoGetFlowPackageOptionsReq) (res *v1.TSimFlowPackageInfoGetFlowPackageOptionsRes, err error) {
|
|
items, err := service.IotTSimFlowPackageInfo().GetFlowPackageOptions(ctx, &req.TSimFlowPackageInfoFlowPackageOptionsParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
res = &v1.TSimFlowPackageInfoGetFlowPackageOptionsRes{
|
|
Items: items,
|
|
}
|
|
return
|
|
}
|