Commit 811bd86b authored by wuwz's avatar wuwz

旅游路线

parent cea189b0
...@@ -2,6 +2,9 @@ package com.xxfc.platform.tour.biz; ...@@ -2,6 +2,9 @@ package com.xxfc.platform.tour.biz;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.entity.TourGood; import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.mapper.TourGoodMapper; import com.xxfc.platform.tour.mapper.TourGoodMapper;
...@@ -37,9 +40,9 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> { ...@@ -37,9 +40,9 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
* @param distance * @param distance
* @return * @return
*/ */
public PageDataVO<TourGood> getGoodList(int page, int limit , String query , Double latitude, Double longitude, Integer tagId, Double distance){ public ObjectRestResponse<TourGood> getGoodList(int page, int limit , String query , Double latitude, Double longitude, Integer tagId, Double distance){
Map<String, Object> params = initParam(page, limit, query, latitude, longitude, tagId, distance); Map<String, Object> params = initParam(page, limit, query, latitude, longitude, tagId, distance);
return PageDataVO.pageInfo(page, limit, () -> mapper.getGoodList(params)); return new ObjectRestResponse().status(RestCode.SUCCESS.getStatus()).msg(RestCode.SUCCESS.getMsg()).data(PageDataVO.pageInfo(page, limit, () -> mapper.getGoodList(params)));
} }
private Map<String, Object> initParam(int page, int limit, String query, Double latitude, Double longitude, Integer tagId, Double distance) { private Map<String, Object> initParam(int page, int limit, String query, Double latitude, Double longitude, Integer tagId, Double distance) {
......
...@@ -3,10 +3,12 @@ package com.xxfc.platform.tour.rest; ...@@ -3,10 +3,12 @@ package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.common.msg.BaseResponse; import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ListRestResponse; import com.github.wxiaoqi.security.common.msg.ListRestResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodBiz; import com.xxfc.platform.tour.biz.TourGoodBiz;
import com.xxfc.platform.tour.entity.TourGood; import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.entity.TourTag;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -31,7 +33,7 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> { ...@@ -31,7 +33,7 @@ public class TourGoodController extends BaseController<TourGoodBiz, TourGood> {
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
@IgnoreClientToken @IgnoreClientToken
@ResponseBody @ResponseBody
public PageDataVO<TourGood> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit", required = true) Integer limit, public ObjectRestResponse<TourGood> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit", required = true) Integer limit,
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "latitude", required = false) Double latitude, @RequestParam(value = "query", required = false) String query, @RequestParam(value = "latitude", required = false) Double latitude,
@RequestParam(value = "longitude", required = false) Double longitude, @RequestParam(value = "tagId", required = false) Integer tagId, @RequestParam(value = "longitude", required = false) Double longitude, @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "distance", defaultValue = "10.00") Double distance) { @RequestParam(value = "distance", defaultValue = "10.00") Double distance) {
......
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