feat: 新增客户用电回路全链路功能

新增客户用电回路表及相关数据库迁移、后端服务、控制器、DTO、实体类和权限配置;新增前端API封装,同时调整路由名称以匹配新业务模块,复用现有菜单权限避免403错误。
This commit is contained in:
andyesfly committed 2026-10-12 15:20:08 +08:00
1 parent 3596462eca
commit f72644c24f
12 files changed
+1975 -411

No files matched your search

@@ -0,0 +1,17 @@
import { Controller, Get, Post, Put, Del, Inject, Query, Body, Param } from "@midwayjs/core";
import { Context } from "@midwayjs/koa";
import { CustomerCircuitService } from "../service/customer_circuit.service";
@Controller("/api/customer-circuits")
export class CustomerCircuitController {
@Inject() ctx!: Context;
@Inject() customerCircuitService!: CustomerCircuitService;
@Get("/") async list(@Query() query: any) { return this.customerCircuitService.list(query, this.ctx); }
// 注意:静态路径 /topology 必须声明在 /:id 之前,避免被参数路由捕获
@Get("/topology") async topology(@Query() query: any) { return this.customerCircuitService.topology(query, this.ctx); }
@Get("/:id") async detail(@Param("id") id: string) { return this.customerCircuitService.detail(Number(id), this.ctx); }
@Post("/") async create(@Body() body: any) { return this.customerCircuitService.create(body, this.ctx); }
@Put("/:id") async update(@Param("id") id: string, @Body() body: any) { return this.customerCircuitService.update(Number(id), body, this.ctx); }
@Del("/:id") async delete(@Param("id") id: string) { return this.customerCircuitService.delete(Number(id), this.ctx); }
}