package com.engine.htsc.seal.web;

import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil;
import com.engine.htsc.seal.xctoeseal.service.XcCreateWfService;
import com.engine.htsc.seal.xctoeseal.service.impl.XcCreateWfServiceImpl;
import weaver.general.BaseBean;
import weaver.interfaces.htsc.GlobatTools.JAVATools;
import weaver.interfaces.htsc.GlobatTools.RequestJSsonUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

/**
 * @ClassName SealXcCreateWorkflowAction
 * @Author K1810015
 * @Date 2022/3/3 16:51
 * Version 1.0
 */
public class SealXcCreateWorkflowAction {

    /**
     * @title createworkflow
     * @author K1810015
     * @updateTime 2022/3/11 15:07
     * @Remark 提供信创环境下调用用印登记单接口
     * @throws
     */
    @POST
    @Path("/createworkflow")
    @Produces({MediaType.TEXT_PLAIN})
    public String createworkflow(@Context HttpServletRequest request, @Context HttpServletResponse response){
        JSONObject value=new JSONObject();
        try {
            BaseBean bs = new BaseBean();
            bs.writeLog("-------------新创环境调用-------------");
            JSONObject json = RequestJSsonUtil.getRequestJsonObject(request);
            XcCreateWfService sendManualSignService = ServiceUtil.getService(XcCreateWfServiceImpl.class);
             value= sendManualSignService.createworkflow(json);
        }catch (Exception e){

            return JAVATools.Apiretrun("400","-1");
        }
        return JAVATools.Apiretrun("200",value);
    }

}
