package com.hr.controller;

import com.hr.dto.EsignParmDto;
import com.hr.dto.EsignReturnDto;
import com.hr.repository.service.EsignService;
import com.yy.basedevelop.common.data.BaseReturnDto;
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;
import reactor.core.publisher.Mono;

/**
 * @author yaoy
 * @createTime 2025/10/17 11:55
 **/
@Slf4j
@RestController
@RequestMapping("/esign")
public class EsignController {
    @Autowired
    private EsignService esignService;
    /***
     * 通过e签宝进行签名
     * @param parm
     * @return
     */
    @PostMapping("platform")
    public Mono<BaseReturnDto<EsignReturnDto>> platformSignByPdfStream(@RequestBody EsignParmDto parm){
        return Mono.just(esignService.platformSignByPdfStream(parm));
    }


    /***
     * 本地签名，不通过e签宝
     * @param parm
     * @return
     */
    @PostMapping("hrSign")
    public Mono<BaseReturnDto<EsignReturnDto>> hrSignByPdfStream(@RequestBody EsignParmDto parm){
        return Mono.just(esignService.hrSignByPdfStream(parm));
    }

}
