Commit 16f06aef authored by hezhen's avatar hezhen

123

parent fb4b402e
package com.github.wxiaoqi.security.common.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
/**
* 首页商品列表
......@@ -20,4 +23,18 @@ public class GoodDataVO{
private String price;
/**
* 经度
*/
@Column(name = "longitude")
@ApiModelProperty(value = "经度")
private Double longitude;
/**
* 纬度
*/
@Column(name = "latitude")
@ApiModelProperty(value = "纬度")
private Double latitude;
}
......@@ -50,6 +50,11 @@
<artifactId>xx-activity-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
......
......@@ -11,7 +11,10 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.feign.TourFeign;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
......@@ -28,6 +31,9 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class)
public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserCollect> {
@Autowired
TourFeign tourFeign;
//新增收藏
public ObjectRestResponse addUserCollect(AppUserCollectDTO collectDTO)throws Exception{
......@@ -46,7 +52,13 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl
}
AppUserCollect collect=new AppUserCollect();
BeanUtils.copyProperties(collect,collectDTO);
insertSelective(collect);
TourGood tourGood=tourFeign.one(typeId);
if(tourGood!=null){
BeanUtils.copyProperties(collect,tourGood);
insertSelective(collect);
}
return ObjectRestResponse.succ();
}
......
......@@ -17,6 +17,7 @@ import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.tour.feign.TourFeign;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -44,6 +45,7 @@ public class AppUserCollectController extends CommonBaseController {
AppUserCollectBiz collectBiz;
/**
* 我的收藏
* @param page
......
......@@ -49,7 +49,7 @@
<!--首页查询全部-->
<select id="findAllByHome" resultType="com.github.wxiaoqi.security.common.vo.GoodDataVO">
select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`
select cs.id as `id`,cs.name as `name`,cs.logo as `imgUrl`,cs.province_name as `name1`,cs.longitude,cs.latitude
FROM `campsite_shop` cs
where cs.sale_state=1
order by cs.hot desc
......
......@@ -90,4 +90,8 @@ public interface TourFeign {
@GetMapping(value = "/tourGood/app/shopList")
public List<GoodDataVO> goodList(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit",defaultValue = "4") Integer limit);
//获取商品信息
@RequestMapping(value = "/app/unauth/one", method = RequestMethod.GET)
public TourGood one(@RequestParam(value = "goodId",defaultValue = "0") Integer goodId);
}
......@@ -125,5 +125,10 @@ public class TourGoodDetailBiz extends BaseBiz<TourGoodMapper, TourGood> {
}
}
//获取路线信息
public TourGood getOneGood(Integer id){
return selectById(id);
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.tour.biz.TourGoodDetailBiz;
import com.xxfc.platform.tour.entity.TourGood;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -27,6 +28,13 @@ public class TourGoodDetailController{
return detailBiz.getGoodDetaileById(goodId);
}
//获取商品信息
@RequestMapping(value = "/app/unauth/one", method = RequestMethod.GET)
@IgnoreUserToken
public TourGood one(@RequestParam(value = "goodId",defaultValue = "0") Integer goodId) {
return detailBiz.getOneGood(goodId);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment