Browse Source

资源ID加锁,更换类型,判断是否相等

tags/正式3.11.0
王宁 1 year ago
parent
commit
36d14cbce2

+ 2
- 4
sstudy/src/main/java/com/xhkjedu/sstudy/config/ConfigKey.java View File

3
 import org.springframework.beans.factory.annotation.Value;
3
 import org.springframework.beans.factory.annotation.Value;
4
 import org.springframework.stereotype.Component;
4
 import org.springframework.stereotype.Component;
5
 
5
 
6
-import java.io.UnsupportedEncodingException;
7
-
8
 /**
6
 /**
9
  * @author ywx
7
  * @author ywx
10
  * @classname ConfigKey
8
  * @classname ConfigKey
16
 
14
 
17
     public static Integer nummin;
15
     public static Integer nummin;
18
     public static Integer nummax;
16
     public static Integer nummax;
19
-    public static Integer numadd;
17
+    public static long numadd;
20
 
18
 
21
     @Value("${nummin}")
19
     @Value("${nummin}")
22
     public void setNummin(Integer nummin) {
20
     public void setNummin(Integer nummin) {
29
     }
27
     }
30
 
28
 
31
     @Value("${numadd}")
29
     @Value("${numadd}")
32
-    public void setNumadd(Integer numadd) {
30
+    public void setNumadd(long numadd) {
33
         ConfigKey.numadd = numadd;
31
         ConfigKey.numadd = numadd;
34
     }
32
     }
35
 
33
 

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/ResourceService.java View File

77
         Integer resourceclass = model.getResourceclass();
77
         Integer resourceclass = model.getResourceclass();
78
         if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
78
         if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
79
             model.setConverted(1);
79
             model.setConverted(1);
80
-        } else if (resourceclass == 5 && (model.getSuffix().equals("flv") || model.getMp4code().equals("h264"))) {
80
+        } else if (resourceclass == 5 && ("flv".equals(model.getSuffix()) || "h264".equals(model.getMp4code()))) {
81
             model.setConverted(1);
81
             model.setConverted(1);
82
         }
82
         }
83
         resourceMapper.insertSelective(model);//保存资源
83
         resourceMapper.insertSelective(model);//保存资源

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/utils/StudyUtil.java View File

35
     public static Map<String, String> uriMap = new ConcurrentHashMap<>();
35
     public static Map<String, String> uriMap = new ConcurrentHashMap<>();
36
 
36
 
37
     //获取id
37
     //获取id
38
-    public static String getId(){
38
+    public static synchronized String getId(){
39
         Integer nummin = ConfigKey.nummin;
39
         Integer nummin = ConfigKey.nummin;
40
         Integer nummax = ConfigKey.nummax;
40
         Integer nummax = ConfigKey.nummax;
41
         if (id == 0 || id.equals(nummax)) {
41
         if (id == 0 || id.equals(nummax)) {

Loading…
Cancel
Save