FileSerializer.js 577 B

12345678910111213141516171819202122
  1. const makeId = require("../util/makeId");
  2. /**
  3. * @description 文件基本信息
  4. * @typedef {Object} FileSerializerType
  5. * @property {string} filename 文件名
  6. * @property {string} content 文件内容
  7. * @property {number} size 文件大小
  8. * @property {number} uploader 上传者ID
  9. */
  10. /**
  11. * @description 生成文件基本信息
  12. * @returns {FileSerializerType}
  13. */
  14. module.exports = () => {
  15. return {
  16. filename: "第一次代码作业需求描述",
  17. content: "这里是第一次代码作业的描述bulabulabulala",
  18. size: 20,
  19. uploader: makeId()
  20. };
  21. };