diff --git a/.idea/misc.xml b/.idea/misc.xml
index 461b7f8..79c1d4d 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,5 +11,5 @@
-
+
\ No newline at end of file
diff --git a/src/main/java/me/mofun/config/MySiteMeshFilter.java b/src/main/java/me/mofun/config/MySiteMeshFilter.java
index 9977955..a77db94 100644
--- a/src/main/java/me/mofun/config/MySiteMeshFilter.java
+++ b/src/main/java/me/mofun/config/MySiteMeshFilter.java
@@ -18,7 +18,7 @@ public class MySiteMeshFilter extends ConfigurableSiteMeshFilter {
builder.addExcludedPath("/editor/*");
// 添加装饰器映射
- builder.addDecoratorPath("*/WEB-INF/template/*", "/my/template_footer.jsp")
+ builder.addDecoratorPath("*/WEB-INF/template/**", "/my/template_footer.jsp")
.addDecoratorPath("*/WEB-INF/template/**", "/root/index_template.jsp")
.addDecoratorPath("*/WEB-INF/admin/*", "/admin_main.jsp")
.addDecoratorPath("*/WEB-INF/admin/*", "/admin_template.jsp")
diff --git a/src/main/java/me/mofun/config/MybatisPlusAutoFillConfig.java b/src/main/java/me/mofun/config/MybatisPlusAutoFillConfig.java
index 4a849e4..097bfa6 100644
--- a/src/main/java/me/mofun/config/MybatisPlusAutoFillConfig.java
+++ b/src/main/java/me/mofun/config/MybatisPlusAutoFillConfig.java
@@ -13,11 +13,11 @@ public class MybatisPlusAutoFillConfig implements MetaObjectHandler {
*/
@Override
public void insertFill(MetaObject metaObject) {
- log.info("start insert fill ....");
+ // log.info("start insert fill ....");
// 起始版本 3.3.0(推荐使用)
- this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
- this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
- this.strictInsertFill(metaObject, "isDelete", Integer.class, 0);
+ // this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
+ // this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
+ // this.strictInsertFill(metaObject, "isDelete", Integer.class, 0);
// // 或者
// this.strictInsertFill(metaObject, "createTime", () -> LocalDateTime.now(), LocalDateTime.class); // 起始版本 3.3.3(推荐)
// // 或者
@@ -26,9 +26,9 @@ public class MybatisPlusAutoFillConfig implements MetaObjectHandler {
@Override
public void updateFill(MetaObject metaObject) {
- log.info("start update fill ....");
+ // log.info("start update fill ....");
// 起始版本 3.3.0(推荐)
- this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
+ // this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
// // 或者
// this.strictUpdateFill(metaObject, "updateTime", () -> LocalDateTime.now(), LocalDateTime.class); // 起始版本 3.3.3(推荐)
// // 或者
diff --git a/src/main/java/me/mofun/config/QueryResult.java b/src/main/java/me/mofun/config/QueryResult.java
index 144e748..462c7e4 100644
--- a/src/main/java/me/mofun/config/QueryResult.java
+++ b/src/main/java/me/mofun/config/QueryResult.java
@@ -1,5 +1,10 @@
package me.mofun.config;
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
public class QueryResult {
private String r0_Cmd; //业务类型
@@ -14,77 +19,5 @@ public class QueryResult {
private String rc_RefundCount; //已退款次数
private String rd_RefundAmt; //已退款金额
private String hmac; //密钥
-
- public String getHmac() {
- return hmac;
- }
- public void setHmac(String hmac) {
- this.hmac = hmac;
- }
- public String getR0_Cmd() {
- return r0_Cmd;
- }
- public void setR0_Cmd(String cmd) {
- r0_Cmd = cmd;
- }
- public String getR1_Code() {
- return r1_Code;
- }
- public void setR1_Code(String code) {
- r1_Code = code;
- }
- public String getR2_TrxId() {
- return r2_TrxId;
- }
- public void setR2_TrxId(String trxId) {
- r2_TrxId = trxId;
- }
- public String getR3_Amt() {
- return r3_Amt;
- }
- public void setR3_Amt(String amt) {
- r3_Amt = amt;
- }
- public String getR4_Cur() {
- return r4_Cur;
- }
- public void setR4_Cur(String cur) {
- r4_Cur = cur;
- }
- public String getR5_Pid() {
- return r5_Pid;
- }
- public void setR5_Pid(String pid) {
- r5_Pid = pid;
- }
- public String getR6_Order() {
- return r6_Order;
- }
- public void setR6_Order(String order) {
- r6_Order = order;
- }
- public String getR8_MP() {
- return r8_MP;
- }
- public void setR8_MP(String r8_mp) {
- r8_MP = r8_mp;
- }
- public String getRb_PayStatus() {
- return rb_PayStatus;
- }
- public void setRb_PayStatus(String rb_PayStatus) {
- this.rb_PayStatus = rb_PayStatus;
- }
- public String getRc_RefundCount() {
- return rc_RefundCount;
- }
- public void setRc_RefundCount(String rc_RefundCount) {
- this.rc_RefundCount = rc_RefundCount;
- }
- public String getRd_RefundAmt() {
- return rd_RefundAmt;
- }
- public void setRd_RefundAmt(String rd_RefundAmt) {
- this.rd_RefundAmt = rd_RefundAmt;
- }
+
}
diff --git a/src/main/java/me/mofun/config/RefundResult.java b/src/main/java/me/mofun/config/RefundResult.java
index 39844dd..6e5428c 100644
--- a/src/main/java/me/mofun/config/RefundResult.java
+++ b/src/main/java/me/mofun/config/RefundResult.java
@@ -1,5 +1,10 @@
package me.mofun.config;
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
public class RefundResult {
private String r0_Cmd; // 请求命令
private String r1_Code; // 请求结果
@@ -8,51 +13,4 @@ public class RefundResult {
private String r4_Cur; // 交易币种
private String hmac; // 签名校验
- public String getR0_Cmd() {
- return r0_Cmd;
- }
-
- public void setR0_Cmd(String cmd) {
- r0_Cmd = cmd;
- }
-
- public String getR1_Code() {
- return r1_Code;
- }
-
- public void setR1_Code(String code) {
- r1_Code = code;
- }
-
- public String getR2_TrxId() {
- return r2_TrxId;
- }
-
- public void setR2_TrxId(String trxId) {
- r2_TrxId = trxId;
- }
-
- public String getR3_Amt() {
- return r3_Amt;
- }
-
- public void setR3_Amt(String amt) {
- r3_Amt = amt;
- }
-
- public String getR4_Cur() {
- return r4_Cur;
- }
-
- public void setR4_Cur(String cur) {
- r4_Cur = cur;
- }
-
- public String getHmac() {
- return hmac;
- }
-
- public void setHmac(String hmac) {
- this.hmac = hmac;
- }
}
diff --git a/src/main/java/me/mofun/controller/IndexController.java b/src/main/java/me/mofun/controller/IndexController.java
index dafcfe8..292f6ef 100644
--- a/src/main/java/me/mofun/controller/IndexController.java
+++ b/src/main/java/me/mofun/controller/IndexController.java
@@ -14,7 +14,6 @@ import me.mofun.util.UserNameUtil;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -119,7 +118,7 @@ public class IndexController {
/**
* 热门推荐商品
*/
- @GetMapping("/getIndexHotProductList")
+ @GetMapping("/getIndexHotProductList.action")
@ResponseBody
public List getIndexHotProductList() {
Pagination hotPage = spellbuyrecordService.findHotProductList(1, PAGE_SIZE_LARGE);
@@ -137,9 +136,9 @@ public class IndexController {
/**
* 首页新品展示
*/
- @GetMapping("/getIndexNewProductList")
+ @GetMapping("/getIndexNewProductList.action")
@ResponseBody
- public List getIndexNewProductList(@RequestParam(defaultValue = "0") int pageNo) {
+ public List getIndexNewProductList(@RequestParam(defaultValue = "0") int pageNo,@RequestParam String json) {
Pagination newPage = spellbuyrecordService.indexNewProductList(pageNo, PAGE_SIZE_XLARGE);
if (newPage == null) {
return new ArrayList<>();
@@ -159,7 +158,7 @@ public class IndexController {
/**
* 人气排行商品
*/
- @GetMapping("/getIndexPopProductList")
+ @GetMapping("/getIndexPopProductList.action")
@ResponseBody
public List getIndexPopProductList(@RequestParam(defaultValue = "0") int pageNo) {
Pagination popPage = spellbuyrecordService.indexHotProductList(pageNo, PAGE_SIZE_MEDIUM);
diff --git a/src/main/java/me/mofun/controller/NewsController.java b/src/main/java/me/mofun/controller/NewsController.java
index 4617279..f499874 100644
--- a/src/main/java/me/mofun/controller/NewsController.java
+++ b/src/main/java/me/mofun/controller/NewsController.java
@@ -36,9 +36,8 @@ public class NewsController {
ModelAndView mav = new ModelAndView("index"); // 视图名称对应原struts配置的结果
news = newsService.getById(id);
newsTypeTopList = newstypeService.indexNewsTypeByParentId(0);
- // 注意:这里原代码可能有问题,用news的id去查NewsType?建议确认业务逻辑
parentId = newstypeService.getById(id).getParentId();
-
+
mav.addObject("news", news);
mav.addObject("newsTypeTopList", newsTypeTopList);
mav.addObject("parentId", parentId);
diff --git a/src/main/java/me/mofun/controller/ProductsController.java b/src/main/java/me/mofun/controller/ProductsController.java
new file mode 100644
index 0000000..4aae6dd
--- /dev/null
+++ b/src/main/java/me/mofun/controller/ProductsController.java
@@ -0,0 +1,372 @@
+package me.mofun.controller;
+
+import me.mofun.entity.*;
+import me.mofun.entity.pojo.ParticipateJSON;
+import me.mofun.entity.pojo.ProductInfo;
+import me.mofun.entity.pojo.UserLimitBuy;
+import me.mofun.entity.vo.Pagination;
+import me.mofun.service.*;
+import me.mofun.util.DateUtil;
+import me.mofun.util.MD5Util;
+import me.mofun.util.MemCachedClientHelp;
+import me.mofun.util.UserNameUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+@Controller
+@RequestMapping("/products")
+public class ProductsController {
+
+ @Autowired
+ private ISpellbuyrecordService spellbuyrecordService;
+
+ @Autowired
+ private ISpellbuyproductService spellbuyproductService;
+
+ @Autowired
+ private ILatestlotteryService latestlotteryService;
+
+ @Autowired
+ private IProductimageService productImageService;
+
+ @Autowired
+ private IUserService userService;
+
+ /**
+ * 商品详情页
+ */
+ @RequestMapping("/index/{id}.html")
+ public ModelAndView index(@PathVariable String id,
+ @RequestParam(defaultValue = "1") int pageNo,
+ HttpServletResponse response) throws IOException {
+
+ ModelAndView mav = new ModelAndView();
+
+ if (pageNo == 0) {
+ pageNo = 1;
+ } else {
+ pageNo += 1;
+ }
+
+ List participateJSONList = new ArrayList<>();
+
+ // 获取商品信息
+ List