package com.iformall.controller;

import com.iformall.common.ResultData;
import com.iformall.service.WxMerchantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.RestController;

@RestController
@RequestMapping("/api/merchant")
@Api(description = "商户相关接口")
@Slf4j
public class WxMerchantController extends BaseController {

    @Autowired
    private WxMerchantService wxMerchantService;

    @ApiOperation("查询当前租户下商户名称列表")
    @GetMapping("/name_list")
    public ResultData nameList() {
        log.debug("[" + getIpAddr() + "] WxMerchantController::name_list");
        return new ResultData(wxMerchantService.findList(getTenantId()));
    }

}
