|
|
@@ -0,0 +1,37 @@
|
|
|
+package com.seecoder.BlueWhale.Controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.seecoder.BlueWhale.Service.StoreService;
|
|
|
+import com.seecoder.BlueWhale.VO.ResultVO;
|
|
|
+import com.seecoder.BlueWhale.VO.StoreVO;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/store")
|
|
|
+public class StoreController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ StoreService storeService;
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ public ResultVO<Boolean> create(@RequestBody StoreVO storeVO){
|
|
|
+ return ResultVO.buildSuccess(storeService.create(storeVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("{id}")
|
|
|
+ public ResultVO<StoreVO> getStore(@PathVariable Integer id){
|
|
|
+ return ResultVO.buildSuccess(storeService.getStore(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("all")
|
|
|
+ public ResultVO<List<StoreVO>> getAllStores(){
|
|
|
+ return ResultVO.buildSuccess(storeService.getAllStores());
|
|
|
+ }
|
|
|
+}
|