package org.springblade.gateway.point_gateway.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.sing.goods.entity.PointGoods;
import org.springblade.sing.goods.service.IPointGoodsService;
import org.springblade.sing.goods.vo.PointGoodsVO;
import org.springblade.sing.goods.wrapper.PointGoodsWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("sing_goods/pointgoods")
@Api(value = "积分商城", tags = "积分商城接口")
public class PointGoodsByAIdController {

	@Autowired
	private IPointGoodsService pointGoodsService;

	@GetMapping("/queryList")
	public R<IPage<PointGoodsVO>> orderList(@ApiParam(value = "活动id",required = false)Long activeId, Query query,Integer searchType) {
		IPage<PointGoods> pages = pointGoodsService.queryList(activeId, query,searchType);
		return R.data(PointGoodsWrapper.build().pageVO(pages));
	}
}
