package com.yx.face.controller.admin;


import com.yx.face.controller.dto.WxInfoDTO;
import com.yx.face.service.WeiXinApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @description: 管理人员信息表(Admin)表控制层 <br>
 * @author: PWB <br>
 * @since: 1.0 <br>
 * @date: 2021-05-21 13:37:01 <br>
 */

@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(tags = "B 微信手机号获取")
@RestController
@RequestMapping("/weiXin")
public class WinXinController {

    private final WeiXinApiService weiXinApiService;

    @ApiOperation(value = "获取微信用户绑定的手机号")
    @PostMapping("/getPhone")
    public Map<String, String> getWeiXin(@RequestBody WxInfoDTO dto) {
        Map<String, String> mas = new HashMap<>();
        if (dto == null) {
            mas.put("code","500");
            return mas;
        }
        Map<String, String> weiXin = weiXinApiService.getWeiXin(dto);
        return weiXin;
    }
}

