package com.miaxis.app.controller.product;

import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.customer.service.ICustomerInfoService;
import com.miaxis.customer.vo.CustomerInfoVo;
import com.miaxis.product.domain.ProductTypeInfo;
import com.miaxis.product.service.IProductTypeInfoService;
import com.miaxis.product.vo.ProductTypeInfoVo;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 【小程序-品类管理】Controller
 *
 * @author miaxis
 * @date 2021-03-11
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(Constants.STUDENT_PREFIX+"/applet/product/info")
@Api(tags={"【小程序-品类管理】"})
public class AppletProductTypeInfoController extends BaseController{

    private final IProductTypeInfoService productTypeInfoService;


    /**
     * 查询品类列表
     */
    @GetMapping("/list")
    @ApiOperation("查询品类列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
    })
    public ResponsePageInfo<ProductTypeInfoVo> list(@ModelAttribute ProductTypeInfo productTypeInfo){
        startPage();
        List<ProductTypeInfoVo> list = productTypeInfoService.selectProductTypeInfoList(productTypeInfo);
        return toResponsePageInfo(list);
    }



}
