package com.emotion.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.emotion.common.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Map;

/**
 * 爽文剧本实体类
 * 存储用户生成的爽文剧本，包括主题、风格、剧情章节等
 *
 * @author huazhongmin
 * @date 2025-12-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "t_epic_script", autoResultMap = true)
public class EpicScript extends BaseEntity {

    /**
     * 用户ID (关联t_user.id)
     */
    @TableField("user_id")
    private String userId;

    /**
     * 剧本标题
     */
    @TableField("title")
    private String title;

    /**
     * 剧本主题/渴望
     */
    @TableField("theme")
    private String theme;

    /**
     * 剧本风格: career-职场逆袭, love-情感圆满, fantasy-玄幻觉醒
     */
    @TableField("style")
    private String style;

    /**
     * 篇幅长度: medium-标准篇, long-长篇
     */
    @TableField("length")
    private String length;

    /**
     * 序幕：低谷回响
     */
    @TableField("plot_intro")
    private String plotIntro;

    /**
     * 转折：契机出现
     */
    @TableField("plot_turning")
    private String plotTurning;

    /**
     * 高潮：命运抉择
     */
    @TableField("plot_climax")
    private String plotClimax;

    /**
     * 结局：新的开始
     */
    @TableField("plot_ending")
    private String plotEnding;

    /**
     * 完整剧情JSON结构
     */
    @TableField(value = "plot_json", typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> plotJson;

    /**
     * 是否当前选中: 0-否, 1-是
     */
    @TableField("is_selected")
    private Integer isSelected;
}
