chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
// 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"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
// List 查看通道模板列表
|
||||
func (c *ControllerV1) TSimChannelTemplateList(ctx context.Context, req *v1.TSimChannelTemplateListReq) (res *v1.TSimChannelTemplateListRes, err error) {
|
||||
list, totalCount, err := service.IotTSimChannelTemplate().List(ctx, &req.TSimChannelTemplateListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*model.TSimChannelTemplateListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.TSimChannelTemplateListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出通道模板列表
|
||||
func (c *ControllerV1) TSimChannelTemplateExport(ctx context.Context, req *v1.TSimChannelTemplateExportReq) (res *v1.TSimChannelTemplateExportRes, err error) {
|
||||
err = service.IotTSimChannelTemplate().Export(ctx, &req.TSimChannelTemplateListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新通道模板
|
||||
func (c *ControllerV1) TSimChannelTemplateEdit(ctx context.Context, req *v1.TSimChannelTemplateEditReq) (res *v1.TSimChannelTemplateEditRes, err error) {
|
||||
err = service.IotTSimChannelTemplate().Edit(ctx, &req.TSimChannelTemplateEditParam)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定通道模板信息
|
||||
func (c *ControllerV1) TSimChannelTemplateView(ctx context.Context, req *v1.TSimChannelTemplateViewReq) (res *v1.TSimChannelTemplateViewRes, err error) {
|
||||
data, err := service.IotTSimChannelTemplate().View(ctx, &req.TSimChannelTemplateViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.TSimChannelTemplateViewRes)
|
||||
res.TSimChannelTemplateViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除通道模板
|
||||
func (c *ControllerV1) TSimChannelTemplateDelete(ctx context.Context, req *v1.TSimChannelTemplateDeleteReq) (res *v1.TSimChannelTemplateDeleteRes, err error) {
|
||||
err = service.IotTSimChannelTemplate().Delete(ctx, &req.TSimChannelTemplateDeleteParam)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user