Quellcode durchsuchen

本地数据不能删除

詹子聪 vor 5 Jahren
Ursprung
Commit
a789d43baa

+ 67 - 0
src/main/java/com/miekir/shibei/bean/CouponBean.java

@@ -0,0 +1,67 @@
+package com.miekir.shibei.bean;
+
+
+import javax.persistence.*;
+
+/**
+ *
+ *
+ * @author Miekir
+ * @date 2020/7/7 19:37
+ * Description: 优惠券实体
+ */
+@Entity
+@Table(name = "t_coupon", schema = "shibei", catalog = "")
+public class CouponBean {
+    /**
+     * 模板Id
+     */
+    @Id
+    @GeneratedValue(strategy= GenerationType.AUTO)
+    @Column(name = "id", nullable = false, insertable = true, updatable = false)
+    public long couponId;
+
+    /**
+     * 模板类型
+     */
+    @Basic
+    @Column(name = "couponType", nullable = true, insertable = true, updatable = true)
+    public int couponType;
+
+    /**
+     * 模板名称
+     */
+    @Basic
+    @Column(name = "couponName", nullable = true, insertable = true, updatable = true)
+    public String couponName;
+
+    /**
+     * 点击之后跳转的链接
+     */
+    @Basic
+    @Column(name = "jumpUrl", nullable = true, insertable = true, updatable = true)
+    public String jumpUrl;
+
+    /**
+     * 封面图片URL
+     */
+    @Basic
+    @Column(name = "coverUrl", nullable = true, insertable = true, updatable = true)
+    public String coverUrl;
+
+    /**
+     * 是否可以响应点击
+     */
+    @Basic
+    @Column(name = "actionEnable", nullable = true, insertable = true, updatable = true)
+    public boolean actionEnable;
+
+    /**是否是本地写死的数据*/
+    @Basic
+    @Column(name = "isLocal", nullable = true, insertable = true, updatable = true)
+    public boolean isLocal;
+
+    /*columnDefinition = "MEDIUMTEXT"可以解决文字太长保存不进去的bug
+    @Basic
+    @Column(columnDefinition = "MEDIUMTEXT", name = "content", nullable = true, insertable = true, updatable = true)*/
+}

+ 5 - 0
src/main/java/com/miekir/shibei/bean/GoodsBean.java

@@ -145,4 +145,9 @@ public class GoodsBean {
     @Basic
     @Column(name = "enable", nullable = true, insertable = true, updatable = true)
     public boolean enable;
+
+    /**是否是本地写死的数据*/
+    @Basic
+    @Column(name = "isLocal", nullable = true, insertable = true, updatable = true)
+    public boolean isLocal;
 }

+ 0 - 54
src/main/java/com/miekir/shibei/bean/NoteBean.java

@@ -1,54 +0,0 @@
-package com.miekir.shibei.bean;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "t_note", schema = "shibei", catalog = "")
-public class NoteBean {
-    private Integer id;
-    private String content;
-    private String userId;
-    private Long updateTime;
-
-    // Id自增
-    @Id
-    @GeneratedValue(strategy= GenerationType.AUTO)
-    @Column(name = "id", nullable = false, insertable = true, updatable = false)
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    @Column(name = "userId", nullable = true, insertable = true, updatable = true)
-    public String getUserId() {
-        return userId;
-    }
-
-    public void setUserId(String userId) {
-        this.userId = userId;
-    }
-
-    @Basic
-    @Column(name = "updateTime", nullable = true, insertable = true, updatable = true)
-    public Long getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Long updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    /*columnDefinition = "MEDIUMTEXT"可以解决文字太长保存不进去的bug*/
-    @Basic
-    @Column(columnDefinition = "MEDIUMTEXT", name = "content", nullable = true, insertable = true, updatable = true)
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-}

+ 1 - 1
src/main/java/com/miekir/shibei/controller/api/GoodsController.java

@@ -71,7 +71,7 @@ public class GoodsController {
      */
     @RequestMapping(value = "/api/deleteGoodsById", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
     @ResponseBody
-    public String delNote(@RequestHeader HttpHeaders header, long goodsId) {
+    public String deleteGoods(@RequestHeader HttpHeaders header, long goodsId) {
         ResponseResult<String> responseResult = new ResponseResult<String>();
         responseResult.setMessage("删除失败");
 

+ 0 - 4
src/main/java/com/miekir/shibei/repository/GoodsRepository.java

@@ -1,16 +1,12 @@
 package com.miekir.shibei.repository;
 
 import com.miekir.shibei.bean.GoodsBean;
-import com.miekir.shibei.bean.NoteBean;
 import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.List;
-
 /**
  * Created by sjj on 2015/10/24 0024.
  */