Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0ef966ed5 | ||
|
|
333857d199 | ||
|
|
cdaf518401 | ||
|
|
795fbf721e | ||
|
|
f3bcd3aa0c |
@ -7,7 +7,7 @@ crmeb:
|
||||
wechat-js-api-beta: true #微信js api是否是beta版本
|
||||
asyncConfig: false #是否同步config表数据到redis
|
||||
asyncWeChatProgramTempList: false #是否同步小程序公共模板库
|
||||
imagePath: /当前项目更根目录的素材文件(绝对路径)/crmebimage/ # 服务器图片路径配置 斜杠结尾
|
||||
imagePath: /workspace/pro/Crmeb/crmeb/crmebimage/ # 服务器图片路径配置 斜杠结尾
|
||||
database: mysql
|
||||
|
||||
# 配置端口
|
||||
@ -39,13 +39,13 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: crmeb
|
||||
password: 111111
|
||||
username: zack
|
||||
password: zack0430
|
||||
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 111111
|
||||
password: hat123
|
||||
timeout: 30000 # 连接超时时间(毫秒)
|
||||
database: 15 #默认数据库
|
||||
jedis:
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
package com.zbkj.common.model.product;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品表
|
||||
* +----------------------------------------------------------------------
|
||||
@ -166,4 +168,25 @@ public class StoreProduct implements Serializable {
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
@TableField(exist = false)
|
||||
private String content;
|
||||
|
||||
//新增字段
|
||||
@ApiModelProperty(value = "开始售卖时间")
|
||||
private Date beginTime;
|
||||
|
||||
@ApiModelProperty(value = "结束售卖时间")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "搜索状态:0=售卖中,1=上新预告,2=团购结束")
|
||||
private String searchStatus;
|
||||
|
||||
@ApiModelProperty(value = "水果规格")
|
||||
private String size;
|
||||
|
||||
@ApiModelProperty(value = "水果尺寸")
|
||||
private String dimensions;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐 0=推荐,1=未推荐")
|
||||
private String isSuggest;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package com.zbkj.common.token;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.common.utils.RequestUtil;
|
||||
@ -175,6 +174,7 @@ public class FrontTokenComponent {
|
||||
"api/front/index/get/version",
|
||||
"api/front/image/domain",
|
||||
"api/front/product/leaderboard"
|
||||
|
||||
};
|
||||
|
||||
return ArrayUtils.contains(routerList, uri);
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package com.zbkj.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 为你推荐分页查询
|
||||
* @Author Administrator
|
||||
* @Date 2025/4/28 11:35
|
||||
*/
|
||||
@Data
|
||||
public class ProductSuggestPage {
|
||||
//当前页
|
||||
private Long page;
|
||||
//页容
|
||||
private Long limit;
|
||||
//搜索词商品名
|
||||
private String storeName;
|
||||
}
|
||||
@ -68,6 +68,7 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
excludePathPatterns("/api/front/article/**").
|
||||
excludePathPatterns("/api/front/city/**").
|
||||
excludePathPatterns("/api/front/product/hot").
|
||||
excludePathPatterns("/api/front/pagelist/suggest").
|
||||
excludePathPatterns("/api/front/product/good").
|
||||
excludePathPatterns("/api/front/products/**").
|
||||
excludePathPatterns("/api/front/reply/**").
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
@ -8,6 +9,7 @@ import com.zbkj.common.request.ProductListRequest;
|
||||
import com.zbkj.common.request.ProductRequest;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
import com.zbkj.front.service.ProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -40,6 +42,18 @@ public class ProductController {
|
||||
@Autowired
|
||||
private ProductService productService;
|
||||
|
||||
/**
|
||||
* 为你推荐
|
||||
* 参数暂定分页对象
|
||||
*/
|
||||
@ApiOperation(value = "为你推荐")
|
||||
@RequestMapping(value = "/pagelist/suggest", method = RequestMethod.GET)
|
||||
public CommonResult<Object> getProductSuggestionList(ProductSuggestPage param) {
|
||||
IPage<StoreProduct> list = productService.getProductSuggestionList(param);
|
||||
return CommonResult.success(list,"查询成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 热门商品推荐
|
||||
*/
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
package com.zbkj.front.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.ProductListRequest;
|
||||
import com.zbkj.common.request.ProductRequest;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -23,7 +26,14 @@ import java.util.List;
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
public interface ProductService {
|
||||
public interface ProductService extends IService<StoreProduct> {
|
||||
|
||||
/**
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
//为你推荐
|
||||
IPage<StoreProduct> getProductSuggestionList(ProductSuggestPage param);
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
@ -103,4 +113,6 @@ public interface ProductService {
|
||||
* @return List
|
||||
*/
|
||||
List<StoreProduct> getLeaderboard();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import com.zbkj.common.request.LoginMobileRequest;
|
||||
import com.zbkj.common.request.LoginRequest;
|
||||
import com.zbkj.common.response.LoginResponse;
|
||||
import com.zbkj.common.token.FrontTokenComponent;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.DateUtil;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.front.service.LoginService;
|
||||
@ -68,7 +67,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
}
|
||||
|
||||
// 校验密码
|
||||
String password = CrmebUtil.encryptPassword(loginRequest.getPassword(), loginRequest.getPhone());
|
||||
//String password = CrmebUtil.encryptPassword(loginRequest.getPassword(), loginRequest.getPhone());
|
||||
String password = loginRequest.getPassword();
|
||||
if (!user.getPwd().equals(password)) {
|
||||
throw new CrmebException("密码错误");
|
||||
}
|
||||
|
||||
@ -3,11 +3,12 @@ package com.zbkj.front.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.constants.CategoryConstants;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.constants.RedisConstatns;
|
||||
import com.zbkj.common.constants.SysConfigConstants;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.model.product.StoreProductAttr;
|
||||
@ -24,7 +25,9 @@ import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.MyRecord;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
import com.zbkj.front.service.ProductService;
|
||||
import com.zbkj.service.dao.StoreProductDao;
|
||||
import com.zbkj.service.delete.ProductUtils;
|
||||
import com.zbkj.service.service.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -50,7 +53,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Service
|
||||
public class ProductServiceImpl implements ProductService {
|
||||
public class ProductServiceImpl extends ServiceImpl<StoreProductDao,StoreProduct> implements ProductService {
|
||||
|
||||
@Autowired
|
||||
private StoreProductService storeProductService;
|
||||
@ -91,6 +94,22 @@ public class ProductServiceImpl implements ProductService {
|
||||
@Autowired
|
||||
private UserVisitRecordService userVisitRecordService;
|
||||
|
||||
/**
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
public IPage<StoreProduct> getProductSuggestionList(ProductSuggestPage param) {
|
||||
//分页查询
|
||||
IPage<StoreProduct> page = new Page<>(param.getPage(), param.getLimit());
|
||||
//构造查询条件
|
||||
/*QueryWrapper<StoreProduct> query = new QueryWrapper<>();
|
||||
if(StringUtils.isNotEmpty(param.getStoreName())){
|
||||
query.lambda().like(StoreProduct::getStoreName,param.getStoreName());
|
||||
}*/
|
||||
return this.baseMapper.getProductSuggestionList(page,param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类
|
||||
* @return List<CategoryTreeVo>
|
||||
@ -538,5 +557,8 @@ public class ProductServiceImpl implements ProductService {
|
||||
return storeProductService.getLeaderboard();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ crmeb:
|
||||
|
||||
# 配置端口
|
||||
server:
|
||||
port: 8081
|
||||
port: 8084
|
||||
servlet:
|
||||
context-path: / # 访问path
|
||||
tomcat:
|
||||
@ -34,12 +34,12 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: crmeb
|
||||
password: 111111
|
||||
username: zack
|
||||
password: zack0430
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: 111111
|
||||
password: hat123
|
||||
timeout: 30000 # 连接超时时间(毫秒)
|
||||
database: 3 #默认数据库
|
||||
jedis:
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package com.zbkj.service.dao;
|
||||
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 商品表 Mapper 接口
|
||||
@ -15,6 +18,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public interface StoreProductDao extends BaseMapper<StoreProduct> {
|
||||
/*
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
//为你推荐
|
||||
IPage<StoreProduct> getProductSuggestionList(IPage<StoreProduct> page, @Param("param") ProductSuggestPage param);
|
||||
|
||||
}
|
||||
|
||||
@ -2,4 +2,14 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zbkj.service.dao.StoreProductDao">
|
||||
|
||||
|
||||
<select id="getProductSuggestionList" resultType="com.zbkj.common.model.product.StoreProduct">
|
||||
SELECT p.*
|
||||
FROM crmeb.eb_store_product as p
|
||||
<where>
|
||||
<if test="param.storeName != null and param.storeName != ''">
|
||||
p.store_name LIKE CONCAT('%',#{param.storeName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user