chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
// Package iot
|
||||
// @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 common
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/common/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) TDivisionCodeList(ctx context.Context, req *v1.TDivisionCodeListReq) (res *v1.TDivisionCodeListRes, err error) {
|
||||
list, totalCount, err := service.IotTDivisionCode().List(ctx, &req.TDivisionCodeListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*model.TDivisionCodeListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.TDivisionCodeListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
// Export 导出村级行政区划表列表
|
||||
func (c *ControllerV1) TDivisionCodeExport(ctx context.Context, req *v1.TDivisionCodeExportReq) (res *v1.TDivisionCodeExportRes, err error) {
|
||||
err = service.IotTDivisionCode().Export(ctx, &req.TDivisionCodeListParam)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新村级行政区划表
|
||||
func (c *ControllerV1) TDivisionCodeEdit(ctx context.Context, req *v1.TDivisionCodeEditReq) (res *v1.TDivisionCodeEditRes, err error) {
|
||||
err = service.IotTDivisionCode().Edit(ctx, &req.TDivisionCodeEditParam)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定村级行政区划表信息
|
||||
func (c *ControllerV1) TDivisionCodeView(ctx context.Context, req *v1.TDivisionCodeViewReq) (res *v1.TDivisionCodeViewRes, err error) {
|
||||
data, err := service.IotTDivisionCode().View(ctx, &req.TDivisionCodeViewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.TDivisionCodeViewRes)
|
||||
res.TDivisionCodeViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除村级行政区划表
|
||||
func (c *ControllerV1) TDivisionCodeDelete(ctx context.Context, req *v1.TDivisionCodeDeleteReq) (res *v1.TDivisionCodeDeleteRes, err error) {
|
||||
err = service.IotTDivisionCode().Delete(ctx, &req.TDivisionCodeDeleteParam)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user