package com.iformall.controller.basic;

import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.service.WxMerchantBUserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("wxMerchantBUser")
public class WxMerchantBUserController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private WxMerchantBUserService wxMerchantBUserService;

    @ApiOperation("手机号是否存在")
    @GetMapping("/hasphone")
    @ApiImplicitParam(name = "phone", value = "phone", dataType = "String", paramType = "query", required = true)
    public ResultData hasphone(String phone) {
        logger.debug("[" + getIpAddr() + "] WxMerchantBUserController::hasphone");
        boolean has = wxMerchantBUserService.hasphone(phone, getTenantId());
        return new ResultData(Result.SUCCESS, "查询成功", has);
    }

}
