wuxw
2024-06-11 f85b3a58c4535493d41efe71049be1086d62867f
service-api/src/main/java/com/java110/api/controller/component/CallComponentController.java
@@ -20,6 +20,7 @@
import com.java110.core.base.controller.BaseController;
import com.java110.core.context.IPageData;
import com.java110.core.context.PageData;
import com.java110.core.language.Java110Lang;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.exception.SMOException;
import com.java110.utils.factory.ApplicationContextFactory;
@@ -28,7 +29,7 @@
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -68,6 +69,7 @@
     */
    @RequestMapping(path = "/callComponent/{api}")
    @Java110Lang
    public ResponseEntity<String> callApi(
            @PathVariable String api,
            //@RequestBody String info,
@@ -111,7 +113,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg = e.getMessage();
                msg ="调用异常";
            }
            responseEntity = new ResponseEntity<>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {
@@ -138,6 +140,7 @@
     */
    @RequestMapping(path = "/callComponent/{componentCode}/{componentMethod}")
    @Java110Lang
    public ResponseEntity<String> callComponent(
            @PathVariable String componentCode,
            @PathVariable String componentMethod,
@@ -182,7 +185,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg = e.getMessage();
                msg ="调用异常";
            }
            responseEntity = new ResponseEntity<>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {
@@ -210,6 +213,7 @@
     */
    @RequestMapping(path = "/callComponent/upload/{componentCode}/{componentMethod}")
    @Java110Lang
    public ResponseEntity<String> callComponentUploadFile(
            @PathVariable String componentCode,
            @PathVariable String componentMethod,
@@ -254,7 +258,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg = e.getMessage();
                msg ="调用异常";
            }
            responseEntity = new ResponseEntity<>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {
@@ -279,6 +283,7 @@
     */
    @RequestMapping(path = "/callComponent/download/{componentCode}/{componentMethod}")
    @Java110Lang
    public ResponseEntity<Object> callComponentDownloadFile(
            @PathVariable String componentCode,
            @PathVariable String componentMethod,
@@ -316,7 +321,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg = e.getMessage();
                msg ="调用异常";
            }
            responseEntity = new ResponseEntity<Object>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {
@@ -352,7 +357,7 @@
        }
        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(),
                reqData, pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(), "");
                reqData, pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(), pd.getAppId());
        return newPd;
    }