Files
planka/server/api/models/BackgroundImage.js

107 lines
3.3 KiB
JavaScript
Raw Normal View History

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
2019-08-31 04:07:25 +05:00
/**
* BackgroundImage.js
2019-08-31 04:07:25 +05:00
*
* @description :: A model definition represents a database table/collection.
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
*/
2025-09-08 16:20:27 +02:00
/**
* @swagger
* components:
* schemas:
* BackgroundImage:
* type: object
* required:
2025-09-08 23:40:36 +02:00
* - id
2025-09-08 16:20:27 +02:00
* - projectId
* - size
* - url
* - thumbnailUrls
2025-09-12 12:17:01 +02:00
* - createdAt
* - updatedAt
2025-09-08 16:20:27 +02:00
* properties:
* id:
* type: string
* description: Unique identifier for the background image
2025-09-08 19:14:31 +02:00
* example: "1357158568008091264"
2025-09-08 16:20:27 +02:00
* projectId:
* type: string
* description: ID of the project the background image belongs to
2025-09-08 19:14:31 +02:00
* example: "1357158568008091265"
2025-09-08 16:20:27 +02:00
* size:
* type: string
* description: File size of the background image in bytes
* example: 1024576
* url:
* type: string
* format: uri
* description: URL to access the full-size background image
* example: https://storage.example.com/background-images/1357158568008091264/original.jpg
* thumbnailUrls:
* type: object
* required:
* - outside360
* description: URLs for different thumbnail sizes of the background image
* properties:
* outside360:
* type: string
* format: uri
* description: URL for 360px thumbnail version
* example: https://storage.example.com/background-images/1357158568008091264/outside-360.jpg
* createdAt:
* type: string
* format: date-time
* nullable: true
* description: When the background image was created
* example: 2024-01-01T00:00:00.000Z
* updatedAt:
* type: string
* format: date-time
* nullable: true
* description: When the background image was last updated
* example: 2024-01-01T00:00:00.000Z
*/
2019-08-31 04:07:25 +05:00
module.exports = {
attributes: {
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
extension: {
type: 'string',
2019-08-31 04:07:25 +05:00
required: true,
},
2025-08-23 00:03:20 +02:00
size: {
type: 'string',
2019-08-31 04:07:25 +05:00
required: true,
},
2019-08-31 04:07:25 +05:00
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
2025-08-23 00:03:20 +02:00
uploadedFileId: {
model: 'UploadedFile',
required: true,
columnName: 'uploaded_file_id',
},
projectId: {
model: 'Project',
required: true,
columnName: 'project_id',
},
2019-08-31 04:07:25 +05:00
},
tableName: 'background_image',
2019-08-31 04:07:25 +05:00
};