From f86f962b8813a55ffbddd9a46dbd5f6b9946b5cd Mon Sep 17 00:00:00 2001
From: datou <18319785677@163.com>
Date: Tue, 24 Nov 2020 22:02:11 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BD=BF=E7=94=A8lombok?=
=?UTF-8?q?=E6=8F=92=E4=BB=B6=EF=BC=8CResultInfo=E7=BB=93=E6=9E=9C?=
=?UTF-8?q?=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
share_project/pom.xml | 6 -
.../controller/DemandProjectController.java | 35 +++++
.../controller/SkillProjectController.java | 17 +++
.../java/com/share/domain/DemandProject.java | 123 ++++++++++++++++--
.../java/com/share/domain/ResultInfo.java | 88 +++++++++++++
.../java/com/share/domain/SkillProject.java | 114 ++++++++++++++--
.../com/share/domain/UserDemandProject.java | 51 ++++++--
.../com/share/domain/UserSkillProject.java | 55 ++++++--
.../share/mapper/UserSkillProjectMapper.java | 1 -
.../share/service/DemandProjectService.java | 21 +++
.../impl/DemandProjectServiceImpl.java | 21 +++
11 files changed, 492 insertions(+), 40 deletions(-)
create mode 100644 share_project/src/main/java/com/share/controller/DemandProjectController.java
create mode 100644 share_project/src/main/java/com/share/controller/SkillProjectController.java
create mode 100644 share_project/src/main/java/com/share/domain/ResultInfo.java
create mode 100644 share_project/src/main/java/com/share/service/DemandProjectService.java
create mode 100644 share_project/src/main/java/com/share/service/impl/DemandProjectServiceImpl.java
diff --git a/share_project/pom.xml b/share_project/pom.xml
index 732f81f2..ffd97c5c 100644
--- a/share_project/pom.xml
+++ b/share_project/pom.xml
@@ -73,12 +73,6 @@
1.1.20
-
-
- org.projectlombok
- lombok
- 1.18.12
-
diff --git a/share_project/src/main/java/com/share/controller/DemandProjectController.java b/share_project/src/main/java/com/share/controller/DemandProjectController.java
new file mode 100644
index 00000000..b8c537f7
--- /dev/null
+++ b/share_project/src/main/java/com/share/controller/DemandProjectController.java
@@ -0,0 +1,35 @@
+package com.share.controller;
+
+import com.share.domain.DemandProject;
+import com.share.domain.ResultInfo;
+import com.share.service.DemandProjectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * @author 谢佳豪
+ * @data 2020/11/24 - 20:12
+ * @description 需求项目模块controller层
+ */
+@Controller
+@ResponseBody
+@RequestMapping("/demand")
+public class DemandProjectController {
+
+ @Autowired
+ private DemandProjectService demandProjectService;
+
+
+ /**
+ * post请求 提交需求表单 添加数据
+ * @param demandProject 表单数据对象
+ * @return
+ */
+ @PostMapping
+ public ResultInfo addDemandProject(DemandProject demandProject){
+ return demandProjectService.addDemandProject(demandProject);
+ }
+}
diff --git a/share_project/src/main/java/com/share/controller/SkillProjectController.java b/share_project/src/main/java/com/share/controller/SkillProjectController.java
new file mode 100644
index 00000000..a5bff308
--- /dev/null
+++ b/share_project/src/main/java/com/share/controller/SkillProjectController.java
@@ -0,0 +1,17 @@
+package com.share.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * @author 谢佳豪
+ * @data 2020/11/24 - 20:38
+ * @description 技能项目模块controller层
+ */
+@Controller
+@ResponseBody
+@RequestMapping("/skill")
+public class SkillProjectController {
+
+}
diff --git a/share_project/src/main/java/com/share/domain/DemandProject.java b/share_project/src/main/java/com/share/domain/DemandProject.java
index cde1c827..3e86123b 100644
--- a/share_project/src/main/java/com/share/domain/DemandProject.java
+++ b/share_project/src/main/java/com/share/domain/DemandProject.java
@@ -1,9 +1,5 @@
package com.share.domain;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
@@ -13,11 +9,8 @@ import java.util.Date;
* @data 2020/11/23 - 22:45
* @description demand_project 需求项目实体类
*/
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ToString
public class DemandProject implements Serializable {
+
/**
* 项目编号
*/
@@ -66,4 +59,118 @@ public class DemandProject implements Serializable {
* 截止时间
*/
private Date endTime;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public String getProjectDesc() {
+ return projectDesc;
+ }
+
+ public void setProjectDesc(String projectDesc) {
+ this.projectDesc = projectDesc;
+ }
+
+ public String getSubsidy() {
+ return subsidy;
+ }
+
+ public void setSubsidy(String subsidy) {
+ this.subsidy = subsidy;
+ }
+
+ public Float getPrice() {
+ return price;
+ }
+
+ public void setPrice(Float price) {
+ this.price = price;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getSkill() {
+ return skill;
+ }
+
+ public void setSkill(String skill) {
+ this.skill = skill;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getMethod() {
+ return method;
+ }
+
+ public void setMethod(String method) {
+ this.method = method;
+ }
+
+ public String getPublisher() {
+ return publisher;
+ }
+
+ public void setPublisher(String publisher) {
+ this.publisher = publisher;
+ }
+
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ @Override
+ public String toString() {
+ return "DemandProject{" +
+ "id=" + id +
+ ", projectName='" + projectName + '\'' +
+ ", projectDesc='" + projectDesc + '\'' +
+ ", subsidy='" + subsidy + '\'' +
+ ", price=" + price +
+ ", address='" + address + '\'' +
+ ", skill='" + skill + '\'' +
+ ", type='" + type + '\'' +
+ ", method='" + method + '\'' +
+ ", publisher='" + publisher + '\'' +
+ ", startTime=" + startTime +
+ ", endTime=" + endTime +
+ '}';
+ }
}
diff --git a/share_project/src/main/java/com/share/domain/ResultInfo.java b/share_project/src/main/java/com/share/domain/ResultInfo.java
new file mode 100644
index 00000000..c2de8601
--- /dev/null
+++ b/share_project/src/main/java/com/share/domain/ResultInfo.java
@@ -0,0 +1,88 @@
+package com.share.domain;
+
+
+
+/**
+ * Demo Class
+ *
+ * @author 古市
+ * @date 2020-04-04 22:28
+ **/
+public class ResultInfo {
+
+ /**
+ * 操作的状态码:
+ * 成功为1,失败为0,成功但警告为3
+ */
+ private Integer status;
+
+ /**
+ * 返回的结果集
+ */
+ private Object data;
+
+ /**
+ * 返回的相关信息
+ */
+ private String message;
+
+
+ public static ResultInfo successInfo(){
+ return successInfo(null, null);
+ }
+
+ public static ResultInfo successInfo(String message){
+ return successInfo(message, null);
+ }
+
+ public static ResultInfo successInfo(String message, Object data){
+ return new ResultInfo(1, data, message);
+ }
+
+ public static ResultInfo failInfo(){
+ return failInfo(null, null);
+ }
+
+ public static ResultInfo failInfo(String message){
+ return failInfo(message, null);
+ }
+
+ public static ResultInfo failInfo(String message, Object data){
+ return new ResultInfo(0, data, message);
+ }
+
+ public static ResultInfo warnInfo(String message){
+ return new ResultInfo(2, null, message);
+ }
+
+
+ public ResultInfo(Integer status, Object data, String message) {
+ this.status = status;
+ this.data = data;
+ this.message = message;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/share_project/src/main/java/com/share/domain/SkillProject.java b/share_project/src/main/java/com/share/domain/SkillProject.java
index 39d7fbbb..966d8786 100644
--- a/share_project/src/main/java/com/share/domain/SkillProject.java
+++ b/share_project/src/main/java/com/share/domain/SkillProject.java
@@ -1,9 +1,5 @@
package com.share.domain;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.ToString;
import java.util.Date;
@@ -12,11 +8,8 @@ import java.util.Date;
* @data 2020/11/24 - 15:20
* @description skill_project 技能项目表实体类
*/
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ToString
public class SkillProject {
+
/**
* 项目编号
*/
@@ -61,4 +54,109 @@ public class SkillProject {
* 截止时间
*/
private Date endTime;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public String getProjectDesc() {
+ return projectDesc;
+ }
+
+ public void setProjectDesc(String projectDesc) {
+ this.projectDesc = projectDesc;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getSkill() {
+ return skill;
+ }
+
+ public void setSkill(String skill) {
+ this.skill = skill;
+ }
+
+ public Float getPrice() {
+ return price;
+ }
+
+ public void setPrice(Float price) {
+ this.price = price;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getMethod() {
+ return method;
+ }
+
+ public void setMethod(String method) {
+ this.method = method;
+ }
+
+ public String getPublisher() {
+ return publisher;
+ }
+
+ public void setPublisher(String publisher) {
+ this.publisher = publisher;
+ }
+
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ @Override
+ public String toString() {
+ return "SkillProject{" +
+ "id=" + id +
+ ", projectName='" + projectName + '\'' +
+ ", projectDesc='" + projectDesc + '\'' +
+ ", address='" + address + '\'' +
+ ", skill='" + skill + '\'' +
+ ", price=" + price +
+ ", type='" + type + '\'' +
+ ", method='" + method + '\'' +
+ ", publisher='" + publisher + '\'' +
+ ", startTime=" + startTime +
+ ", endTime=" + endTime +
+ '}';
+ }
}
diff --git a/share_project/src/main/java/com/share/domain/UserDemandProject.java b/share_project/src/main/java/com/share/domain/UserDemandProject.java
index 06d15888..f1edce58 100644
--- a/share_project/src/main/java/com/share/domain/UserDemandProject.java
+++ b/share_project/src/main/java/com/share/domain/UserDemandProject.java
@@ -1,9 +1,5 @@
package com.share.domain;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.ToString;
import java.io.Serializable;
@@ -12,11 +8,8 @@ import java.io.Serializable;
* @data 2020/11/24 - 15:08
* @description user_demand_project 用户需求项目关联表的实体类
*/
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ToString
public class UserDemandProject implements Serializable {
+
/**
* 需求项目id
*/
@@ -33,4 +26,46 @@ public class UserDemandProject implements Serializable {
* 项目状态 TODO(待发布状态--0;待审核状态--1)
*/
private Integer status;
+
+ public Integer getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Integer projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getTelephone() {
+ return telephone;
+ }
+
+ public void setTelephone(String telephone) {
+ this.telephone = telephone;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return "UserDemandProject{" +
+ "projectId=" + projectId +
+ ", username='" + username + '\'' +
+ ", telephone='" + telephone + '\'' +
+ ", status=" + status +
+ '}';
+ }
}
diff --git a/share_project/src/main/java/com/share/domain/UserSkillProject.java b/share_project/src/main/java/com/share/domain/UserSkillProject.java
index 918ffd2e..804f9013 100644
--- a/share_project/src/main/java/com/share/domain/UserSkillProject.java
+++ b/share_project/src/main/java/com/share/domain/UserSkillProject.java
@@ -1,20 +1,15 @@
package com.share.domain;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.ToString;
+
+
+import java.io.Serializable;
/**
* @author 谢佳豪
* @data 2020/11/24 - 15:25
* @description user_skill_project 用户技能项目关联表的实体类
*/
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ToString
-public class UserSkillProject {
+public class UserSkillProject implements Serializable {
/**
* 需求项目id
*/
@@ -31,4 +26,46 @@ public class UserSkillProject {
* 项目状态 TODO(待发布状态--0;待审核状态--1)
*/
private Integer status;
+
+ public Integer getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Integer projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getTelephone() {
+ return telephone;
+ }
+
+ public void setTelephone(String telephone) {
+ this.telephone = telephone;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return "UserSkillProject{" +
+ "projectId=" + projectId +
+ ", username='" + username + '\'' +
+ ", telephone='" + telephone + '\'' +
+ ", status=" + status +
+ '}';
+ }
}
diff --git a/share_project/src/main/java/com/share/mapper/UserSkillProjectMapper.java b/share_project/src/main/java/com/share/mapper/UserSkillProjectMapper.java
index 048cd7a5..d97dcf5c 100644
--- a/share_project/src/main/java/com/share/mapper/UserSkillProjectMapper.java
+++ b/share_project/src/main/java/com/share/mapper/UserSkillProjectMapper.java
@@ -1,6 +1,5 @@
package com.share.mapper;
-import com.share.domain.UserDemandProject;
import com.share.domain.UserSkillProject;
import org.springframework.stereotype.Repository;
diff --git a/share_project/src/main/java/com/share/service/DemandProjectService.java b/share_project/src/main/java/com/share/service/DemandProjectService.java
new file mode 100644
index 00000000..e4deb859
--- /dev/null
+++ b/share_project/src/main/java/com/share/service/DemandProjectService.java
@@ -0,0 +1,21 @@
+package com.share.service;
+
+
+import com.share.domain.DemandProject;
+import com.share.domain.ResultInfo;
+
+/**
+ * @author 谢佳豪
+ * @data 2020/11/24 - 20:42
+ * @description 需求项目模块service接口
+ */
+public interface DemandProjectService {
+
+ /**
+ * 添加需求项目数据
+ * @param demandProject 需求项目表单数据 TODO 用户名如何填写到项目表单中!
+ * @return
+ */
+ ResultInfo addDemandProject(DemandProject demandProject);
+
+}
diff --git a/share_project/src/main/java/com/share/service/impl/DemandProjectServiceImpl.java b/share_project/src/main/java/com/share/service/impl/DemandProjectServiceImpl.java
new file mode 100644
index 00000000..2deafdd5
--- /dev/null
+++ b/share_project/src/main/java/com/share/service/impl/DemandProjectServiceImpl.java
@@ -0,0 +1,21 @@
+package com.share.service.impl;
+
+import com.share.domain.DemandProject;
+import com.share.domain.ResultInfo;
+import com.share.service.DemandProjectService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author 谢佳豪
+ * @data 2020/11/24 - 20:47
+ * @description
+ */
+@Service
+public class DemandProjectServiceImpl implements DemandProjectService {
+
+ @Override
+ public ResultInfo addDemandProject(DemandProject demandProject) {
+
+ return null;
+ }
+}
--
Gitee