admin
2022-01-07 8dfe5354073b700af45d5cb472dd5f003e6f3f25
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
package com.ysvideo.zhibo.app.util.video;
 
 
import com.ysvideo.zhibo.app.entity.video.VideoResource;
import com.ysvideo.zhibo.lib.common.util.common.StringUtils;
 
import java.text.DecimalFormat;
import java.util.List;
 
public class VideoUtil {
 
    public static String getWatchCountShortName(String watchCount) {
        DecimalFormat df = new DecimalFormat("###.0");
        try {
            return (StringUtils.isBlank(watchCount) ? "0" : (Integer.parseInt(watchCount)) / 10000 > 0 ? df.format(Integer.parseInt(watchCount) / 10000f) + "万" : watchCount);
        } catch (Exception e) {
        }
        return "";
    }
 
    /**
     * 获取选中的资源
     *
     * @param resourceList
     * @return
     */
 
    public static VideoResource getSelectedResource(List<VideoResource> resourceList) {
 
        for (VideoResource resource : resourceList) {
            if (resource.isChecked()) {
                return resource;
            }
        }
        return null;
    }
 
 
}