Bladeren bron

优化字符串判断

tags/正式3.11.0^0
王宁 1 jaar geleden
bovenliggende
commit
60ff131fbd

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java Bestand weergeven

@@ -187,7 +187,7 @@ public class ResearchService {
187 187
 
188 188
     //视频转换mq
189 189
     private void convertVideo(TResearch research) {
190
-        if (!research.getMp4code().equals("h264")) {
190
+        if (!"h264".equals(research.getMp4code())) {
191 191
             messageSender.convertVideo(research.getResearchid(), research.getResearchpath());
192 192
         }
193 193
     }

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchUserService.java Bestand weergeven

@@ -69,7 +69,7 @@ public class ResearchUserService {
69 69
         researchMapper.updateReadnum(researchid);
70 70
 
71 71
         // 视频转换mq
72
-        if (!researchUserVo.getMp4code().equals("h264")) {
72
+        if (!"h264".equals(researchUserVo.getMp4code())) {
73 73
             messageSender.convertVideo(researchUserVo.getResearchid(), researchUserVo.getResearchpath());
74 74
         }
75 75
 

+ 2
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionClassService.java Bestand weergeven

@@ -221,7 +221,7 @@ public class QuestionClassService {
221 221
 
222 222
     //视频转换mq
223 223
     private void convertVideo(TQuestionExplain research) {
224
-        if (research.getSuffix().equals("mp4") && !research.getMp4code().equals("h264")) {
224
+        if ("mp4".equals(research.getSuffix()) && !"h264".equals(research.getMp4code())) {
225 225
             messageSender.convertVideo(research.getQcpid(), research.getFilepath(), "explain");
226 226
         }
227 227
     }
@@ -374,7 +374,7 @@ public class QuestionClassService {
374 374
         List<TQuestionExplain> list = questionExplainMapper.listByQuestionId(questionExplain.getQuestionid(),questionExplain.getQctype());
375 375
         if(list!=null && list.size()>0){
376 376
             for(TQuestionExplain qe : list){
377
-                if (qe.getSuffix().equals("mp4") && !qe.getMp4code().equals("h264")) {
377
+                if ("mp4".equals(qe.getSuffix()) && !"h264".equals(qe.getMp4code())) {
378 378
                     messageSender.convertVideo(qe.getQcpid(), qe.getFilepath(), "explain");
379 379
                 }
380 380
             }

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java Bestand weergeven

@@ -127,7 +127,7 @@ public class GuideService {
127 127
                 Integer resourceclass = r.getResourceclass();
128 128
                 if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
129 129
                     r.setConverted(1);
130
-                } else if (resourceclass == 5 && (r.getSuffix().equals("flv") || r.getMp4code().equals("h264"))) {
130
+                } else if (resourceclass == 5 && ("flv".equals(r.getSuffix()) || "h264".equals(r.getMp4code()))) {
131 131
                     r.setConverted(1);
132 132
                 }
133 133
                 //保存资源信息

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/utils/ConvertUtil.java Bestand weergeven

@@ -85,7 +85,7 @@ public class ConvertUtil extends JedisUtil {
85 85
     public String videoTransfer(ResourceVo resource) {
86 86
         String resourceurl = resource.getResourceurl();
87 87
         String suffix = resource.getSuffix();
88
-        if (suffix.equals("mp4") && !resource.getMp4code().equals("h264")) {
88
+        if ("mp4".equals(suffix) && !"h264".equals(resource.getMp4code())) {
89 89
             if (redisHandle(resource.getResourceurl(), resource.getResourceid())) return null;
90 90
             resourceurl = messageSender.convertResource(resource);
91 91
         }

Laden…
Annuleren
Opslaan