| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- const makeId = require("../../util/makeId");
- const buildSerializer = require("../codehw/BuildSerializer");
- const unitTestSerializer = require("../codehw/UnitTestSerializer");
- /**
- * @description 代码作业项目的基本信息
- * @typedef {Object} ProjectSerializerType
- * @property {number} id 代码作业项目 id
- * @property {number} codeId 代码作业 id
- * @property {string} url 项目 git 地址
- * @property {string} name 项目名称
- * @property {BuildSerializerType[]} buildList 构建 list
- * @property {DeploySerializerType[]} deployList 部署 list
- * @property {UnitTestSerializerType[]} unitTestList 单元测试 list
- * @property {FunctionalTestSerializerType[]} functionTestList 页面功能测试 list
- */
- /**
- * @description 生成ProjectSerializerType
- * @returns {ProjectSerializerType}
- */
- module.exports = ({ id = makeId(), codeId = makeId() }) => {
- return {
- id,
- codeId,
- url: "www.url.com/xiaobai/handsome/smart/dl",
- name: "project-name",
- buildList: [
- buildSerializer({ buildState: 0 }),
- buildSerializer({ buildState: 1 }),
- buildSerializer({ buildState: -1 })
- ],
- dlTestList: [
- unitTestSerializer({}),
- unitTestSerializer({}),
- unitTestSerializer({}),
- unitTestSerializer({})
- ],
- config: {},
- pageUrl: "www.pageUrl.com/xiaobai/handsome/smart/dl"
- };
- };
|