| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.product.integration.controller; |
| | | |
| | | import com.product.admin.config.SystemCode; |
| | | import com.product.core.config.CoreConst; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.entity.RequestParameterEntity; |
| | | import com.product.core.exception.BaseException; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.integration.config.CmnConst; |
| | | import com.product.integration.service.InterfaceIntegrationService; |
| | | import com.product.integration.service.idel.IInterfaceIntegrationService; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.util.BaseUtil; |
| | | import com.product.util.support.AbstractBaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * å®ç°åè½ï¼ |
| | | * |
| | | * @author ä½è
[å¤ä¸¶å
] |
| | | * @version 1.0.00 2025-12-01 11:15 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/interface-integration") |
| | | public class InterfaceIntegrationController extends AbstractBaseController { |
| | | |
| | | @Autowired |
| | | private InterfaceIntegrationService interfaceIntegrationService; |
| | | |
| | | @RequestMapping(value = "/save/{version}") |
| | | @ApiVersion(1) |
| | | public String save(HttpServletRequest request) { |
| | | try { |
| | | FieldSetEntity fse = null; |
| | | Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if (bean != null) { |
| | | RequestParameterEntity reqp = (RequestParameterEntity) bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | if (bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | return error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | } |
| | | if (fse.getTableName() == null || !CmnConst.PRODUCT_SYS_INTERFACE_INTEGRATION.equals(fse.getTableName())) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | return error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | } |
| | | IInterfaceIntegrationService service = (IInterfaceIntegrationService) getProxyInstance(interfaceIntegrationService); |
| | | return BaseUtil.success(service.save(fse)); |
| | | } catch (BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return error(e.getCode(), e.getMessageInfo()); |
| | | } catch (Exception e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return error(e.getMessage()); |
| | | } |
| | | } |
| | | } |