package com.fzm.mall.server.admin.distribution.controller;


import com.fzm.mall.server.admin.distribution.entity.dto.AddressDTO;
import com.fzm.mall.server.admin.distribution.model.Express;
import com.fzm.mall.server.admin.distribution.service.IAddressService;
import com.fzm.mall.server.admin.distribution.service.IExpressService;
import com.fzm.mall.server.admin.home_page.model.Admin;
import com.fzm.mall.server.admin.home_page.service.IAdminService;
import com.fzm.mall.server.admin.repo.ResponseFactory;
import com.fzm.mall.server.admin.repo.ResponseVO;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 物流中心-物流公司 前端控制器
 * </p>
 *
 * @author wulixian
 * @since 2021-04-15
 */
@Api(tags = "商户-物流中心")
@RestController
@RequestMapping("/express")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ExpressController {

    private final IExpressService expressService;
    private final ResponseFactory resFac;

    @ApiOperation(value = "物流中心-物流公司-列表查询")
    @ApiOperationSupport(order = 1)
    @GetMapping("/list")
    public ResponseVO listAll(@ApiParam(value = "物流公司名称") @RequestParam(required = false) String expName) {
        List<Express> result = expressService.listAll(expName);
        return resFac.getSuccessResponseWithData(result);
    }
}
