chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
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/model/response"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) TSimWarningConfigExcelTemplate(ctx context.Context, req *v1.TSimWarningConfigExcelTemplateReq) (res *v1.TSimWarningConfigExcelTemplateRes, err error) {
|
||||
err = service.IotTSimWarningConfig().DownloadExcelTemplate(ctx, req.ItemType)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimWarningConfigEmailCode(ctx context.Context, req *v1.TSimWarningConfigEmailCodeReq) (res *v1.TSimWarningConfigEmailCodeRes, err error) {
|
||||
if err = service.IotTSimWarningConfig().SendEmailCode(ctx, &req.TSimWarningConfigEmailCodeParam); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimWarningConfigEmailCodeRes{}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimWarningConfigExcelSubmit(ctx context.Context, req *v1.TSimWarningConfigExcelSubmitReq) (res *v1.TSimWarningConfigExcelSubmitRes, err error) {
|
||||
data, err := service.IotTSimWarningConfig().SubmitExcel(ctx, &req.TSimWarningConfigExcelSubmitParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimWarningConfigExcelSubmitRes{TSimWarningConfigExcelSubmitRes: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimWarningConfigInputSubmit(ctx context.Context, req *v1.TSimWarningConfigInputSubmitReq) (res *v1.TSimWarningConfigInputSubmitRes, err error) {
|
||||
data, err := service.IotTSimWarningConfig().SubmitInput(ctx, &req.TSimWarningConfigInputSubmitParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimWarningConfigInputSubmitRes{TSimWarningConfigInputSubmitRes: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) TSimWarningConfigRangeSubmit(ctx context.Context, req *v1.TSimWarningConfigRangeSubmitReq) (res *v1.TSimWarningConfigRangeSubmitRes, err error) {
|
||||
data, err := service.IotTSimWarningConfig().SubmitRange(ctx, &req.TSimWarningConfigRangeSubmitParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.TSimWarningConfigRangeSubmitRes{TSimWarningConfigRangeSubmitRes: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) SimWarningConfigList(ctx context.Context, req *v1.SimWarningConfigListReq) (res *v1.SimWarningConfigListRes, err error) {
|
||||
list, totalCount, err := service.SimWarning().ConfigList(ctx, &req.SimWarningConfigListParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if list == nil {
|
||||
list = []*model.SimWarningConfigModel{}
|
||||
}
|
||||
return &v1.SimWarningConfigListRes{
|
||||
PageResult: response.PageResult{
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
Total: totalCount,
|
||||
},
|
||||
Items: list,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) SimWarningConfigView(ctx context.Context, req *v1.SimWarningConfigViewReq) (res *v1.SimWarningConfigViewRes, err error) {
|
||||
data, err := service.SimWarning().ConfigView(ctx, &req.SimWarningConfigViewParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.SimWarningConfigViewRes{SimWarningConfigModel: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) SimWarningConfigSave(ctx context.Context, req *v1.SimWarningConfigSaveReq) (res *v1.SimWarningConfigSaveRes, err error) {
|
||||
data, err := service.SimWarning().ConfigSave(ctx, &req.SimWarningConfigSaveParam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.SimWarningConfigSaveRes{SimWarningConfigSaveModel: data}, nil
|
||||
}
|
||||
|
||||
func (c *ControllerV1) SimWarningConfigStatus(ctx context.Context, req *v1.SimWarningConfigStatusReq) (res *v1.SimWarningConfigStatusRes, err error) {
|
||||
err = service.SimWarning().ConfigStatus(ctx, &req.SimWarningConfigStatusParam)
|
||||
return &v1.SimWarningConfigStatusRes{}, err
|
||||
}
|
||||
|
||||
func (c *ControllerV1) SimWarningConfigDelete(ctx context.Context, req *v1.SimWarningConfigDeleteReq) (res *v1.SimWarningConfigDeleteRes, err error) {
|
||||
err = service.SimWarning().ConfigDelete(ctx, &req.SimWarningConfigDeleteParam)
|
||||
return &v1.SimWarningConfigDeleteRes{}, err
|
||||
}
|
||||
Reference in New Issue
Block a user