|
@@ -1,4 +1,37 @@
|
|
|
package com.siwei.apply.controller;
|
|
|
|
|
|
-public class ProjectController {
|
|
|
+import com.siwei.apply.domain.vo.ProjectVo;
|
|
|
+import com.siwei.apply.service.ProjectService;
|
|
|
+import com.siwei.common.core.domain.R;
|
|
|
+import com.siwei.common.core.web.controller.BaseController;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+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 java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 项目控制器
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/project")
|
|
|
+public class ProjectController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ ProjectService projectService;
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("")
|
|
|
+ public R<Map> AddProject(@RequestBody ProjectVo projectVo) {
|
|
|
+ try {
|
|
|
+ String id = projectService.addProject(projectVo);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("id", id);
|
|
|
+ return R.ok(map);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return R.fail(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|