package com.muyu.data.mart.service.controller;

import com.muyu.data.mart.common.BasicApi;
import com.muyu.data.mart.domain.realname.RealNameReq;
import com.muyu.data.mart.domain.realname.RealNameResp;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：chaiyapeng
 * @Package：com.muyu.data.mart.service.controller
 * @Project：cloud-port
 * @name：RealNameController
 * @Date：2024/9/9 16:29
 */
@RestController
@RequestMapping("/juhe")
public class RealNameController {
    @Resource(name = "juhe-real-name")
    private BasicApi<RealNameReq, RealNameResp> respBasicApi;

    @PostMapping("/real/name")
    public RealNameResp realName(@RequestBody RealNameReq realNameReq) {
        RealNameResp realNameResp = null;
        try {
            realNameResp = respBasicApi.send(realNameReq);
            return realNameResp;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
