|
@@ -0,0 +1,50 @@
|
|
|
+package com.gydx.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.gydx.service.SuppliersServiceFace;
|
|
|
+import com.gydx.vo.Suppliers;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@CrossOrigin(origins = "http://localhost:8081") // 允许来自前端的跨域请求
|
|
|
+@RestController
|
|
|
+@RequestMapping("/suppliers")
|
|
|
+public class SuppliersController {
|
|
|
+ @Autowired
|
|
|
+ SuppliersServiceFace suppliersServiceFace;
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping("addsuppliers")
|
|
|
+ public void addSuppliers(@RequestBody Suppliers suppliers) {
|
|
|
+ suppliers.setDepartment_status(true);
|
|
|
+ System.out.println(suppliers);
|
|
|
+ suppliersServiceFace.addSuppliers(suppliers);
|
|
|
+ suppliers.setDepartment_status(true);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping("deletesuppliers")
|
|
|
+ public void deleteSuppliers(Suppliers suppliers) {
|
|
|
+ suppliersServiceFace.deleteSuppliers(suppliers);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("updatesuppliers")
|
|
|
+ public void updateSuppliers(Suppliers suppliers) {
|
|
|
+ suppliersServiceFace.updateSuppliers(suppliers);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("querysuppliers")
|
|
|
+ public List<Suppliers> querySuppliers(Suppliers suppliers) {
|
|
|
+ return suppliersServiceFace.querySuppliers(suppliers);
|
|
|
+ }
|
|
|
+ @RequestMapping("querySuppliersName")
|
|
|
+ public List<Suppliers> querySuppliersName(Suppliers suppliers) {
|
|
|
+ return suppliersServiceFace.querySuppliersName(suppliers);
|
|
|
+ }
|
|
|
+}
|