ソースを参照

强行安利lombok

小柒2012 7 年 前
コミット
48fde4f4ee
2 ファイル変更12 行追加101 行削除
  1. 5 1
      pom.xml
  2. 7 100
      src/main/java/com/itstyle/common/model/Product.java

+ 5 - 1
pom.xml

@@ -135,7 +135,11 @@
 		    <groupId>org.javassist</groupId>
 		    <artifactId>javassist</artifactId>
 		</dependency>
-		 
+		<!--  JAVA奇技淫巧简化代码之lombok https://blog.52itstyle.com/archives/1418/ -->
+		<dependency>
+		    <groupId>org.projectlombok</groupId>
+		    <artifactId>lombok</artifactId>
+		</dependency>
 	</dependencies>
 	<build>
 		<finalName>spring-boot-pay</finalName>

+ 7 - 100
src/main/java/com/itstyle/common/model/Product.java

@@ -1,11 +1,17 @@
 package com.itstyle.common.model;
 import java.io.Serializable;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 /**
  * 产品订单信息
  * 创建者 科帮网
  * 创建时间	2017年7月27日
- *
  */
+@Data                
+@NoArgsConstructor     
+@AllArgsConstructor
 public class Product implements Serializable {
 	private static final long serialVersionUID = 1L;
 	private String productId;// 商品ID
@@ -18,103 +24,4 @@ public class Product implements Serializable {
 	private Short payType;// 支付类型(1:支付宝 2:微信 3:银联)
 	private Short payWay;// 支付方式 (1:PC,平板 2:手机)
 	private String frontUrl;// 前台回调地址  非扫码支付使用
-
-	public Product() {
-		super();
-	}
-
-	public Product(String productId, String body, String totalFee,
-			String outTradeNo, String spbillCreateIp, String attach,
-			Short payType, Short payWay, String frontUrl) {
-		super();
-		this.productId = productId;
-		this.body = body;
-		this.totalFee = totalFee;
-		this.outTradeNo = outTradeNo;
-		this.spbillCreateIp = spbillCreateIp;
-		this.attach = attach;
-		this.payType = payType;
-		this.payWay = payWay;
-		this.frontUrl = frontUrl;
-	}
-
-	public String getProductId() {
-		return productId;
-	}
-
-	public void setProductId(String productId) {
-		this.productId = productId;
-	}
-
-	public String getBody() {
-		return body;
-	}
-
-	public void setBody(String body) {
-		this.body = body;
-	}
-
-	public String getTotalFee() {
-		return totalFee;
-	}
-
-	public void setTotalFee(String totalFee) {
-		this.totalFee = totalFee;
-	}
-
-	public String getOutTradeNo() {
-		return outTradeNo;
-	}
-
-	public void setOutTradeNo(String outTradeNo) {
-		this.outTradeNo = outTradeNo;
-	}
-
-	public String getSpbillCreateIp() {
-		return spbillCreateIp;
-	}
-
-	public void setSpbillCreateIp(String spbillCreateIp) {
-		this.spbillCreateIp = spbillCreateIp;
-	}
-
-	public String getAttach() {
-		return attach;
-	}
-
-	public void setAttach(String attach) {
-		this.attach = attach;
-	}
-
-	public Short getPayType() {
-		return payType;
-	}
-
-	public void setPayType(Short payType) {
-		this.payType = payType;
-	}
-
-	public Short getPayWay() {
-		return payWay;
-	}
-
-	public void setPayWay(Short payWay) {
-		this.payWay = payWay;
-	}
-
-	public String getFrontUrl() {
-		return frontUrl;
-	}
-
-	public void setFrontUrl(String frontUrl) {
-		this.frontUrl = frontUrl;
-	}
-
-	public String getSubject() {
-		return subject;
-	}
-
-	public void setSubject(String subject) {
-		this.subject = subject;
-	}
 }