package com.engine.htsc.ccwg.web;

import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.htsc.ccwg.service.Upload2StorageGatewayService;
import com.engine.htsc.ccwg.service.impl.Upload2StorageGatewayServiceImpl;

import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.hrm.resource.ResourceComInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.Map;

/**
 *
 */


public class Upload2StorageGatewayAction {

    public Upload2StorageGatewayService getService(){
        return ServiceUtil.getService(Upload2StorageGatewayServiceImpl.class);
    }

    /**
     * 看阅新门户集成接口，列表数据
     * @param request
     * @param response
     * @return
     */
    @GET
    @Path("/uploaddoc")
    @Produces({MediaType.TEXT_PLAIN})
    public String getkanyuelist(@Context HttpServletRequest request, @Context HttpServletResponse response){

        BaseBean bb = new BaseBean();
        String htuserid = request.getHeader("iv-user");
        bb.writeLog("htuserid:"+htuserid);

        Map<String,Object> apidatas = new HashMap<String,Object>();
        try {
            Map<String,Object> param = ParamUtil.request2Map(request);
            apidatas = getService().uploaddoc(param);
        } catch (Exception e) {
            e.printStackTrace();
            apidatas.put("api_status", false);
            apidatas.put("api_errormsg", "catch exception : " + e.getMessage());
        }
        return JSONObject.toJSONString(apidatas);
    }





}
