Переглянути джерело

Merge branch 'feature_refact' into 'master'

refact 使用lombok精简代码

See merge request crowd-2019/crowd-test-service-backend!4
薛晓波 6 роки тому
батько
коміт
9f27d2d789
20 змінених файлів з 53 додано та 887 видалено
  1. 3 24
      src/main/java/com/mooctest/crowd/domain/command/AccountCommand.java
  2. 3 89
      src/main/java/com/mooctest/crowd/domain/command/CrowdTestProjectCommand.java
  3. 3 56
      src/main/java/com/mooctest/crowd/domain/command/CrowdTestReportCommand.java
  4. 3 73
      src/main/java/com/mooctest/crowd/domain/command/CrowdTestTaskCommand.java
  5. 2 24
      src/main/java/com/mooctest/crowd/domain/command/LoginCommand.java
  6. 3 24
      src/main/java/com/mooctest/crowd/domain/command/ModifyPasswordCommand.java
  7. 2 24
      src/main/java/com/mooctest/crowd/domain/command/RegisterCommand.java
  8. 2 24
      src/main/java/com/mooctest/crowd/domain/domainobject/Account.java
  9. 2 106
      src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestProject.java
  10. 3 64
      src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestReport.java
  11. 2 89
      src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestTask.java
  12. 3 24
      src/main/java/com/mooctest/crowd/domain/domainobject/DistributeType.java
  13. 2 56
      src/main/java/com/mooctest/crowd/domain/domainobject/EvaluationAgency.java
  14. 3 19
      src/main/java/com/mooctest/crowd/domain/domainobject/GeneralUser.java
  15. 3 32
      src/main/java/com/mooctest/crowd/domain/domainobject/Permission.java
  16. 2 26
      src/main/java/com/mooctest/crowd/domain/domainobject/RegionalManager.java
  17. 3 16
      src/main/java/com/mooctest/crowd/domain/domainobject/Role.java
  18. 3 18
      src/main/java/com/mooctest/crowd/domain/domainobject/SystemAdministrator.java
  19. 3 96
      src/main/java/com/mooctest/crowd/domain/domainobject/User.java
  20. 3 3
      src/main/java/com/mooctest/crowd/domain/repository/CrowdTestProjectRepo.java

+ 3 - 24
src/main/java/com/mooctest/crowd/domain/command/AccountCommand.java

@@ -1,35 +1,14 @@
 package com.mooctest.crowd.domain.command;
 
+import lombok.Data;
+
 /**
  * @Author: xuexb
  * @Date: 2019.7.5 14:24
  */
