package com.fs.qw.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
* 企微sop附件的消息内容
*/
@Data
public class QwSopCourseFinishTempSetting implements Serializable,Cloneable{

    //普通/课程/订单/ai
    private int type;

    //消息类型
    private Integer courseType;

    //课程
    private Integer courseId;
    //课节
    private Integer videoId;

    private List<Setting> setting;

    @Override
    public QwSopCourseFinishTempSetting clone() {
        try {
            QwSopCourseFinishTempSetting clone = (QwSopCourseFinishTempSetting) super.clone();
            // 深克隆 setting 列表
            if (this.setting != null) {
                clone.setting = new ArrayList<>();
                for (Setting originalSetting : this.setting) {
                    clone.setting.add(originalSetting.clone());
                }
            } else {
                clone.setting = new ArrayList<>();
            }
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }

    @Data
    public static class Setting implements Cloneable {
        /**
         * QwSopLog的主键(用于发送)
         */
        private Long sopLogId;
        /**
         * 员工的id(用于发送)
         */
        private String qwUserid;
        /**
         * 客户的id(用于发送)
         */
        private String externalUserId;
        //文本-图片-链接-小程序-文件-视频-语音-视频号-app
        private String contentType;
        //文本
        private String value;
        //图片
        private String imgUrl;

        /** 小程序appid */
        private String miniprogramAppid;

        /** 小程序消息标题 */
        private String miniprogramTitle;

        /** 小程序封面地址 */
        private String miniprogramPicUrl;


        /** 小程序page路径 */
        private String miniprogramPage;

        //链接标题
        private String linkTitle;
        //链接描述
        private String linkDescribe;
        //链接封面
        private String linkImageUrl;
        //链接地址
        private String linkUrl;
        //发送app消息的链接
        private String appLinkUrl;
        //文件地址
        private String fileUrl;
        //视频地址
        private String videoUrl;
        //语音地址
        private String voiceUrl;
        //时长
        private String voiceDuration;
        //是否绑定课程链接
        private String isBindUrl;
        //链接过期时间
        private Integer expiresDays;

        @Override
        public Setting clone() {
            try {
                Setting clone = (Setting) super.clone();
                clone.setValue(this.getValue());
                clone.setLinkUrl(this.getLinkUrl());
                clone.setAppLinkUrl(this.getAppLinkUrl());
                return clone;
            } catch (CloneNotSupportedException e) {
                throw new AssertionError();
            }
        }
    }

}


