/** * @description 提交 * @throws Exception code * DIM_PK_LOGIC_ILLEGAL: Dimension主键的计算逻辑有误 * DIM_PUBLISH_OBJECT_NOT_FOUND: 需要发布的Dimension未找到 * DIM_UPDATE_STATUS_FAILED: 更新Dimension状态失败, * DIM_PUBLISH_SERVICE_ERROR: Dimension发布失败 * @p1-test * projectId: 项目不存在的id /null * id: Dimensionid不存在 /null * user: 当前用户没有更新Dimension的权限 * @p2-test * DIM_PK_LOGIC_ILLEGAL: Dimension主键的计算逻辑有误, 请求one-service校验主键逻辑失败 * DIM_PUBLISH_OBJECT_NOT_FOUND: 需要发布的Dimension未找到 * DIM_UPDATE_STATUS_FAILED: 更新Dimension状态失败, 操作数据库失败 * DIM_PUBLISH_SERVICE_ERROR: Dimension发布失败, 请求智能黑盒失败 */ import { getUrl } from 'src/utils/getUrl'; import Request from 'src/utils/requests'; import * as defs from '../../baseClass'; export class Params { /** id */ id?: number; /** projectId */ projectId: number; /** lock */ lock: number; /** Dimension名 */ name: string; /** 提交备注 */ submitComment: string; } export const init = undefined; export async function request(params = {}) { return Request({ url: '/api/dim/{id}/submit', params, method: 'put', }); } export function createFetchAction(types, stateKey) { return (params = {}, meta?: any) => { return { types, meta, stateKey, method: 'PUT', url: getUrl('/api/dim/{id}/submit', params, 'PUT'), params, init, }; }; }