using System; using System.Collections.Generic; using System.Runtime.Serialization; using StreamBox.Lib.Server.Codes; using StreamBox.Lib.Server.Utils; using StreamBox.Lib.Server.Record.Site; using StreamBox.Lib.Server.Record.Live; namespace StreamBox.Lib.Server.Linkage { #region ---- Parts ---- [Flags] public enum LiveServiceOption { None = 0, AllowProfileImage = 1, AllowScreenRecording = 2, AllowDupJoinMsg = 4, } [Flags] public enum CallServiceOption { None = 0, AllowFaceBeauty = 1, AllowBlur = 2, AllowWallpapre = 4, AllowScreenRecording = 8, AllowPresentGift = 16, } public enum ServiceChargeTp { PhoneCall = 1, LiveViewing = 2, } [DataContract] public class ServiceKeyValue { [DataMember(Name = "key")] public string Key { get; set; } [DataMember(Name = "value")] public string Value { get; set; } } #endregion [DataContract] public class ServiceCharge { [DataMember(Name = "serviceChargeTp")] public ServiceChargeTp ServiceChargeTp { get; set; } [DataMember(Name = "unitSec")] public int UnitSec { get; set; } [DataMember(Name = "unitPrice")] public int UnitPrice { get; set; } [DataMember(Name = "pointPrice")] public double PointPrice { get; set; } [DataMember(Name = "currentPoint")] public int CurrentPoint { get; set; } [DataMember(Name = "freeTrialSec")] public int FreeTrialSec { get; set; } [DataMember(Name = "autoChargeTriggerPoint")] public int AutoChargeTriggerPoint { get; set; } [DataMember(Name = "autoChargeTriggerUrl")] public string AutoChargeTriggerUrl { get; set; } [IgnoreDataMember] public DateTime? PaidRequestTime { get; set; } } // 定型文章プレースホルダー [DataContract] public class LivePlaceholderColor { [DataMember(Name = "placeholder")] public string Placeholder { get; set; } [DataMember(Name = "foreColor")] public string ForeColor { get; set; } [DataMember(Name = "fontSize")] public float? FontSize { get; set; } } // ユーザー [DataContract] public class User { [DataMember(Name = "userId")] public string UserId { get; set; } [DataMember(Name = "name")] public string Name { get; set; } [DataMember(Name = "profileImageUrl", EmitDefaultValue = false)] public string ProfileImageUrl { get; set; } [DataMember(Name = "userAttrs", EmitDefaultValue = false)] public List UserAttrs { get; set; } // age [DataMember(Name = "userSubId", EmitDefaultValue = false)] public string UserSubId { get; set; } [DataMember(Name = "userRank", EmitDefaultValue = false)] public short? UserRank { get; set; } [DataMember(Name = "userRankImageUrl", EmitDefaultValue = false)] public string UserRankImageUrl { get; set; } [DataMember(Name = "candidateMode", EmitDefaultValue = false)] // 1:IPV4 2:IPV6 none or 3:Both public short? CandidateMode { get; set; } // ADD TEST public string UserAttrJson => UserAttrs != null ? JsonUtils.SerializeBody(UserAttrs) : null; } // 限定ギフト [DataContract] public class LiveSpecialGift { [DataMember(Name = "giftCategoryNo")] public string GiftCategoryNo { get; set; } [DataMember(Name = "giftNo")] public string GiftNo { get; set; } [DataMember(Name = "displayOrder", EmitDefaultValue = false)] public short? DisplayOrder { get; set; } // 省略時マスタの表示順序を適用 [DataMember(Name = "displayTimeFrom", EmitDefaultValue = false)] // ToString("yyyy/MM/dd HH:mm:ss") public string DisplayTimeFrom { get; set; } // ライブ中常時使用できる場合は未指定 // GIFマスターの有効時間より優先されます。 [DataMember(Name = "displayTimeTo", EmitDefaultValue = false)] // ToString("yyyy/MM/dd HH:mm:ss") public string DisplayTimeTo { get; set; } } // Frame指定 [DataContract] public class LiveSpecialFrame { [DataMember(Name = "frameDesignTp")] public SiteFrameDesignTp FrameDesignTp { get; set; } [DataMember(Name = "foreColor", EmitDefaultValue = false)] // ARGB HEX FF0000FF public string ForeColor { get; set; } [DataMember(Name = "backColor", EmitDefaultValue = false)] public string BackColor { get; set; } [DataMember(Name = "borderColor", EmitDefaultValue = false)] public string BorderColor { get; set; } [DataMember(Name = "borderWidth", EmitDefaultValue = false)] // 0.1 <-> 9.9 public double? BorderWidth { get; set; } [DataMember(Name = "borderCircular", EmitDefaultValue = false)] public double? BorderCircular { get; set; } [DataMember(Name = "fontSize", EmitDefaultValue = false)] public double? FontSize { get; set; } [DataMember(Name = "paddingVertical")] public double? PaddingVertical { get; set; } [DataMember(Name = "paddingHorizontal")] public double? PaddingHorizontal { get; set; } [IgnoreDataMember] public SiteFrameDesign SiteFrameDesign { get; set; } } // 定型文章指定 [DataContract] public class LiveSpecialWording { [DataMember(Name = "wordingTp")] public SiteWordingTp WordingTp { get; set; } [DataMember(Name = "wording")] public string Wording { get; set; } [DataMember(Name = "placeholderColors")] public List PlaceholderColors { get; set; } [IgnoreDataMember] public SiteWording SiteWording { get; set; } } // 自動表示メッセージ [DataContract] public class LiveSpecialMessage { [DataMember(Name = "connectAfterSec")] // 接続後N秒で表示開始 public int ConnectAfterSec { get; set; } [DataMember(Name = "displayDuration")] // 表示秒数 public int DisplayDuration { get; set; } [DataMember(Name = "message")] // 表示メッセージ public string Message { get; set; } [DataMember(Name = "frame", EmitDefaultValue = false)] // 表示フレーム形式 FrameDesignTpはRuntimeDesingにする public LiveSpecialFrame Frame { get; set; } [DataMember(Name = "alignmentX", EmitDefaultValue = false)] // 表示位置 省略時は中央 通常のX,Y軸ではありません。中心を(0.0,0.0)とする相対位置です。 public double? AlignmentX { get; set; } // https://media.springernature.com/lw685/springer-static/image/chp%3A10.1007%2F978-1-4842-5181-2_6/MediaObjects/482531_1_En_6_Fig25_HTML.png [DataMember(Name = "alignmentY", EmitDefaultValue = false)] public double? AlignmentY { get; set; } [DataMember(Name = "widthRate", EmitDefaultValue = false)] public double? WidthRate { get; set; } [DataMember(Name = "comments", EmitDefaultValue = false)] // 内部使用(APIからは使用できません) public List Comments { get; set; } } // QuickPayment [DataContract] public class QuickPayment { [DataMember(Name = "pointText")] public string PointText { get; set; } [DataMember(Name = "paymentAmount")] public int PaymentAmount { get; set; } } // ライブ設定 [DataContract] public class LiveService { [DataMember(Name = "linkId")] public string LinkId { get; set; } // 連携先ID [DataMember(Name = "janle")] // ジャンル public string Janle { get; set; } [DataMember(Name = "title")] // 配信タイトル public string Title { get; set; } [DataMember(Name = "attentionHideExpireTime", EmitDefaultValue = false)] // 配信注意非表示有効時間 public string AttentionHideExpireTime { get; set; } [DataMember(Name = "liverCommentPoint")] // ライバーコメントポイント public short LiverCommentPoint { get; set; } [DataMember(Name = "commentChargeLen")] // コメント課金対象文字数 (例)10 public short CommentChargeLen { get; set; } [DataMember(Name = "commentChargePoint")] // コメント課金ポイント (例)3 public short CommentChargePoint { get; set; } [DataMember(Name = "commentGuide")] // コメントガイダンス (例)10文字以上で3pt消費します public string CommentGuide { get; set; } [DataMember(Name = "commentImageSize", EmitDefaultValue = false)] // コメントプロフィールイメージサイズ defult:24 public int? CommentImageSize { get; set; } [DataMember(Name = "commentScaleWidth", EmitDefaultValue = false)] // コメント横幅 画面サイズ% default 90% public int? CommentScaleWidth { get; set; } [DataMember(Name = "commentScaleHeight", EmitDefaultValue = false)] // コメント高さ 画面サイズ% default 30% public int? CommentScaleHeight { get; set; } [DataMember(Name = "apngOnVideoProcessor", EmitDefaultValue = false)] // APNG再生をカメラ画像とマージする default false:ローカル再生 public bool? ApngOnVideoProcessor { get; set; } [DataMember(Name = "description", EmitDefaultValue = false)] // 配信コメント public string Description { get; set; } [DataMember(Name = "audioOnly", EmitDefaultValue = false)] // Radio public bool? AudioOnly { get; set; } [DataMember(Name = "favorite", EmitDefaultValue = false)] // お気に入り済み public bool? Favorite { get; set; } [DataMember(Name = "rankingMode", EmitDefaultValue = false)] // 視聴者ランキングソート方式 1:PointOnly 2:PointAndViewStartTime default 1 public int? RankingMode { get; set; } [DataMember(Name = "viewerPokeCategoryNo", EmitDefaultValue = false)] // 視聴者挨拶ギフトカテゴリNo public string ViewerPokeCategoryNo { get; set; } [DataMember(Name = "viewerPokeGiftNo", EmitDefaultValue = false)] // 視聴者挨拶ギフト public string ViewerPokeGiftNo { get; set; } [DataMember(Name = "serverSideRecording", EmitDefaultValue = false)] // サーバー側でライブの録画を行う public bool? ServerSideRecording { get; set; } [DataMember(Name = "nextAvailableCommentTime", EmitDefaultValue = false)] // コメント書き込み次回送信可能時間 public int? NextAvailableCommentTime { get; set; } [DataMember(Name = "nextAvailableGiftTime", EmitDefaultValue = false)] // ギフト次回送信可能時間 public int? NextAvailableGiftTime { get; set; } [DataMember(Name = "specialUrls", EmitDefaultValue = false)] // topBannerUrl, pointChargeUrl public List SpecialUrls { get; set; } [DataMember(Name = "specialGifts", EmitDefaultValue = false)] public List SpecialGifts { get; set; } [DataMember(Name = "specialFrames", EmitDefaultValue = false)] public List SpecialFrames { get; set; } [DataMember(Name = "specialWordings", EmitDefaultValue = false)] public List SpecialWordings { get; set; } [DataMember(Name = "specialMessages", EmitDefaultValue = false)] public List SpecialMessages { get; set; } [DataMember(Name = "quickPayments", EmitDefaultValue = false)] public List QuickPayments { get; set; } [DataMember(Name = "serviceOptions", EmitDefaultValue = false)] public LiveServiceOption ServiceOptions { get; set; } } // 通話設定 [DataContract] public class CallService { [DataMember(Name = "callToken")] public string CallToken { get; set; } [DataMember(Name = "callerOption")] public CallServiceOption CallerOption { get; set; } [DataMember(Name = "calleeUserId")] public string CalleeUserId { get; set; } [DataMember(Name = "calleeUserNm")] public string CalleeUserNm { get; set; } [DataMember(Name = "calleeProfileImageUrl")] public string CalleeProfileImageUrl { get; set; } [DataMember(Name = "calleeOption")] public CallServiceOption CalleeOption { get; set; } [DataMember(Name = "calleeReturnUrl")] public string CalleeReturnUrl { get; set; } [DataMember(Name = "calleeUserSubId", EmitDefaultValue = false)] public string CalleeUserSubId { get; set; } [DataMember(Name = "calleePhoneNo", EmitDefaultValue = false)] public string CalleePhoneNo { get; set; } [DataMember(Name = "calleeCandidateMode", EmitDefaultValue = false)] // 1:IPV4 2:IPV6 none or 3:Both public short? CalleeCandidateMode { get; set; } [DataMember(Name = "callerIdPrefix", EmitDefaultValue = false)] public string CallerIdPrefix { get; set; } [DataMember(Name = "videoCall")] public bool VideoCall { get; set; } [DataMember(Name = "callingTimeout")] public short CallingTimeout { get; set; } [DataMember(Name = "paidCallee")] public bool PaidCallee { get; set; } } [DataContract] public class SiteService { [DataMember(Name = "user")] public User User { get; set; } [DataMember(Name = "serviceCharge")] public ServiceCharge ServiceCharge { get; set; } [DataMember(Name = "liveService", EmitDefaultValue = false)] public LiveService LiveService { get; set; } [DataMember(Name = "callService", EmitDefaultValue = false)] public CallService CallService { get; set; } } }