package com.gree.mall.manager.controller.websit;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.manager.helper.ResponseHelper;
import com.gree.mall.manager.logic.websit.WebsitLogic;
import com.gree.mall.manager.plus.entity.AdminWebsit;
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;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Slf4j
@RestController
@Api(value = "网点", tags = {"网点"})
@RequestMapping(value = "/websit", produces = "application/json; charset=utf-8")
public class WebsitController {
    @Autowired
    private WebsitLogic websitLogic;

    @GetMapping("/list")
    @ApiOperation(value = "网点列表")
    public ResponseHelper<Page<AdminWebsit>> list(
            HttpServletRequest request,
            @ApiParam(value = "页号", required = true) @RequestParam(required = true) Integer pageNum,
            @ApiParam(value = "页大小", required = true) @RequestParam(required = true) Integer pageSize
    ) {
        IPage<AdminWebsit> list = websitLogic.list(request, pageNum, pageSize);
        return ResponseHelper.success(list);
    }


//    @GetMapping("/position/list")
//    @ApiOperation(value = "职位列表")
//    public ResponseHelper<Page<EnterpriseWechatWorker>> positionList(
//            @ApiParam(value = "页号", required = false) @RequestParam(required = false) Integer pageNum,
//            @ApiParam(value = "页大小", required = false) @RequestParam(required = false) Integer pageSize
//    ) {
//        IPage<EnterpriseWechatWorker> list = websitLogic.positionList(pageNum, pageSize);
//        return ResponseHelper.success(list);
//    }


}
