diff --git a/src/main/java/com/rymcu/forest/entity/Product.java b/src/main/java/com/rymcu/forest/entity/Product.java new file mode 100644 index 0000000..09dfa6a --- /dev/null +++ b/src/main/java/com/rymcu/forest/entity/Product.java @@ -0,0 +1,58 @@ +package com.rymcu.forest.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import java.io.Serializable; +import java.util.Date; + +/** + * Created on 2022/6/13 21:42. + * + * @author ronger + * @email ronger-x@outlook.com + * @desc : 产品表 + */ +@Data +@Table(name = "forest_product") +public class Product implements Serializable, Cloneable { + /** + * 主键 + */ + @Id + @GeneratedValue(generator = "JDBC") + private Integer id; + /** + * 产品名 + */ + private String productTitle; + /** + * 单价(单位:分) + */ + private Integer productPrice; + /** + * 产品主图 + */ + private String productImgUrl; + /** + * 产品描述 + */ + private String productDescription; + /** + * 权重;数值越小权限越大;0:无权限 + */ + private Integer weights; + /** + * 创建时间 + */ + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date createdTime; + /** + * 更新时间 + */ + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date updatedTime; +} diff --git a/src/main/java/com/rymcu/forest/entity/ProductContent.java b/src/main/java/com/rymcu/forest/entity/ProductContent.java new file mode 100644 index 0000000..deafecd --- /dev/null +++ b/src/main/java/com/rymcu/forest/entity/ProductContent.java @@ -0,0 +1,42 @@ +package com.rymcu.forest.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import javax.persistence.Table; +import java.io.Serializable; +import java.util.Date; + +/** + * Created on 2022/6/13 21:51. + * + * @author ronger + * @email ronger-x@outlook.com + * @desc : 产品详情表 + */ +@Data +@Table(name = "forest_product_content") +public class ProductContent implements Serializable, Cloneable { + /** + * 产品表主键 + */ + private Integer idProduct; + /** + * 产品详情原文 + */ + private String productContent; + /** + * 产品详情;Html + */ + private String productContentHtml; + /** + * 创建时间 + */ + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date createdTime; + /** + * 更新时间 + */ + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date updatedTime; +} diff --git a/src/main/java/com/rymcu/forest/lucene/service/impl/LuceneServiceImpl.java b/src/main/java/com/rymcu/forest/lucene/service/impl/LuceneServiceImpl.java index 39c25c8..9790111 100644 --- a/src/main/java/com/rymcu/forest/lucene/service/impl/LuceneServiceImpl.java +++ b/src/main/java/com/rymcu/forest/lucene/service/impl/LuceneServiceImpl.java @@ -3,8 +3,6 @@ package com.rymcu.forest.lucene.service.impl; import com.rymcu.forest.dto.ArticleDTO; import com.rymcu.forest.dto.ArticleTagDTO; import com.rymcu.forest.dto.Author; -import com.rymcu.forest.dto.PortfolioArticleDTO; -import com.rymcu.forest.entity.ArticleContent; import com.rymcu.forest.entity.User; import com.rymcu.forest.lucene.lucene.ArticleBeanIndex; import com.rymcu.forest.lucene.lucene.IKAnalyzer; diff --git a/src/main/java/com/rymcu/forest/mapper/ProductMapper.java b/src/main/java/com/rymcu/forest/mapper/ProductMapper.java new file mode 100644 index 0000000..2386ac0 --- /dev/null +++ b/src/main/java/com/rymcu/forest/mapper/ProductMapper.java @@ -0,0 +1,22 @@ +package com.rymcu.forest.mapper; + +import com.rymcu.forest.core.mapper.Mapper; +import com.rymcu.forest.entity.Product; +import org.apache.ibatis.annotations.Param; + +/** + * Created on 2022/6/13 21:53. + * + * @author ronger + * @email ronger-x@outlook.com + */ +public interface ProductMapper extends Mapper { + /** + * 保存产品详情 + * @param idProduct + * @param productContent + * @param productContentHtml + * @return + */ + Integer insertProductContent(@Param("idProduct") Integer idProduct, @Param("productContent") String productContent, @Param("productContentHtml") String productContentHtml); +} diff --git a/src/main/java/com/rymcu/forest/web/api/admin/AdminCurrencyRuleController.java b/src/main/java/com/rymcu/forest/web/api/admin/AdminCurrencyRuleController.java new file mode 100644 index 0000000..8c1ce41 --- /dev/null +++ b/src/main/java/com/rymcu/forest/web/api/admin/AdminCurrencyRuleController.java @@ -0,0 +1,46 @@ +package com.rymcu.forest.web.api.admin; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.rymcu.forest.core.result.GlobalResult; +import com.rymcu.forest.core.result.GlobalResultGenerator; +import com.rymcu.forest.dto.TransactionRecordDTO; +import com.rymcu.forest.entity.CurrencyRule; +import com.rymcu.forest.service.CurrencyRuleService; +import com.rymcu.forest.util.Utils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created on 2022/3/6 18:26. + * + * @author ronger + * @email ronger-x@outlook.com + */ +@RestController +@RequestMapping("/api/v1/admin/rule/currency") +public class AdminCurrencyRuleController { + @Resource + private CurrencyRuleService currencyRuleService; + + @GetMapping("/list") + public GlobalResult list(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "20") Integer rows, HttpServletRequest request) { + PageHelper.startPage(page, rows); + List list = currencyRuleService.findAll(); + Map map = new HashMap(2); + PageInfo pageInfo = new PageInfo(list); + map.put("rules", pageInfo.getList()); + Map pagination = Utils.getPagination(pageInfo); + map.put("pagination", pagination); + return GlobalResultGenerator.genSuccessResult(map); + } + +} diff --git a/src/main/java/mapper/ProductMapper.xml b/src/main/java/mapper/ProductMapper.xml new file mode 100644 index 0000000..0f2efe3 --- /dev/null +++ b/src/main/java/mapper/ProductMapper.xml @@ -0,0 +1,16 @@ + + + + + insert into forest_product_content(id_product, + product_content, + product_content_html, + created_time, + updated_time) + values (#{idProduct}, + #{productContent}, + #{productContentHtml}, + sysdate(), + sysdate()) + + \ No newline at end of file