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


import com.fzm.mall.server.admin.distribution.entity.dto.DictCnProvinceDTO;
import com.fzm.mall.server.admin.distribution.service.IDictCnProvinceService;
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 lombok.RequiredArgsConstructor;
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.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wulixian
 * @since 2021-04-06
 */
@Api(tags = "商户-物流中心")
@RestController
@RequestMapping("/dict-cn-province/templatePermission")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class DictCnProvinceController {

    private final IDictCnProvinceService provinceService;
    private final ResponseFactory resFac;

    @ApiOperation(value = "物流中心-地理行政地区-列表查询")
    @ApiOperationSupport(order = 1)
    @GetMapping("/list")
    public ResponseVO list() {
        List<DictCnProvinceDTO> result = provinceService.listAll();
        return resFac.getSuccessResponseWithData(result);
    }

}
