package com.zfire.mall.manager.controller.k3;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zfire.mall.manager.helper.ResponseHelper;
import com.zfire.mall.manager.logic.k3.K3CategoryLogic;
import com.zfire.mall.manager.plus.entity.KingDeeCategory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
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;

@Slf4j
@RestController
@Api(value = "金蝶存货类别", tags ={"金蝶存货类别"} )
@RequestMapping(value = "/k3/category", produces = "application/json; charset=utf-8")
public class K3CategoryController {

    @Autowired
    K3CategoryLogic k3CategoryLogic;

    @ApiOperation(value = "存货类别列表")
    @GetMapping("/list")
    public ResponseHelper<IPage<KingDeeCategory>> list(
            @ApiParam(required = false, value = "搜索内容") @RequestParam(required = false) String keyword,
            @ApiParam(value = "页号",required = true)@RequestParam Integer pageNum,
            @ApiParam(value = "页大小",required = true)@RequestParam Integer pageSize
    ) throws Exception {
        IPage<KingDeeCategory> list = k3CategoryLogic.list(keyword, pageNum, pageSize);
        return ResponseHelper.success(list);
    }
}
