|
|
@@ -1,7 +1,29 @@
|
|
|
package com.example.data_structure.controller;
|
|
|
|
|
|
+import com.example.data_structure.common.Response;
|
|
|
+import com.example.data_structure.domain.Sorting;
|
|
|
+import com.example.data_structure.service.SortingService;
|
|
|
+import com.example.data_structure.vo.BubbleSortVO;
|
|
|
+import com.sun.corba.se.pept.transport.ResponseWaitingRoom;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
|
@Controller
|
|
|
public class SortingController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SortingService sortingService;
|
|
|
+
|
|
|
+ @RequestMapping("/")
|
|
|
+ public Response getBubbleSortResult(String rule,ArrayList<Integer> content){
|
|
|
+ BubbleSortVO vo=sortingService.getBubbleSortResult(rule,content);
|
|
|
+ Response re=Response.buildSuccess(vo);
|
|
|
+ return re;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|