const makeId = require("../../util/makeId"); /** * @description 代码作业一次构建的基本信息 * @typedef {Object} BuildSerializerType * @property {number|string} id 代码作业一次构建的 id * @property {number|string} branchId 分支 id * @property {number} buildState 构建状态[0:"构建中",1:"构建成功",-1:"构建失败"] * @property {string} buildMessage 构建输出的信息 * @property {number|string} mirrorId 镜像 id (构建成功之后产生) * @property {string} commitMessage commit 信息 */ /** * @description 生成BuildSerializer * @returns {BuildSerializerType} */ module.exports = ({ id = makeId(), branchId = makeId(), mirrorId = makeId(), buildState = 0 }) => { return { id, branchId, buildState, buildMessage: "我是构建输出的信息信息信息", mirrorId, commitMessage: "我是 commit 信息信息信息" }; };