package com.auto.clicker.autoclicker.room;

import androidx.room.Embedded;
import androidx.room.Relation;

import com.auto.clicker.autoclicker.room.entity.EventEntity;
import com.auto.clicker.autoclicker.room.entity.TouchPoint;
import com.auto.clicker.autoclicker.room.entity.Solution;

import java.util.List;

import com.google.gson.annotations.Expose; // 确保导入 @Expose

public class SolutionWithEventsAndPoints {
    @Embedded
    @Expose
    public Solution solution;

    @Relation(
            parentColumn = "solutionId",
            entityColumn = "solution_id",
            entity = EventEntity.class
    )
    @Expose
    public List<EventWithPoints> events;

    public static class EventWithPoints {
        @Embedded
        @Expose
        public EventEntity eventEntity;

        @Relation(
                parentColumn = "click_point_id",
                entityColumn = "pointId",
                entity = TouchPoint.class
        )
        @Expose
        public TouchPoint clickTouchPoint;

        @Relation(
                parentColumn = "slide_start_point_id",
                entityColumn = "pointId",
                entity = TouchPoint.class
        )
        @Expose
        public TouchPoint slideStartTouchPoint;

        @Relation(
                parentColumn = "slide_end_point_id",
                entityColumn = "pointId",
                entity = TouchPoint.class
        )
        @Expose
        public TouchPoint slideEndTouchPoint;
    }
}