67 lines
2.0 KiB
C#
67 lines
2.0 KiB
C#
using Manager.DTOs;
|
|
using ManagerService.DTOs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
|
|
|
|
namespace ManagerService.Data.SubSection
|
|
{
|
|
/// <summary>
|
|
/// Section puzzle
|
|
/// </summary>
|
|
public class SectionPuzzle : Section
|
|
{
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> PuzzleMessageDebut { get; set; }
|
|
|
|
[Required]
|
|
[Column(TypeName = "jsonb")]
|
|
public List<TranslationAndResourceDTO> PuzzleMessageFin { get; set; }
|
|
|
|
public string PuzzleImageId { get; set; } // But only image is possible
|
|
public Resource PuzzleImage { get; set; } // But only image is possible
|
|
|
|
[Required]
|
|
public int PuzzleRows { get; set; } = 3;
|
|
|
|
[Required]
|
|
public int PuzzleCols { get; set; } = 3;
|
|
|
|
|
|
public PuzzleDTO ToDTO()
|
|
{
|
|
return new PuzzleDTO()
|
|
{
|
|
id = Id,
|
|
label = Label,
|
|
title = Title.ToList(),
|
|
description = Description.ToList(),
|
|
order = Order,
|
|
type = Type,
|
|
imageId = ImageId,
|
|
imageSource = ImageSource,
|
|
configurationId = ConfigurationId,
|
|
isSubSection = IsSubSection,
|
|
parentId = ParentId,
|
|
dateCreation = DateCreation,
|
|
instanceId = InstanceId,
|
|
isBeacon = IsBeacon,
|
|
beaconId = BeaconId,
|
|
latitude = Latitude,
|
|
longitude = Longitude,
|
|
meterZoneGPS = MeterZoneGPS,
|
|
messageDebut = PuzzleMessageDebut,
|
|
messageFin = PuzzleMessageFin,
|
|
puzzleImage = PuzzleImage.ToDTO(),
|
|
puzzleImageId = PuzzleImageId,
|
|
rows = PuzzleRows,
|
|
cols = PuzzleCols
|
|
};
|
|
}
|
|
}
|
|
}
|