admin
2021-07-20 27bd1f81221b8c8e8047118a64c2beb7bc214bbb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
package com.yeshi.video.utils;
 
import android.content.Context;
 
import com.lcjian.library.util.common.StringUtils;
import com.loopj.android.http.ResponseHandlerInterface;
import com.yeshi.base.utils.http.API;
import com.yeshi.base.utils.http.BasicTextHttpResponseHandler;
import com.yeshi.base.utils.user.UserUtil;
 
import java.util.LinkedHashMap;
 
import static com.yeshi.base.utils.http.API.BASE_URL;
import static com.yeshi.base.utils.http.API.commonPost;
 
public class VideoApiUtil {
 
    /**
     * 获取真实播放路劲
     *
     * @param context
     * @param uid
     * @param handler
     */
    public static void getPlayUrl(Context context, String uid, String type,
                                  String videoId, String vid, String resourceId, String eId,
                                  ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getPlayUrl");
        params.put("Uid", uid);
        params.put("Type", type);
        params.put("VideoId", videoId);
        params.put("Id", vid);
        params.put("EId", eId);
        params.put("ResourceId", resourceId);
        commonPost(context, BASE_URL + "recommend", params, handler);
    }
 
 
    public static void getVideoDetail(Context context, String uid,
                                      String ResourceId, String videoId, String loginid, String type,
                                      ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getVideoDetail");
        params.put("Uid", uid);
        params.put("LoginUid", loginid);
        params.put("VideoId", videoId);
        params.put("ResourceId", ResourceId);
        params.put("Type", type);
        commonPost(context, BASE_URL + "recommend", params, handler);
    }
 
 
    public static void isCollect(Context context, String uid, String videoId,
                                 String thirdType, ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "isCollect");
        params.put("Uid", uid);
        params.put("Id", videoId);
        params.put("ThirdType", thirdType);
        commonPost(context, BASE_URL + "recommend", params, handler);
    }
 
 
    public static void getScoreCollect(Context context, String uid,
                                       String videoId, String thirdType, String type,
                                       ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getScoreCollect");
        params.put("Uid", uid);
        params.put("VideoId", videoId);
        params.put("ThirdType", thirdType);
        params.put("Type", type);
        commonPost(context, BASE_URL + "user", params, handler);
    }
 
 
    /**
     * 相关视频
     *
     * @param context
     * @param uid
     * @param videoId
     * @param handler
     */
    public static void getRelativeVideos(Context context, String uid,
                                         String videoId, ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getRelativeVideos");
        params.put("VideoId", videoId);
        params.put("Uid", uid);
        commonPost(context, BASE_URL + "user", params, handler);
    }
 
    /**
     * 猜你喜欢
     *
     * @param context
     * @param uid
     * @param videoId
     * @param handler
     */
    public static void guessLike(Context context, String uid, String videoId,
                                 ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "guessLike");
        params.put("VideoId", videoId);
        params.put("Uid", uid);
        commonPost(context, BASE_URL + "user", params, handler);
    }
 
    /**
     * 大家都在看
     *
     * @param context
     * @param uid
     * @param videoId
     * @param handler
     */
    public static void getPeopleSeeVideos(Context context, String uid,
                                          String videoId, ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getPeopleSeeVideos");
        params.put("VideoId", videoId);
        params.put("Uid", uid);
        commonPost(context, BASE_URL + "user", params, handler);
    }
 
 
    public static void getScoreSave(Context context, String uid,
                                    String videoDetailId, ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getScoreSave");
        params.put("Uid", uid);
        params.put("VideoDetailId", videoDetailId);
        commonPost(context, BASE_URL + "user", params, handler);
    }
 
 
    /**
     * 添加评论
     *
     * @param context
     * @param handler
     */
    public static void Comment(Context context, String loginUid,
                               String videoId, String thirdTyoe, String Content,
                               ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "comment");
        params.put("Uid", loginUid);
        params.put("VideoId", videoId);
        params.put("ThirdType", thirdTyoe);
        params.put("Content", Content);
        commonPost(context, BASE_URL + "comment", params, handler);
    }
 
 
    /**
     * 回复评论
     *
     * @param context
     * @param handler
     */
    public static void replayComment(Context context, String loginUid,
                                     String commentReplyId, String commentId, String Content,
                                     ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "replayComment");
        params.put("Uid", loginUid);
        params.put("CommentReplyId", commentReplyId);
        params.put("CommentId", commentId);
        params.put("Content", Content);
        commonPost(context, BASE_URL + "comment", params, handler);
    }
 
 
    /**
     * 视频评论列表
     *
     * @param context
     * @param uid
     * @param videoId
     * @param thirdType
     * @param Page
     * @param handler
     */
    public static void getVideoCommentList(Context context, String uid,
                                           String videoId, String thirdType, String Page,
                                           ResponseHandlerInterface handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("Method", "getVideoCommentList");
        params.put("Uid", uid);
        params.put("VideoId", videoId);
        params.put("ThirdType", thirdType);
        params.put("Page", Page);
        commonPost(context, BASE_URL + "comment", params, handler);
    }
 
 
}