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

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

@@ -77,7 +77,7 @@ public class ResourceService {
77 77
         Integer resourceclass = model.getResourceclass();
78 78
         if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
79 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 81
             model.setConverted(1);
82 82
         }
83 83
         resourceMapper.insertSelective(model);//保存资源

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

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

Loading…
Cancel
Save