mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-12 09:32:49 +00:00
Ai编码
This commit is contained in:
parent
338c43eea7
commit
0a419b038d
25
src/modules/base/controller/admin/coding.ts
Normal file
25
src/modules/base/controller/admin/coding.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { CoolController, BaseController, CoolTag, TagTypes } from '@cool-midway/core';
|
||||||
|
import { Body, Get, Inject, Post } from '@midwayjs/core';
|
||||||
|
import { BaseCodingService } from '../../service/coding';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ai编码
|
||||||
|
*/
|
||||||
|
@CoolController()
|
||||||
|
export class AdminCodingController extends BaseController {
|
||||||
|
@Inject()
|
||||||
|
baseCodingService: BaseCodingService;
|
||||||
|
|
||||||
|
@Get('/getModuleTree', { summary: '获取模块目录结构' })
|
||||||
|
async getModuleTree() {
|
||||||
|
return this.baseCodingService.getModuleTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('/createCode', { summary: '创建代码' })
|
||||||
|
async createCode(@Body() codes: {
|
||||||
|
path: string;
|
||||||
|
content: string;
|
||||||
|
}[]) {
|
||||||
|
return this.baseCodingService.createCode(codes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -28,7 +28,7 @@ export default () => {
|
|||||||
// 刷新token 过期时间,单位秒
|
// 刷新token 过期时间,单位秒
|
||||||
refreshExpire: 60 * 60 * 24 * 30,
|
refreshExpire: 60 * 60 * 24 * 30,
|
||||||
// jwt 秘钥
|
// jwt 秘钥
|
||||||
secret: 'cool-app-xxxxxx',
|
secret: 'f5f0adba-f2e2-4efd-aefb-adc562ebf3acx',
|
||||||
},
|
},
|
||||||
} as ModuleConfig;
|
} as ModuleConfig;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user