package cn.hanghui.outapi.platform.wuxiairport.controller;

import cn.hanghui.outapi.platform.wuxiairport.entity.dto.PushPersonInfoDto;
import cn.hanghui.outapi.platform.wuxiairport.rest.PushPersonInfoResult;
import cn.hanghui.outapi.platform.wuxiairport.service.PersonInfoService;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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;

@Api(tags = "自助办证机人员信息服务")
@Slf4j
@RestController
@RequestMapping("personInfo")
@AllArgsConstructor(onConstructor_ = @Autowired)
public class PersonInfoController {

    private final PersonInfoService personInfoService;

    /**
     * 自助办证机人员信息推送
     *
     * @param pushPersonInfoDto PushPersonInfoDto
     * @return JSONObject
     */
    @ApiOperation("自助办证机人员信息推送")
    @PostMapping("pushPersonInfo")
    public PushPersonInfoResult pushPersonInfo(@RequestBody PushPersonInfoDto pushPersonInfoDto) {
        log.info("---自助办证机人员信息推送---" + JSON.toJSONString(pushPersonInfoDto));
        personInfoService.pushPersonInfo(pushPersonInfoDto);
        return PushPersonInfoResult.ok();
    }
}
