小程序主页接口
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.product.service.HomePageService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 小程序主页相关接口
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/home")
|
||||
public class HomeController {
|
||||
|
||||
@Resource
|
||||
private HomePageService homePageService;
|
||||
|
||||
@GetMapping("/homePageUp")
|
||||
public CzgResult<?> homePageUp() {
|
||||
return CzgResult.success(homePageService.getHomeInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页商品
|
||||
* @param lng 纬度
|
||||
* @param lat 经度
|
||||
* @param address 城市
|
||||
* @param classify 分类 0双人餐 1饮品明细 2咖啡饮品
|
||||
* @param orderType 排序规则 0离我最近 1销量优先 2价格优先
|
||||
* @param distanceType 1一千米
|
||||
* @return 商品列表
|
||||
*/
|
||||
@GetMapping("/product")
|
||||
public CzgResult<?> home(String lng, String lat, String address, Integer classify, Integer orderType, Integer distanceType) {
|
||||
return CzgResult.success(homePageService.getProd(lng, lat, address, classify, orderType, distanceType));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user