|
@@ -504,7 +504,85 @@ extension VirusViewModel {
|
|
|
}
|
|
|
// MARK: - 评论
|
|
|
extension VirusViewModel {
|
|
|
- func comment(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
|
|
|
+
|
|
|
+ func comment(communityRecommendDataModel:CommunityRecommendDataModel? = nil,id:Int,content:String) {
|
|
|
+ let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
+ virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
+ virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.postId = communityRecommendDataModel?.id
|
|
|
+ virueRecordAddParameterModel.postAuthorUid = "\(communityRecommendDataModel?.uid ?? 0)"
|
|
|
+ if communityRecommendDataModel?.title == nil || communityRecommendDataModel?.title == "" {
|
|
|
+ virueRecordAddParameterModel.postDesc = "\(communityRecommendDataModel?.content!.prefix(20) ?? "")"
|
|
|
+
|
|
|
+ }else {
|
|
|
+ virueRecordAddParameterModel.postDesc = communityRecommendDataModel?.title
|
|
|
+ }
|
|
|
+ virueRecordAddParameterModel.postType = communityRecommendDataModel?.type
|
|
|
+ virueRecordAddParameterModel.postCover = communityRecommendDataModel?.img
|
|
|
+ virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.commentContent = content
|
|
|
+ virueRecordAddParameterModel.commentId = id
|
|
|
+
|
|
|
+ SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ func comment(communityFollowDataModel:CommunityFollowDataModel? = nil,id:Int,content:String) {
|
|
|
+ let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
+ virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
+ virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.postId = communityFollowDataModel?.relateData?.id
|
|
|
+ virueRecordAddParameterModel.postAuthorUid = "\(communityFollowDataModel?.relateData?.uid ?? 0)"
|
|
|
+ if communityFollowDataModel?.relateData?.title == nil || communityFollowDataModel?.relateData?.title == "" {
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.postDesc = "\(communityFollowDataModel?.relateData?.content!.prefix(20) ?? "")"
|
|
|
+
|
|
|
+ }else {
|
|
|
+ virueRecordAddParameterModel.postDesc = communityFollowDataModel?.relateData?.title
|
|
|
+ }
|
|
|
+ virueRecordAddParameterModel.postType = communityFollowDataModel?.relateData?.type
|
|
|
+ virueRecordAddParameterModel.postCover = communityFollowDataModel?.relateData?.img
|
|
|
+ virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
+ virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.commentContent = content
|
|
|
+ virueRecordAddParameterModel.commentId = id
|
|
|
+
|
|
|
+
|
|
|
+ SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ func comment(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String) {
|
|
|
+ let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
+ virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
+ virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.postId = communityPostDetailModel.id
|
|
|
+ virueRecordAddParameterModel.postAuthorUid = "\(communityPostDetailModel.uid!)"
|
|
|
+ if communityPostDetailModel.title == nil || communityPostDetailModel.title == "" {
|
|
|
+ virueRecordAddParameterModel.postDesc = "\(communityPostDetailModel.content!.prefix(20))"
|
|
|
+
|
|
|
+ }else {
|
|
|
+ virueRecordAddParameterModel.postDesc = communityPostDetailModel.title
|
|
|
+ }
|
|
|
+ virueRecordAddParameterModel.postType = communityPostDetailModel.type
|
|
|
+ virueRecordAddParameterModel.postCover = communityPostDetailModel.img
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
+ virueRecordAddParameterModel.commentContent = content
|
|
|
+ virueRecordAddParameterModel.commentId = id
|
|
|
+
|
|
|
+
|
|
|
+ SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ func commentReply(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil) {
|
|
|
let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
@@ -522,20 +600,52 @@ extension VirusViewModel {
|
|
|
|
|
|
virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
|
|
|
- virueRecordAddParameterModel.parentCommentId = communityPostReplyModel?.id
|
|
|
- virueRecordAddParameterModel.parentCommentContent = communityPostReplyModel?.content
|
|
|
- virueRecordAddParameterModel.parentCommentUid = communityPostReplyModel?.uid
|
|
|
- virueRecordAddParameterModel.parentCommentTime = communityPostReplyModel?.createdAt
|
|
|
+ virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
|
|
|
+ virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
|
|
|
+ virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
|
|
|
+ virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
|
|
|
+ virueRecordAddParameterModel.commentContent = content
|
|
|
+ virueRecordAddParameterModel.commentId = id
|
|
|
+
|
|
|
+ SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ func commentReplyAIT(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
|
|
|
+ let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
+ virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
+ virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.postId = communityPostDetailModel.id
|
|
|
+ virueRecordAddParameterModel.postAuthorUid = "\(communityPostDetailModel.uid!)"
|
|
|
+ if communityPostDetailModel.title == nil || communityPostDetailModel.title == "" {
|
|
|
+ virueRecordAddParameterModel.postDesc = "\(communityPostDetailModel.content!.prefix(20))"
|
|
|
+
|
|
|
+ }else {
|
|
|
+ virueRecordAddParameterModel.postDesc = communityPostDetailModel.title
|
|
|
+ }
|
|
|
+ virueRecordAddParameterModel.postType = communityPostDetailModel.type
|
|
|
+ virueRecordAddParameterModel.postCover = communityPostDetailModel.img
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
|
|
|
+ virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
|
|
|
+ virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
|
|
|
+ virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.replyUid = communityPostReplyModel?.uid
|
|
|
+ virueRecordAddParameterModel.replyUserName = communityPostReplyModel?.username
|
|
|
|
|
|
virueRecordAddParameterModel.commentContent = content
|
|
|
virueRecordAddParameterModel.commentId = id
|
|
|
-
|
|
|
+
|
|
|
|
|
|
SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- func comment(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
|
|
|
+ func commentVideo(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String) {
|
|
|
let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
@@ -553,36 +663,36 @@ extension VirusViewModel {
|
|
|
|
|
|
virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
|
|
|
- virueRecordAddParameterModel.parentCommentId = communityPostReplyModel?.id
|
|
|
- virueRecordAddParameterModel.parentCommentContent = communityPostReplyModel?.content
|
|
|
- virueRecordAddParameterModel.parentCommentUid = communityPostReplyModel?.uid
|
|
|
- virueRecordAddParameterModel.parentCommentTime = communityPostReplyModel?.createdAt
|
|
|
-
|
|
|
virueRecordAddParameterModel.commentContent = content
|
|
|
virueRecordAddParameterModel.commentId = id
|
|
|
|
|
|
-
|
|
|
SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- func comment(communityRecommendDataModel:CommunityRecommendDataModel? = nil,id:Int,content:String) {
|
|
|
+ func commentVideoReply(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil) {
|
|
|
let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
|
|
|
|
- virueRecordAddParameterModel.postId = communityRecommendDataModel?.id
|
|
|
- virueRecordAddParameterModel.postAuthorUid = "\(communityRecommendDataModel?.uid ?? 0)"
|
|
|
- if communityRecommendDataModel?.title == nil || communityRecommendDataModel?.title == "" {
|
|
|
- virueRecordAddParameterModel.postDesc = "\(communityRecommendDataModel?.content!.prefix(20) ?? "")"
|
|
|
-
|
|
|
+ virueRecordAddParameterModel.postId = communityVideoItemModel.id
|
|
|
+ virueRecordAddParameterModel.postAuthorUid = "\(communityVideoItemModel.uid!)"
|
|
|
+ if communityVideoItemModel.title == nil || communityVideoItemModel.title == "" {
|
|
|
+ virueRecordAddParameterModel.postDesc = "\(communityVideoItemModel.content!.prefix(20))"
|
|
|
+
|
|
|
}else {
|
|
|
- virueRecordAddParameterModel.postDesc = communityRecommendDataModel?.title
|
|
|
+ virueRecordAddParameterModel.postDesc = communityVideoItemModel.title
|
|
|
}
|
|
|
- virueRecordAddParameterModel.postType = communityRecommendDataModel?.type
|
|
|
- virueRecordAddParameterModel.postCover = communityRecommendDataModel?.img
|
|
|
+ virueRecordAddParameterModel.postType = communityVideoItemModel.type
|
|
|
+ virueRecordAddParameterModel.postCover = communityVideoItemModel.img
|
|
|
+
|
|
|
virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
|
|
|
+ virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
|
|
|
+ virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
|
|
|
+ virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
|
|
|
+ virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
|
|
|
+
|
|
|
virueRecordAddParameterModel.commentContent = content
|
|
|
virueRecordAddParameterModel.commentId = id
|
|
|
|
|
@@ -590,28 +700,34 @@ extension VirusViewModel {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- func comment(communityFollowDataModel:CommunityFollowDataModel? = nil,id:Int,content:String) {
|
|
|
+ func commentVideoReplyAIT(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
|
|
|
let virueRecordAddParameterModel = VirueRecordAddParameterModel()
|
|
|
virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
|
|
|
virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
|
|
|
|
|
|
- virueRecordAddParameterModel.postId = communityFollowDataModel?.relateData?.id
|
|
|
- virueRecordAddParameterModel.postAuthorUid = "\(communityFollowDataModel?.relateData?.uid ?? 0)"
|
|
|
- if communityFollowDataModel?.relateData?.title == nil || communityFollowDataModel?.relateData?.title == "" {
|
|
|
+ virueRecordAddParameterModel.postId = communityVideoItemModel.id
|
|
|
+ virueRecordAddParameterModel.postAuthorUid = "\(communityVideoItemModel.uid!)"
|
|
|
+ if communityVideoItemModel.title == nil || communityVideoItemModel.title == "" {
|
|
|
+ virueRecordAddParameterModel.postDesc = "\(communityVideoItemModel.content!.prefix(20))"
|
|
|
|
|
|
- virueRecordAddParameterModel.postDesc = "\(communityFollowDataModel?.relateData?.content!.prefix(20) ?? "")"
|
|
|
-
|
|
|
}else {
|
|
|
- virueRecordAddParameterModel.postDesc = communityFollowDataModel?.relateData?.title
|
|
|
+ virueRecordAddParameterModel.postDesc = communityVideoItemModel.title
|
|
|
}
|
|
|
- virueRecordAddParameterModel.postType = communityFollowDataModel?.relateData?.type
|
|
|
- virueRecordAddParameterModel.postCover = communityFollowDataModel?.relateData?.img
|
|
|
+ virueRecordAddParameterModel.postType = communityVideoItemModel.type
|
|
|
+ virueRecordAddParameterModel.postCover = communityVideoItemModel.img
|
|
|
+
|
|
|
virueRecordAddParameterModel.actionId = "\(id)"
|
|
|
- virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
|
|
|
+ virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
|
|
|
+ virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
|
|
|
+ virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
|
|
|
+
|
|
|
+ virueRecordAddParameterModel.replyUid = communityPostReplyModel?.uid
|
|
|
+ virueRecordAddParameterModel.replyUserName = communityPostReplyModel?.username
|
|
|
|
|
|
virueRecordAddParameterModel.commentContent = content
|
|
|
virueRecordAddParameterModel.commentId = id
|
|
|
-
|
|
|
|
|
|
SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
|
|
|
})
|