+@Data
 public class AccountCommand {
     private Long id;
     private String mobileNum;
     private String password;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getMobileNum() {
-        return mobileNum;
-    }
-
-    public void setMobileNum(String mobileNum) {
-        this.mobileNum = mobileNum;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
 }

+ 3 - 89
src/main/java/com/mooctest/crowd/domain/command/CrowdTestProjectCommand.java

@@ -1,11 +1,14 @@
 package com.mooctest.crowd.domain.command;
 
+import lombok.Data;
+
 import java.io.File;
 
 /**
  * @author guochao
  * @date 2019/7/6 18:50
  */
+@Data
 public class CrowdTestProjectCommand {
     private Long id;
     private String name;
@@ -18,93 +21,4 @@ public class CrowdTestProjectCommand {
     private double quotedPrice;
     private double fixedPrice;
     private String status;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getOwnerId() {
-        return ownerId;
-    }
-
-    public void setOwnerId(Long ownerId) {
-        this.ownerId = ownerId;
-    }
-
-    public Long getManagerId() {
-        return managerId;
-    }
-
-    public void setManagerId(Long managerId) {
-        this.managerId = managerId;
-    }
-
-    public Long getDistributeId() {
-        return distributeId;
-    }
-
-    public void setDistributeId(Long distributeId) {
-        this.distributeId = distributeId;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public File getProjectFile() {
-        return projectFile;
-    }
-
-    public void setProjectFile(File projectFile) {
-        this.projectFile = projectFile;
-    }
-
-    public File getRequirement() {
-        return requirement;
-    }
-
-    public void setRequirement(File requirement) {
-        this.requirement = requirement;
-    }
-
-    public double getQuotedPrice() {
-        return quotedPrice;
-    }
-
-    public void setQuotedPrice(double quotedPrice) {
-        this.quotedPrice = quotedPrice;
-    }
-
-    public double getFixedPrice() {
-        return fixedPrice;
-    }
-
-    public void setFixedPrice(double fixedPrice) {
-        this.fixedPrice = fixedPrice;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
 }

+ 3 - 56
src/main/java/com/mooctest/crowd/domain/command/CrowdTestReportCommand.java

@@ -1,9 +1,12 @@
 package com.mooctest.crowd.domain.command;
 
+import lombok.Data;
+
 /**
  * @author guochao
  * @date 2019/7/11 14:16
  */
+@Data
 public class CrowdTestReportCommand {
 
     private Long id;
@@ -14,60 +17,4 @@ public class CrowdTestReportCommand {
     private String content;
     private String status;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public void setProjectId(Long projectId) {
-        this.projectId = projectId;
-    }
-
-    public Long getTaskId() {
-        return taskId;
-    }
-
-    public void setTaskId(Long taskId) {
-        this.taskId = taskId;
-    }
-
-    public int getType() {
-        return type;
-    }
-
-    public void setType(int type) {
-        this.type = type;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
 }

+ 3 - 73
src/main/java/com/mooctest/crowd/domain/command/CrowdTestTaskCommand.java

@@ -1,11 +1,14 @@
 package com.mooctest.crowd.domain.command;
 
+import lombok.Data;
+
 import java.io.File;
 
 /**
  * @author guochao
  * @date 2019/7/11 14:14
  */
+@Data
 public class CrowdTestTaskCommand {
     private Long id;
     private String name;
@@ -16,77 +19,4 @@ public class CrowdTestTaskCommand {
     private File requirementFile;
     public Double price;
     private String status;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public void setProjectId(Long projectId) {
-        this.projectId = projectId;
-    }
-
-    public Long getEvaluationAgencyId() {
-        return evaluationAgencyId;
-    }
-
-    public void setEvaluationAgencyId(Long evaluationAgencyId) {
-        this.evaluationAgencyId = evaluationAgencyId;
-    }
-
-    public int getType() {
-        return type;
-    }
-
-    public void setType(int type) {
-        this.type = type;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public File getRequirementFile() {
-        return requirementFile;
-    }
-
-    public void setRequirementFile(File requirementFile) {
-        this.requirementFile = requirementFile;
-    }
-
-    public Double getPrice() {
-        return price;
-    }
-
-    public void setPrice(Double price) {
-        this.price = price;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
 }

+ 2 - 24
src/main/java/com/mooctest/crowd/domain/command/LoginCommand.java

@@ -1,40 +1,18 @@
 package com.mooctest.crowd.domain.command;
 
 import lombok.AllArgsConstructor;
+import lombok.Data;
 import lombok.NoArgsConstructor;
 
 /**
  * @Author: xuexb
  * @Date: 2019.7.5 14:24
  */
+@Data
 @NoArgsConstructor
 @AllArgsConstructor
 public class LoginCommand {
     private String mobileNum;
     private String password;
     private String checkCode;
-
-    public void setMobileNum(String mobileNum) {
-        this.mobileNum = mobileNum;
-    }
-
-    public String getMobileNum() {
-        return mobileNum;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setCheckCode(String checkCode) {
-        this.checkCode = checkCode;
-    }
-
-    public String getCheckCode() {
-        return checkCode;
-    }
 }

+ 3 - 24
src/main/java/com/mooctest/crowd/domain/command/ModifyPasswordCommand.java

@@ -1,35 +1,14 @@
 package com.mooctest.crowd.domain.command;
 
+import lombok.Data;
+
 /**
  * @author guochao
  * @date 2019/7/5 19:13
  */
+@Data
 public class ModifyPasswordCommand {
     private String mobileNum;
     private String oldPassword;
     private String newPassword;
-
-    public void setMobileNum(String mobileNum) {
-        this.mobileNum = mobileNum;
-    }
-
-    public String getMobileNum() {
-        return mobileNum;
-    }
-
-    public void setOldPassword(String oldPassword) {
-        this.oldPassword = oldPassword;
-    }
-
-    public String getOldPassword() {
-        return oldPassword;
-    }
-
-    public void setNewPassword(String newPassword) {
-        this.newPassword = newPassword;
-    }
-
-    public String getNewPassword() {
-        return newPassword;
-    }
 }

+ 2 - 24
src/main/java/com/mooctest/crowd/domain/command/RegisterCommand.java

@@ -1,40 +1,18 @@
 package com.mooctest.crowd.domain.command;
 
 import lombok.AllArgsConstructor;
+import lombok.Data;
 import lombok.NoArgsConstructor;
 
 /**
  * @Author: xuexb
  * @Date: 2019.7.5 14:09
  */
+@Data
 @AllArgsConstructor
 @NoArgsConstructor
 public class RegisterCommand {
     private String mobileNum;
     private String checkCode;
     private String password;
-
-    public void setMobileNum(String mobileNum) {
-        this.mobileNum = mobileNum;
-    }
-
-    public String getMobileNum() {
-        return mobileNum;
-    }
-
-    public void setCheckCode(String checkCode) {
-        this.checkCode = checkCode;
-    }
-
-    public String getCheckCode() {
-        return checkCode;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getPassword() {
-        return password;
-    }
 }

+ 2 - 24
src/main/java/com/mooctest/crowd/domain/domainobject/Account.java

@@ -3,6 +3,7 @@ package com.mooctest.crowd.domain.domainobject;
 import com.mooctest.crowd.domain.command.LoginCommand;
 import com.mooctest.crowd.domain.command.ModifyPasswordCommand;
 import com.mooctest.crowd.domain.exception.PasswordErrorException;
+import lombok.Data;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -11,7 +12,7 @@ import java.util.List;
  * @Author: xuexb
  * @Date: 2019.7.5 14:04
  */
-
+@Data
 public class Account {
 
     private Long id;
@@ -60,28 +61,5 @@ public class Account {
         return roles;
     }
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getMobileNum() {
-        return mobileNum;
-    }
-
-    public void setMobileNum(String mobileNum) {
-        this.mobileNum = mobileNum;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
 
 }

+ 2 - 106
src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestProject.java

@@ -5,6 +5,7 @@ import com.mooctest.crowd.domain.exception.CrowdTestReportNotExistException;
 import com.mooctest.crowd.domain.exception.CrowdTestTaskNoPriceException;
 import com.mooctest.crowd.domain.exception.CrowdTestTaskNotExistException;
 import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
+import lombok.Data;
 
 import java.io.File;
 import java.util.Date;
@@ -14,7 +15,7 @@ import java.util.List;
  * @author guochao
  * @date 2019/7/6 18:27
  */
-
+@Data
 public class CrowdTestProject {
 
     private Long id;
@@ -29,113 +30,8 @@ public class CrowdTestProject {
     private double fixedPrice;
     private String status;
     private Date creatTime;
-
     private List<CrowdTestTask> crowdTestTaskList;
 
-    public List<CrowdTestTask> getCrowdTestTaskList() {
-        return crowdTestTaskList;
-    }
-
-    public void setCrowdTestTaskList(List<CrowdTestTask> crowdTestTaskList) {
-        this.crowdTestTaskList = crowdTestTaskList;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getOwnerId() {
-        return ownerId;
-    }
-
-    public void setOwnerId(Long ownerId) {
-        this.ownerId = ownerId;
-    }
-
-    public Long getManagerId() {
-        return managerId;
-    }
-
-    public void setManagerId(Long managerId) {
-        this.managerId = managerId;
-    }
-
-    public DistributeType getDistributeType() {
-        return distributeType;
-    }
-
-    public void setDistributeType(DistributeType distributeType) {
-        this.distributeType = distributeType;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public File getProjectFile() {
-        return projectFile;
-    }
-
-    public void setProjectFile(File projectFile) {
-        this.projectFile = projectFile;
-    }
-
-    public File getRequirement() {
-        return requirement;
-    }
-
-    public void setRequirement(File requirement) {
-        this.requirement = requirement;
-    }
-
-    public double getQuotedPrice() {
-        return quotedPrice;
-    }
-
-    public void setQuotedPrice(double quotedPrice) {
-        this.quotedPrice = quotedPrice;
-    }
-
-    public double getFixedPrice() {
-        return fixedPrice;
-    }
-
-    public void setFixedPrice(double fixedPrice) {
-        this.fixedPrice = fixedPrice;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-
     @Override
     public String toString() {
         return "CrowdTestProject{" +

+ 3 - 64
src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestReport.java

@@ -1,11 +1,14 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 import java.util.Date;
 
 /**
  * @author guochao
  * @date 2019/7/11 14:16
  */
+@Data
 public class CrowdTestReport {
 
     private Long id;
@@ -17,70 +20,6 @@ public class CrowdTestReport {
     private String status;
     private Date creatTime;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public void setProjectId(Long projectId) {
-        this.projectId = projectId;
-    }
-
-    public Long getTaskId() {
-        return taskId;
-    }
-
-    public void setTaskId(Long taskId) {
-        this.taskId = taskId;
-    }
-
-    public int getType() {
-        return type;
-    }
-
-    public void setType(int type) {
-        this.type = type;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-
     @Override
     public String toString() {
         return "CrowdTestReport{" +

+ 2 - 89
src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestTask.java

@@ -2,6 +2,7 @@ package com.mooctest.crowd.domain.domainobject;
 
 import com.mooctest.crowd.domain.exception.CrowdTestReportNotExistException;
 import com.mooctest.crowd.domain.exception.CrowdTestTaskNotExistException;
+import lombok.Data;
 
 import java.io.File;
 import java.util.Date;
@@ -11,6 +12,7 @@ import java.util.List;
  * @author guochao
  * @date 2019/7/11 14:14
  */
+@Data
 public class CrowdTestTask {
     private Long id;
     private String name;
@@ -22,97 +24,8 @@ public class CrowdTestTask {
     private Double price;
     private String status;
     private Date creatTime;
-
     private List<CrowdTestReport> crowdTestReportList;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public void setProjectId(Long projectId) {
-        this.projectId = projectId;
-    }
-
-    public Long getEvaluationAgencyId() {
-        return evaluationAgencyId;
-    }
-
-    public void setEvaluationAgencyId(Long evaluationAgencyId) {
-        this.evaluationAgencyId = evaluationAgencyId;
-    }
-
-    public int getType() {
-        return type;
-    }
-
-    public void setType(int type) {
-        this.type = type;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public File getRequirementFile() {
-        return requirementFile;
-    }
-
-    public void setRequirementFile(File requirementFile) {
-        this.requirementFile = requirementFile;
-    }
-
-
-    public String getStatus() {
-        return status;
-    }
-
-    public Double getPrice() {
-        return price;
-    }
-
-    public void setPrice(Double price) {
-        this.price = price;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-
-    public List<CrowdTestReport> getCrowdTestReportList() {
-        return crowdTestReportList;
-    }
-
-    public void setCrowdTestReportList(List<CrowdTestReport> crowdTestReportList) {
-        this.crowdTestReportList = crowdTestReportList;
-    }
 
     @Override
     public String toString() {

+ 3 - 24
src/main/java/com/mooctest/crowd/domain/domainobject/DistributeType.java

@@ -1,37 +1,16 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 import java.util.Date;
 
 /**
  * @author guochao
  * @date 2019/7/15 20:47
  */
+@Data
 public class DistributeType {
     private Long id;
     private String name;
     private Date createTime;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
 }

+ 2 - 56
src/main/java/com/mooctest/crowd/domain/domainobject/EvaluationAgency.java

@@ -4,6 +4,7 @@ import com.mooctest.crowd.domain.exception.CrowdTestProjectNotExistException;
 import com.mooctest.crowd.domain.exception.CrowdTestTaskNoPriceException;
 import com.mooctest.crowd.domain.exception.CrowdTestTaskNotExistException;
 import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
+import lombok.Data;
 
 import java.util.Date;
 
@@ -11,6 +12,7 @@ import java.util.Date;
  * @author guochao
  * @date 2019/7/12 1:32
  */
+@Data
 public class EvaluationAgency extends User{
     private Long id;
     private Long userId;
@@ -31,62 +33,6 @@ public class EvaluationAgency extends User{
         this.id = id;
     }
 
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public String getBankAccount() {
-        return bankAccount;
-    }
-
-    public void setBankAccount(String bankAccount) {
-        this.bankAccount = bankAccount;
-    }
-
-    public String getAddress() {
-        return address;
-    }
-
-    public void setAddress(String address) {
-        this.address = address;
-    }
-
-    public String getAbilities() {
-        return abilities;
-    }
-
-    public void setAbilities(String abilities) {
-        this.abilities = abilities;
-    }
-
-    public String getResource() {
-        return resource;
-    }
-
-    public void setResource(String resource) {
-        this.resource = resource;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public Date getExpireTime() {
-        return expireTime;
-    }
-
-    public void setExpireTime(Date expireTime) {
-        this.expireTime = expireTime;
-    }
-
     public boolean updateCrowdTestTaskStatusByEvaluationAgency(Long projectId, Long taskId, Long evaluationAgencyId, String status) throws CrowdTestProjectNotExistException, CrowdTestTaskNotExistException, CrowdTestTaskNoPriceException {
         CrowdTestProjectRepo crowdTestProjectRepo = new CrowdTestProjectRepo();
         if (crowdTestProjectRepo.getByID(projectId) != null) {

+ 3 - 19
src/main/java/com/mooctest/crowd/domain/domainobject/GeneralUser.java

@@ -1,29 +1,13 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 /**
  * @author guochao
  * @date 2019/7/6 18:16
  */
+@Data
 public class GeneralUser extends User{
     private Long id;
     private Long userId;
-
-    @Override
-    public Long getId() {
-        return id;
-    }
-
-    @Override
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
 }

+ 3 - 32
src/main/java/com/mooctest/crowd/domain/domainobject/Permission.java

@@ -1,45 +1,16 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 /**
  * @author guochao
  * @date 2019/7/5 22:51
  */
+@Data
 public class Permission {
 
     private Long id;
     private String name;
     private String resource;
     private String operation;
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setResource(String resource) {
-        this.resource = resource;
-    }
-
-    public String getResource() {
-        return resource;
-    }
-
-    public void setOperation(String operation) {
-        this.operation = operation;
-    }
-
-    public String getOperation() {
-        return operation;
-    }
 }

+ 2 - 26
src/main/java/com/mooctest/crowd/domain/domainobject/RegionalManager.java

@@ -3,6 +3,7 @@ package com.mooctest.crowd.domain.domainobject;
 import com.mooctest.crowd.domain.exception.CrowdTestProjectNotExistException;
 import com.mooctest.crowd.domain.exception.CrowdTestTaskNotExistException;
 import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
+import lombok.Data;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -11,37 +12,12 @@ import java.util.List;
  * @author guochao
  * @date 2019/7/9 14:16
  */
+@Data
 public class RegionalManager extends User {
     private Long id;
     private Long userId;
     private String regional;
 
-    @Override
-    public Long getId() {
-        return id;
-    }
-
-    @Override
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
-
-    public String getRegional() {
-        return regional;
-    }
-
-    public void setRegional(String regional) {
-        this.regional = regional;
-    }
-
     public List<CrowdTestTask> splitCrowdTestProjectToCrowdTestTaskList(Long projectId) throws CrowdTestProjectNotExistException {
         CrowdTestProjectRepo crowdTestProjectRepo = new CrowdTestProjectRepo();
         CrowdTestProject crowdTestProject = crowdTestProjectRepo.getByID(projectId);

+ 3 - 16
src/main/java/com/mooctest/crowd/domain/domainobject/Role.java

@@ -1,26 +1,13 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 /**
  * @author guochao
  * @date 2019/7/6 17:54
  */
+@Data
 public class Role {
     private Long id;
     private String name;
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
 }

+ 3 - 18
src/main/java/com/mooctest/crowd/domain/domainobject/SystemAdministrator.java

@@ -1,28 +1,13 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 /**
  * @author guochao
  * @date 2019/7/16 16:11
  */
+@Data
 public class SystemAdministrator extends User {
     private Long id;
     private Long userId;
-
-    @Override
-    public Long getId() {
-        return id;
-    }
-
-    @Override
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Long userId) {
-        this.userId = userId;
-    }
 }

+ 3 - 96
src/main/java/com/mooctest/crowd/domain/domainobject/User.java

@@ -1,11 +1,14 @@
 package com.mooctest.crowd.domain.domainobject;
 
+import lombok.Data;
+
 import java.util.Date;
 
 /**
  * @author guochao
  * @date 2019/7/6 18:17
  */
+@Data
 public class User {
     private Long id;
     private String name;
@@ -19,100 +22,4 @@ public class User {
     private String isAvailable;
     private String isDeleted;
     private Date createTime;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getGender() {
-        return gender;
-    }
-
-    public void setGender(String gender) {
-        this.gender = gender;
-    }
-
-    public String getMobile() {
-        return mobile;
-    }
-
-    public void setMobile(String mobile) {
-        this.mobile = mobile;
-    }
-
-    public String getProvince() {
-        return province;
-    }
-
-    public void setProvince(String province) {
-        this.province = province;
-    }
-
-    public String getCity() {
-        return city;
-    }
-
-    public void setCity(String city) {
-        this.city = city;
-    }
-
-    public String getPhotoUrl() {
-        return photoUrl;
-    }
-
-    public void setPhotoUrl(String photoUrl) {
-        this.photoUrl = photoUrl;
-    }
-
-    public String getIsAvailable() {
-        return isAvailable;
-    }
-
-    public void setIsAvailable(String isAvailable) {
-        this.isAvailable = isAvailable;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
 }

+ 3 - 3
src/main/java/com/mooctest/crowd/domain/repository/CrowdTestProjectRepo.java

@@ -3,6 +3,7 @@ package com.mooctest.crowd.domain.repository;
 import com.mooctest.crowd.domain.domainobject.*;
 import com.mooctest.crowd.domain.exception.CrowdTestProjectNotExistException;
 import com.mooctest.crowd.domain.factory.CrowdTestProjectFactory;
+import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
@@ -17,11 +18,10 @@ import java.util.List;
  * @author guochao
  * @date 2019/7/6 19:09
  */
+@Slf4j
 @Component
 public class CrowdTestProjectRepo implements ICrowdTestProjectRepo {
 
-    private Logger logger = LoggerFactory.getLogger(CrowdTestProjectRepo.class);
-
     public CrowdTestProject getByName(String name) {
         if("PROJECT_ONE".equals(name)){
             CrowdTestProject crowdTestProject = CrowdTestProjectFactory.createCrowdTestProject();
@@ -98,7 +98,7 @@ public class CrowdTestProjectRepo implements ICrowdTestProjectRepo {
         Object testProjectName = crowdTestProject.getName();
         Date date = new Date();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        logger.error("用户{}创建项目失败,失败时间:{},失败原因:{}",new Object[]{testProjectName,df.format(date), reason});
+        log.error("用户{}创建项目失败,失败时间:{},失败原因:{}",new Object[]{testProjectName,df.format(date), reason});
     }
 
     @Override