
- 更新项目名称为 automated - 更新多个依赖包版本,包括 @cool-midway、@midwayjs、@langchain 等 - 更新作者信息为 lixin&liqiannan - 更新 TypeScript 版本至 5.5.4 - 添加 newman、prettier 等新依赖 - 优化 package.json 结构和格式
34 lines
945 B
TypeScript
34 lines
945 B
TypeScript
import { CoolController, BaseController } from '@cool-midway/core';
|
|
import { FlowInfoEntity } from '../../entity/info';
|
|
import { Body, Inject, Post } from '@midwayjs/core';
|
|
import { FlowInfoService } from '../../service/info';
|
|
|
|
/**
|
|
* 流程信息
|
|
*/
|
|
@CoolController({
|
|
api: ['add', 'delete', 'update', 'info', 'list', 'page'],
|
|
entity: FlowInfoEntity,
|
|
service: FlowInfoService,
|
|
pageQueryOp: {
|
|
keyWordLikeFields: ['a.name', 'a.label'],
|
|
where: ctx => {
|
|
const { flowId, isRelease } = ctx.request.body;
|
|
|
|
return [
|
|
[ 'a.id != :flowId', { flowId }, flowId ],
|
|
[ 'a.releaseTime is not null', {}, isRelease ]
|
|
]
|
|
}
|
|
},
|
|
})
|
|
export class AdminFlowInfoController extends BaseController {
|
|
@Inject()
|
|
flowInfoService: FlowInfoService;
|
|
|
|
@Post('/release', { summary: '发布流程' })
|
|
async release(@Body('flowId') flowId: number) {
|
|
return this.ok(await this.flowInfoService.release(flowId));
|
|
}
|
|
}
|