Browse Source

feat:智能打分

Joburgess 4 năm trước cách đây
mục cha
commit
5d209f1129

+ 37 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SoundController.java

@@ -0,0 +1,37 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/5/19 0019
+ */
+@Api(tags = "音频服务")
+@RequestMapping("sound")
+@RestController
+public class SoundController extends BaseController {
+
+    @ApiOperation(value = "评分")
+    @PostMapping("compare")
+    public HttpResponseResult compare(@RequestParam("record") MultipartFile file, Integer musicScoreId){
+        Map<String, Double> result = new HashMap<>();
+
+        result.put("score", Math.random()*100);
+        result.put("cadence", Math.random()*100);
+        result.put("integrity", Math.random()*100);
+
+        return succeed(result);
+    }
+
+}