收银台 商品controller

This commit is contained in:
zhaotianfeng 2024-09-14 10:44:03 +08:00
parent d67892841f
commit 4dc4552443

View File

@ -0,0 +1,52 @@
package com.fuint.business.cashierGoods.controller;
import com.fuint.business.cashierGoods.entity.MtGoods;
import com.fuint.business.cashierGoods.service.CashRegisterGoodsService;
import com.fuint.common.service.GoodsService;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
/**
* 收银端 商品相关业务接口
*/
@RestController
@RequestMapping(value = "/cashRegisterGoods")
public class CashRegisterGoodsController extends BaseController {
/**
* 商品服务接口
*/
@Autowired
private CashRegisterGoodsService cashRegisterGoodsService;
/**
* 获取店铺相关商品列表
*/
@ApiOperation(value = "获取商品列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseObject list(HttpServletRequest request) throws BusinessCheckException {
HashMap<String, Object> map = new HashMap<>();
map.put("store_id", TokenUtil.getNowAccountInfo().getStoreId());
List<MtGoods> mtGoods = cashRegisterGoodsService.selectListByMap(map);
return getSuccessResult(mtGoods);
}
}