package beilv.shopping.controller;

import beilv.common.core.controller.BaseController;
import beilv.common.core.domain.AjaxResult;
import beilv.common.core.page.PageDomain;
import beilv.common.core.page.TableDataInfo;
import beilv.common.core.page.TableSupport;
import beilv.shopping.domain.QmjsShoppingMall;
import beilv.shopping.service.IQmjsShoppingMallService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 商城Controller
 * 
 * @author lc
 * @date 2025-01-02
 */
@RestController
@RequestMapping("/app-api/mall")
public class QmjsShoppingMallAppController extends BaseController
{
    private String prefix = "app-api/mall";

    @Autowired
    private IQmjsShoppingMallService qmjsShoppingMallService;

    /**
     * 小程序商城列表
     */
    @GetMapping("/shoppingList")
    public AjaxResult shoppingList(QmjsShoppingMall qmjsShoppingMall) {
        startPage();
        List<QmjsShoppingMall> list = qmjsShoppingMallService.selectQmjsShoppingMallList(qmjsShoppingMall);
        return AjaxResult.success(getDataTable(list).getRows());
    }

    /**
     * 小程序商城详情
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable Long id) {
        return success(qmjsShoppingMallService.selectQmjsShoppingMallById(id));
    }

}
