Procházet zdrojové kódy

返回值状态码

skyfffire před 2 měsíci
rodič
revize
8ee927a8e2

+ 12 - 0
src/main/java/common/model/Nft.java

@@ -0,0 +1,12 @@
+package common.model;
+
+import common.model.base.BaseNft;
+
+/**
+ * Generated by JFinal.
+ */
+@SuppressWarnings("serial")
+public class Nft extends BaseNft<Nft> {
+	public static final Nft dao = new Nft().dao();
+}
+

+ 12 - 0
src/main/java/common/model/Nftt.java

@@ -0,0 +1,12 @@
+package common.model;
+
+import common.model.base.BaseNftt;
+
+/**
+ * Generated by JFinal.
+ */
+@SuppressWarnings("serial")
+public class Nftt extends BaseNftt<Nftt> {
+	public static final Nftt dao = new Nftt().dao();
+}
+

+ 2 - 0
src/main/java/common/model/_MappingKit.java

@@ -16,6 +16,8 @@ import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
 public class _MappingKit {
 	
 	public static void mapping(ActiveRecordPlugin arp) {
+		arp.addMapping("t_nft", "id", Nft.class);
+		arp.addMapping("t_nftt", "id", Nftt.class);
 		arp.addMapping("t_user", "id", User.class);
 	}
 }

+ 115 - 0
src/main/java/common/model/base/BaseNft.java

@@ -0,0 +1,115 @@
+package common.model.base;
+
+import com.jfinal.plugin.activerecord.Model;
+import com.jfinal.plugin.activerecord.IBean;
+
+/**
+ * Generated by JFinal, do not modify this file.
+ */
+@SuppressWarnings("serial")
+public abstract class BaseNft<M extends BaseNft<M>> extends Model<M> implements IBean {
+	/**
+	 * 自增主键
+	 */
+	public void setId(java.lang.Integer id) {
+		set("id", id);
+	}
+	
+	/**
+	 * 自增主键
+	 */
+	public java.lang.Integer getId() {
+		return getInt("id");
+	}
+	/**
+	 * 所属人id
+	 */
+	public void setOwenerId(java.lang.Integer owenerId) {
+		set("owener_id", owenerId);
+	}
+	
+	/**
+	 * 所属人id
+	 */
+	public java.lang.Integer getOwenerId() {
+		return getInt("owener_id");
+	}
+	/**
+	 * 订单id(-1是系统奖励)
+	 */
+	public void setOrderId(java.lang.Integer orderId) {
+		set("order_id", orderId);
+	}
+	
+	/**
+	 * 订单id(-1是系统奖励)
+	 */
+	public java.lang.Integer getOrderId() {
+		return getInt("order_id");
+	}
+	/**
+	 * 所属nftt
+	 */
+	public void setNfttId(java.lang.Integer nfttId) {
+		set("nftt_id", nfttId);
+	}
+	
+	/**
+	 * 所属nftt
+	 */
+	public java.lang.Integer getNfttId() {
+		return getInt("nftt_id");
+	}
+	/**
+	 * 在nftt中的序列号
+	 */
+	public void setNfttSerialNumber(java.lang.Integer nfttSerialNumber) {
+		set("nftt_serial_number", nfttSerialNumber);
+	}
+	
+	/**
+	 * 在nftt中的序列号
+	 */
+	public java.lang.Integer getNfttSerialNumber() {
+		return getInt("nftt_serial_number");
+	}
+	public void setCreateTime(java.lang.Long createTime) {
+		set("create_time", createTime);
+	}
+	
+	public java.lang.Long getCreateTime() {
+		return getLong("create_time");
+	}
+	public void setUpdateTime(java.lang.Long updateTime) {
+		set("update_time", updateTime);
+	}
+	
+	public java.lang.Long getUpdateTime() {
+		return getLong("update_time");
+	}
+	public void setIsDeleted(java.lang.Integer isDeleted) {
+		set("is_deleted", isDeleted);
+	}
+	
+	public java.lang.Integer getIsDeleted() {
+		return getInt("is_deleted");
+	}
+	
+	public boolean save() {
+		set("create_time", System.currentTimeMillis());
+		
+		return super.save();
+	}
+	
+	public boolean update() {
+		set("update_time", System.currentTimeMillis());
+		
+		return super.update();
+	}
+
+	public boolean delete() {
+		set("is_deleted", 1);
+
+		return super.update();
+	}
+}

+ 182 - 0
src/main/java/common/model/base/BaseNftt.java

