BuildSerializer.js 919 B

1234567891011121314151617181920212223242526272829303132
  1. const makeId = require("../../util/makeId");
  2. /**
  3. * @description 代码作业一次构建的基本信息
  4. * @typedef {Object} BuildSerializerType
  5. * @property {number|string} id 代码作业一次构建的 id
  6. * @property {number|string} branchId 分支 id
  7. * @property {number} buildState 构建状态[0:"构建中",1:"构建成功",-1:"构建失败"]
  8. * @property {string} buildMessage 构建输出的信息
  9. * @property {number|string} mirrorId 镜像 id (构建成功之后产生)
  10. * @property {string} commitMessage commit 信息
  11. */
  12. /**
  13. * @description 生成BuildSerializer
  14. * @returns {BuildSerializerType}
  15. */
  16. module.exports = ({
  17. id = makeId(),
  18. branchId = makeId(),
  19. mirrorId = makeId(),
  20. buildState = 0
  21. }) => {
  22. return {
  23. id,
  24. branchId,
  25. buildState,
  26. buildMessage: "我是构建输出的信息信息信息",
  27. mirrorId,
  28. commitMessage: "我是 commit 信息信息信息"
  29. };
  30. };