automated_api/src/modules/flow/controller/admin/info.ts
lixin 0afa56d652 build(automated): 更新项目依赖并调整配置
- 更新项目名称为 automated
- 更新多个依赖包版本,包括 @cool-midway、@midwayjs、@langchain 等
- 更新作者信息为 lixin&liqiannan
- 更新 TypeScript 版本至 5.5.4
- 添加 newman、prettier 等新依赖
- 优化 package.json 结构和格式
2025-01-09 17:58:04 +08:00

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));
}
}