schangxiang@126.com
2025-09-09 3d8966ba2c81e7e0365c8b123e861d18ee4f94f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Controller } from "egg";
 
export default class HomeController extends Controller {
  public async index() {
    const { ctx } = this;
    try {
      // let connection = getConnection("default");
      // const posts = await connection
      //   .createQueryBuilder()
      //   .select("post.menu_Id", "id")
      //   .addSelect(
      //     "(case when exists(Select 1 from Sys_Menu sub Where sub.menu_Id=post.parentId) then 1 else 0 end)",
      //     "hasChild"
      //   )
      //   .from(SysMenu, "post")
      //   .where({
      //     menu_Id: In([1, 2, 3])
      //   })
      //   .getRawMany();
      // let module = await import("../entity/sys/core/sysDept");
      // var m = module["SysDept"];
      // let rep2 = getManager().getRepository(m);
      // let dataList2 = await rep2.find({
      //   take: 2
      // });
      // var userRep = getManager().getRepository(User);
      // let user = await userRep.find();
    } catch {}
 
    ctx.body = await ctx.service.test.sayHi("egg 333");
  }
}