@@ -0,0 +1,182 @@
+package common.model.base;
+
+import com.jfinal.plugin.activerecord.Model;
+import com.jfinal.plugin.activerecord.IBean;
+
+/**
+ * Generated by JFinal, do not modify this file.
+ */
+@SuppressWarnings("serial")
+public abstract class BaseNftt<M extends BaseNftt<M>> extends Model<M> implements IBean {
+	/**
+	 * 自增主键
+	 */
+	public void setId(java.lang.Integer id) {
+		set("id", id);
+	}
+	
+	/**
+	 * 自增主键
+	 */
+	public java.lang.Integer getId() {
+		return getInt("id");
+	}
+	/**
+	 * 售价(¥)
+
+	 */
+	public void setPrice(java.math.BigDecimal price) {
+		set("price", price);
+	}
+	
+	/**
+	 * 售价(¥)
+
+	 */
+	public java.math.BigDecimal getPrice() {
+		return getBigDecimal("price");
+	}
+	/**
+	 * 开启预售时间
+	 */
+	public void setPresaleStartTime(java.lang.Long presaleStartTime) {
+		set("presale_start_time", presaleStartTime);
+	}
+	
+	/**
+	 * 开启预售时间
+	 */
+	public java.lang.Long getPresaleStartTime() {
+		return getLong("presale_start_time");
+	}
+	/**
+	 * 预售结束时间
+	 */
+	public void setPresaleEndTime(java.lang.Long presaleEndTime) {
+		set("presale_end_time", presaleEndTime);
+	}
+	
+	/**
+	 * 预售结束时间
+	 */
+	public java.lang.Long getPresaleEndTime() {
+		return getLong("presale_end_time");
+	}
+	/**
+	 * 开放购买时间
+	 */
+	public void setBuyingStartTime(java.lang.Long buyingStartTime) {
+		set("buying_start_time", buyingStartTime);
+	}
+	
+	/**
+	 * 开放购买时间
+	 */
+	public java.lang.Long getBuyingStartTime() {
+		return getLong("buying_start_time");
+	}
+	/**
+	 * 作者(名字)
+	 */
+	public void setAuthor(java.lang.String author) {
+		set("author", author);
+	}
+	
+	/**
+	 * 作者(名字)
+	 */
+	public java.lang.String getAuthor() {
+		return getStr("author");
+	}
+	/**
+	 * 已购入份数,此值应该小于max_quantity
+	 */
+	public void setPurchasedQuantity(java.lang.Integer purchasedQuantity) {
+		set("purchased_quantity", purchasedQuantity);
+	}
+	
+	/**
+	 * 已购入份数,此值应该小于max_quantity
+	 */
+	public java.lang.Integer getPurchasedQuantity() {
+		return getInt("purchased_quantity");
+	}
+	/**
+	 * 最大份数
+	 */
+	public void setMaxQuantity(java.lang.Integer maxQuantity) {
+		set("max_quantity", maxQuantity);
+	}
+	
+	/**
+	 * 最大份数
+	 */
+	public java.lang.Integer getMaxQuantity() {
+		return getInt("max_quantity");
+	}
+	/**
+	 * 介绍页图片url列表
+	 */
+	public void setDetailImageList(java.lang.String detailImageList) {
+		set("detail_image_list", detailImageList);
+	}
+	
+	/**
+	 * 介绍页图片url列表
+	 */
+	public java.lang.String getDetailImageList() {
+		return getStr("detail_image_list");
+	}
+	/**
+	 * 发布者id
+	 */
+	public void setCreaterId(java.lang.Integer createrId) {
+		set("creater_id", createrId);
+	}
+	
+	/**
+	 * 发布者id
+	 */
+	public java.lang.Integer getCreaterId() {
+		return getInt("creater_id");
+	}
+	public void setCreateTime(java.lang.Long createTime) {
+		set("create_time", createTime);
+	}
+	
+	public java.lang.Long getCreateTime() {
+		return getLong("create_time");
+	}
+	public void setUpdateTime(java.lang.Long updateTime) {
+		set("update_time", updateTime);
+	}
+	
+	public java.lang.Long getUpdateTime() {
+		return getLong("update_time");
+	}
+	public void setIsDeleted(java.lang.Integer isDeleted) {
+		set("is_deleted", isDeleted);
+	}
+	
+	public java.lang.Integer getIsDeleted() {
+		return getInt("is_deleted");
+	}
+	
+	public boolean save() {
+		set("create_time", System.currentTimeMillis());
+		
+		return super.save();
+	}
+	
+	public boolean update() {
+		set("update_time", System.currentTimeMillis());
+		
+		return super.update();
+	}
+
+	public boolean delete() {
+		set("is_deleted", 1);
+
+		return super.update();
+	}
+}

+ 3 - 8
src/main/java/common/utils/http/MyRet.java

@@ -4,21 +4,16 @@ import com.jfinal.kit.Ret;
 
 public class MyRet extends Ret {
     public static final int CODE_OK = 0;                // 正常
-
     public static final int CODE_NO_LOGIN = 1;          // 未登录
-
     public static final int CODE_NO_POWER = 2;          // 没有权限
-
-    public static MyRet create() {
-        return new MyRet();
-    }
+    public static final int CODE_FAILED = 3;            // 一般错误
 
     public static MyRet fail(String msg) {
-        return new MyRet().setState(false).setMsg(msg);
+        return new MyRet().setState(false).setCode(CODE_FAILED).setMsg(msg);
     }
 
     public static MyRet ok(String msg) {
-        return new MyRet().setState(true).setMsg(msg);
+        return new MyRet().setState(true).setCode(CODE_OK).setMsg(msg);
     }
 
     public MyRet setState(boolean state) {