Quellcode durchsuchen

api注册的时候添加路由和应用

lidongyang vor 5 Jahren
Ursprung
Commit
61607940b9

+ 20 - 0
src/main/java/com/lightinit/hsdataplatform/common/SysContants.java

@@ -85,4 +85,24 @@ public class SysContants {
         public static final String LIST = "list";
     }
 
+    public static class GatewayPath{
+
+        public final static String HSDATAGATEWAYAPP = "/hsdatagatewayapp" ;
+
+        public final static String GATEWAYURL = "gatewayUrl" ;
+
+        public static final String GETGATEWAYURL = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.GatewayPath.GATEWAYURL) ;
+        // 添加路由接口
+        public final static String GATEWAYURL_ROUTESAVE = GETGATEWAYURL + "/routesave" ;
+        // 添加应用接口
+        public final static String GATEWAYURL_APPSAVE = GETGATEWAYURL + "/appsave" ;
+        // 添加签名
+        public final static String GATEWAYURL_SIGINSAVE = GETGATEWAYURL + "/signsave" ;
+        // 添加鉴权
+        public final static String GATEWAYURL_AUTHSAVE = GETGATEWAYURL + "/authsave" ;
+        // 添加计费
+        public final static String GATEWAYURL_CHARGESAVE = GETGATEWAYURL + "/chargesave" ;
+
+    }
+
 }

+ 26 - 1
src/main/java/com/lightinit/hsdataplatform/controller/admin/DataRegisterAPIController.java

@@ -1,6 +1,7 @@
 package com.lightinit.hsdataplatform.controller.admin;
 
 import com.lightinit.hsdataplatform.common.HttpUtil;
+import com.lightinit.hsdataplatform.common.SysContants;
 import com.lightinit.hsdataplatform.dictionary.*;
 import com.lightinit.hsdataplatform.entity.BaseExample;
 import com.lightinit.hsdataplatform.entity.ResourceApiInterfaceInput;
@@ -23,6 +24,7 @@ import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpSession;
 import javax.validation.Valid;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -97,7 +99,7 @@ public class DataRegisterAPIController extends BaseController{
 
     @RequestMapping(value = "apiInterface_add_finally.action")
     @ResponseBody
-    public ResultState apiInterface_add_finally(@Valid ResourceAPIRegisterAddResourceModel addResourceModel, BindingResult bindingResult, HttpSession session){
+    public ResultState apiInterface_add_finally(@Valid ResourceAPIRegisterAddResourceModel addResourceModel, BindingResult bindingResult, HttpSession session) throws Exception {
         if (bindingResult.hasErrors()){
             return getAllFieldInvalidResultState(addResourceModel, bindingResult);
         }
@@ -105,6 +107,29 @@ public class DataRegisterAPIController extends BaseController{
         ResultState<Long> resultState = resourceAPIRegisterService.apiInterface_add_finally(addResourceModel,loginUser.getId(),loginUser.getUsername()) ;
         return resultState ;
     }
+//    @RequestMapping(value = "apiInterface_add_finally.action")
+//    @ResponseBody
+//    public ResultState apiInterface_add_finally( ResourceAPIRegisterAddResourceModel addResourceModel, BindingResult bindingResult, HttpSession session) throws Exception {
+//        if (bindingResult.hasErrors()){
+//            return getAllFieldInvalidResultState(addResourceModel, bindingResult);
+//        }
+//        ResultState resultState = new ResultState() ;
+//        Map<String, String> map = new HashMap<>();
+//        // 路由名称
+//        map.put("routeName", "1啊哈");
+//        // 上下文路径
+//        map.put("contextPath", "1111111");
+//        // 映射路径
+//        map.put("mappingUrl", "6666");
+
+        // heads
+//        Map<String, String> heads = new HashMap<>();
+//        heads.put("Content-Type","application/x-www-form-urlencoded") ;
+//        String str = HttpUtil.httpPost(SysContants.GatewayPath.GATEWAYURL_ROUTESAVE, null, map);
+//        Map<String, Object> map1 = HttpUtil.strToMap(str);
+//        resultState.setData(map1);
+//       return resultState ;
+//    }
 
     @RequestMapping(value = "edit.htm/{id}")
     public ModelAndView edit(@PathVariable long id){

+ 23 - 3
src/main/java/com/lightinit/hsdataplatform/entity/ResourceApiInterface.java

@@ -11,7 +11,7 @@ public class ResourceApiInterface {
 
     private String interfaceIdentity;
 
-    private Byte isAuth;
+    private Boolean isAuth;
 
     private String requestMethod;
 
@@ -25,6 +25,10 @@ public class ResourceApiInterface {
 
     private Long deletedBy;
 
+    private String routeId;
+
+    private String appId;
+
     public Long getId() {
         return id;
     }
@@ -57,11 +61,11 @@ public class ResourceApiInterface {
         this.interfaceIdentity = interfaceIdentity == null ? null : interfaceIdentity.trim();
     }
 
-    public Byte getIsAuth() {
+    public Boolean getIsAuth() {
         return isAuth;
     }
 
-    public void setIsAuth(Byte isAuth) {
+    public void setIsAuth(Boolean isAuth) {
         this.isAuth = isAuth;
     }
 
@@ -112,4 +116,20 @@ public class ResourceApiInterface {
     public void setDeletedBy(Long deletedBy) {
         this.deletedBy = deletedBy;
     }
+
+    public String getRouteId() {
+        return routeId;
+    }
+
+    public void setRouteId(String routeId) {
+        this.routeId = routeId == null ? null : routeId.trim();
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId == null ? null : appId.trim();
+    }
 }

+ 151 - 11
src/main/java/com/lightinit/hsdataplatform/entity/ResourceApiInterfaceExample.java

@@ -4,7 +4,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-public class ResourceApiInterfaceExample extends BaseExample {
+public class ResourceApiInterfaceExample {
     protected String orderByClause;
 
     protected boolean distinct;
@@ -375,52 +375,52 @@ public class ResourceApiInterfaceExample extends BaseExample {
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthEqualTo(Byte value) {
+        public Criteria andIsAuthEqualTo(Boolean value) {
             addCriterion("is_auth =", value, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthNotEqualTo(Byte value) {
+        public Criteria andIsAuthNotEqualTo(Boolean value) {
             addCriterion("is_auth <>", value, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthGreaterThan(Byte value) {
+        public Criteria andIsAuthGreaterThan(Boolean value) {
             addCriterion("is_auth >", value, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthGreaterThanOrEqualTo(Byte value) {
+        public Criteria andIsAuthGreaterThanOrEqualTo(Boolean value) {
             addCriterion("is_auth >=", value, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthLessThan(Byte value) {
+        public Criteria andIsAuthLessThan(Boolean value) {
             addCriterion("is_auth <", value, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthLessThanOrEqualTo(Byte value) {
+        public Criteria andIsAuthLessThanOrEqualTo(Boolean value) {
             addCriterion("is_auth <=", value, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthIn(List<Byte> values) {
+        public Criteria andIsAuthIn(List<Boolean> values) {
             addCriterion("is_auth in", values, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthNotIn(List<Byte> values) {
+        public Criteria andIsAuthNotIn(List<Boolean> values) {
             addCriterion("is_auth not in", values, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthBetween(Byte value1, Byte value2) {
+        public Criteria andIsAuthBetween(Boolean value1, Boolean value2) {
             addCriterion("is_auth between", value1, value2, "isAuth");
             return (Criteria) this;
         }
 
-        public Criteria andIsAuthNotBetween(Byte value1, Byte value2) {
+        public Criteria andIsAuthNotBetween(Boolean value1, Boolean value2) {
             addCriterion("is_auth not between", value1, value2, "isAuth");
             return (Criteria) this;
         }
@@ -804,6 +804,146 @@ public class ResourceApiInterfaceExample extends BaseExample {
             addCriterion("deleted_by not between", value1, value2, "deletedBy");
             return (Criteria) this;
         }
+
+        public Criteria andRouteIdIsNull() {
+            addCriterion("route_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdIsNotNull() {
+            addCriterion("route_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdEqualTo(String value) {
+            addCriterion("route_id =", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdNotEqualTo(String value) {
+            addCriterion("route_id <>", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdGreaterThan(String value) {
+            addCriterion("route_id >", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdGreaterThanOrEqualTo(String value) {
+            addCriterion("route_id >=", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdLessThan(String value) {
+            addCriterion("route_id <", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdLessThanOrEqualTo(String value) {
+            addCriterion("route_id <=", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdLike(String value) {
+            addCriterion("route_id like", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdNotLike(String value) {
+            addCriterion("route_id not like", value, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdIn(List<String> values) {
+            addCriterion("route_id in", values, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdNotIn(List<String> values) {
+            addCriterion("route_id not in", values, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdBetween(String value1, String value2) {
+            addCriterion("route_id between", value1, value2, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRouteIdNotBetween(String value1, String value2) {
+            addCriterion("route_id not between", value1, value2, "routeId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdIsNull() {
+            addCriterion("app_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdIsNotNull() {
+            addCriterion("app_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdEqualTo(String value) {
+            addCriterion("app_id =", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdNotEqualTo(String value) {
+            addCriterion("app_id <>", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdGreaterThan(String value) {
+            addCriterion("app_id >", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdGreaterThanOrEqualTo(String value) {
+            addCriterion("app_id >=", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdLessThan(String value) {
+            addCriterion("app_id <", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdLessThanOrEqualTo(String value) {
+            addCriterion("app_id <=", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdLike(String value) {
+            addCriterion("app_id like", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdNotLike(String value) {
+            addCriterion("app_id not like", value, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdIn(List<String> values) {
+            addCriterion("app_id in", values, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdNotIn(List<String> values) {
+            addCriterion("app_id not in", values, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdBetween(String value1, String value2) {
+            addCriterion("app_id between", value1, value2, "appId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAppIdNotBetween(String value1, String value2) {
+            addCriterion("app_id not between", value1, value2, "appId");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 34 - 1
src/main/java/com/lightinit/hsdataplatform/impl/admin/ResourceAPIRegisterServiceImpl.java

@@ -1,5 +1,7 @@
 package com.lightinit.hsdataplatform.impl.admin;
 
+import com.lightinit.hsdataplatform.common.HttpUtil;
+import com.lightinit.hsdataplatform.common.SysContants;
 import com.lightinit.hsdataplatform.dictionary.DicResourceType;
 import com.lightinit.hsdataplatform.entity.*;
 import com.lightinit.hsdataplatform.mapper.*;
@@ -15,7 +17,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class ResourceAPIRegisterServiceImpl implements IResourceAPIRegisterService {
@@ -57,7 +61,7 @@ public class ResourceAPIRegisterServiceImpl implements IResourceAPIRegisterServi
 
     @Override
     @Transactional
-    public ResultState<Long> apiInterface_add_finally(ResourceAPIRegisterAddResourceModel addResourceModel,Long userId,String userName) {
+    public ResultState<Long> apiInterface_add_finally(ResourceAPIRegisterAddResourceModel addResourceModel,Long userId,String userName) throws Exception {
         DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
         ResultState<Long> resultState = new ResultState<Long>();
         Date createdAt = new Date();
@@ -83,12 +87,41 @@ public class ResourceAPIRegisterServiceImpl implements IResourceAPIRegisterServi
         if (!addAPIInterfaceModels.isEmpty() && addAPIInterfaceModels.size() > 0) {
             for (ResourceAPIRegisterAddAPIInterfaceModel addAPIInterfaceModel : addAPIInterfaceModels) {
                 if (StringUtils.isNotEmpty(addAPIInterfaceModel.getInterfaceName())) {
+                    //1。 插入网关
+                    Map<String, String> map = new HashMap<>();
+                    // 路由名称
+                    map.put("routeName", addResourceModel.getResourceName());
+                    String url =  addAPIInterfaceModel.getUrl() ;
+                    if (StringUtils.isNotEmpty(url)){
+                        String newUrl = null ;
+                        // 映射路径
+                        url.replace("https://", "");
+                        if (url.contains("http://")){
+                            newUrl =  url.replace("http://", "") ;
+                        }
+                        if (url.contains("https://")){
+                            newUrl =   url.replace("https://", "") ;
+                        }
+                        int i = newUrl.indexOf("/");
+                        String substring = newUrl.substring(i, newUrl.length());
+                        // 上下文路径
+                        map.put("contextPath", SysContants.GatewayPath.HSDATAGATEWAYAPP+substring);
+                        // 映射URL
+                        map.put("mappingUrl", url);
+                    }
+                    String str = HttpUtil.httpPost(SysContants.GatewayPath.GATEWAYURL_ROUTESAVE, null, map);
+                    //2。插入应用
+                    Map<String, String> map1 = new HashMap<>();
+                    map1.put("appName",addResourceModel.getResourceName()) ;
+                    String str1 = HttpUtil.httpPost(SysContants.GatewayPath.GATEWAYURL_APPSAVE, null, map);
                     //插入resouse_interface表
                     ResourceApiInterfaceWithBLOBs entity3 = new ResourceApiInterfaceWithBLOBs();
                     BeanUtils.copyProperties(addAPIInterfaceModel, entity3);
                     entity3.setApiId(entity1.getId());
                     entity3.setCreatedAt(createdAt);
                     entity3.setCreatedBy(userId);
+                    entity3.setRouteId(str);
+                    entity3.setAppId(str1);
                     int sqlResult3 = resourceApiInterfaceMapper.insert(entity3);
                     //取得输入接口输入参数
                     if (addAPIInterfaceModel.getInterfaceInputModelList()!=null) {

+ 1 - 1
src/main/java/com/lightinit/hsdataplatform/service/admin/IResourceAPIRegisterService.java

@@ -15,7 +15,7 @@ public interface IResourceAPIRegisterService {
 
     long queryCount(ResourceAPIRegisterSearchModel inputModel);
 
-    ResultState<Long> apiInterface_add_finally(ResourceAPIRegisterAddResourceModel addResourceModel,Long userId,String userName);
+    ResultState<Long> apiInterface_add_finally(ResourceAPIRegisterAddResourceModel addResourceModel,Long userId,String userName) throws Exception;
 
     ResultState<Long> delete(long id);
 

+ 2 - 0
src/main/resources/config.properties

@@ -86,3 +86,5 @@ fluxToken = Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVz
 db=k8s
 q=SELECT "value" FROM "network/tx_rate" WHERE "type" = 'node' AND "nodename" = '172.17.218.221' order by "time" DESC LIMIT 1
 
+# 对接服务网关前缀地址
+gatewayUrl=http://localhost:8080/gateway/interface

+ 3 - 3
src/main/resources/mybatis-generator/generatorConfig.xml

@@ -149,9 +149,9 @@
         <!--<table tableName="resource_api">-->
             <!--<generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
         <!--</table>-->
-        <!--<table tableName="resource_api_interface">-->
-            <!--<generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
-        <!--</table>-->
+<!--        <table tableName="resource_api_interface">-->
+<!--            <generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
+<!--        </table>-->
         <!--<table tableName="resource_api_interface_input">-->
             <!--<generatedKey column="id" sqlStatement="MySql" identity="true"/>-->
         <!--</table>-->

+ 53 - 16
src/main/resources/sqlmaps/ResourceApiInterfaceMapper.xml

@@ -6,13 +6,15 @@
     <result column="api_id" jdbcType="BIGINT" property="apiId" />
     <result column="interface_name" jdbcType="VARCHAR" property="interfaceName" />
     <result column="interface_identity" jdbcType="VARCHAR" property="interfaceIdentity" />
-    <result column="is_auth" jdbcType="TINYINT" property="isAuth" />
+    <result column="is_auth" jdbcType="BIT" property="isAuth" />
     <result column="request_method" jdbcType="VARCHAR" property="requestMethod" />
     <result column="response_format" jdbcType="VARCHAR" property="responseFormat" />
     <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
     <result column="created_by" jdbcType="BIGINT" property="createdBy" />
     <result column="deleted_at" jdbcType="TIMESTAMP" property="deletedAt" />
     <result column="deleted_by" jdbcType="BIGINT" property="deletedBy" />
+    <result column="route_id" jdbcType="VARCHAR" property="routeId" />
+    <result column="app_id" jdbcType="VARCHAR" property="appId" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.lightinit.hsdataplatform.entity.ResourceApiInterfaceWithBLOBs">
     <result column="url" jdbcType="LONGVARCHAR" property="url" />
@@ -80,7 +82,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, api_id, interface_name, interface_identity, is_auth, request_method, response_format, 
-    created_at, created_by, deleted_at, deleted_by
+    created_at, created_by, deleted_at, deleted_by, route_id, app_id
   </sql>
   <sql id="Blob_Column_List">
     url, request_demo, response_demo, remark
@@ -140,13 +142,15 @@
     insert into resource_api_interface (api_id, interface_name, interface_identity, 
       is_auth, request_method, response_format, 
       created_at, created_by, deleted_at, 
-      deleted_by, url, request_demo, 
-      response_demo, remark)
+      deleted_by, route_id, app_id, 
+      url, request_demo, response_demo, 
+      remark)
     values (#{apiId,jdbcType=BIGINT}, #{interfaceName,jdbcType=VARCHAR}, #{interfaceIdentity,jdbcType=VARCHAR}, 
-      #{isAuth,jdbcType=TINYINT}, #{requestMethod,jdbcType=VARCHAR}, #{responseFormat,jdbcType=VARCHAR}, 
+        0, #{requestMethod,jdbcType=VARCHAR}, #{responseFormat,jdbcType=VARCHAR},
       #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{deletedAt,jdbcType=TIMESTAMP}, 
-      #{deletedBy,jdbcType=BIGINT}, #{url,jdbcType=LONGVARCHAR}, #{requestDemo,jdbcType=LONGVARCHAR}, 
-      #{responseDemo,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR})
+      #{deletedBy,jdbcType=BIGINT}, #{routeId,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, 
+      #{url,jdbcType=LONGVARCHAR}, #{requestDemo,jdbcType=LONGVARCHAR}, #{responseDemo,jdbcType=LONGVARCHAR}, 
+      #{remark,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.lightinit.hsdataplatform.entity.ResourceApiInterfaceWithBLOBs">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -184,6 +188,12 @@
       <if test="deletedBy != null">
         deleted_by,
       </if>
+      <if test="routeId != null">
+        route_id,
+      </if>
+      <if test="appId != null">
+        app_id,
+      </if>
       <if test="url != null">
         url,
       </if>
@@ -208,7 +218,7 @@
         #{interfaceIdentity,jdbcType=VARCHAR},
       </if>
       <if test="isAuth != null">
-        #{isAuth,jdbcType=TINYINT},
+        #{isAuth,jdbcType=BIT},
       </if>
       <if test="requestMethod != null">
         #{requestMethod,jdbcType=VARCHAR},
@@ -228,6 +238,12 @@
       <if test="deletedBy != null">
         #{deletedBy,jdbcType=BIGINT},
       </if>
+      <if test="routeId != null">
+        #{routeId,jdbcType=VARCHAR},
+      </if>
+      <if test="appId != null">
+        #{appId,jdbcType=VARCHAR},
+      </if>
       <if test="url != null">
         #{url,jdbcType=LONGVARCHAR},
       </if>
@@ -264,7 +280,7 @@
         interface_identity = #{record.interfaceIdentity,jdbcType=VARCHAR},
       </if>
       <if test="record.isAuth != null">
-        is_auth = #{record.isAuth,jdbcType=TINYINT},
+        is_auth = #{record.isAuth,jdbcType=BIT},
       </if>
       <if test="record.requestMethod != null">
         request_method = #{record.requestMethod,jdbcType=VARCHAR},
@@ -284,6 +300,12 @@
       <if test="record.deletedBy != null">
         deleted_by = #{record.deletedBy,jdbcType=BIGINT},
       </if>
+      <if test="record.routeId != null">
+        route_id = #{record.routeId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.appId != null">
+        app_id = #{record.appId,jdbcType=VARCHAR},
+      </if>
       <if test="record.url != null">
         url = #{record.url,jdbcType=LONGVARCHAR},
       </if>
@@ -307,13 +329,15 @@
       api_id = #{record.apiId,jdbcType=BIGINT},
       interface_name = #{record.interfaceName,jdbcType=VARCHAR},
       interface_identity = #{record.interfaceIdentity,jdbcType=VARCHAR},
-      is_auth = #{record.isAuth,jdbcType=TINYINT},
+      is_auth = #{record.isAuth,jdbcType=BIT},
       request_method = #{record.requestMethod,jdbcType=VARCHAR},
       response_format = #{record.responseFormat,jdbcType=VARCHAR},
       created_at = #{record.createdAt,jdbcType=TIMESTAMP},
       created_by = #{record.createdBy,jdbcType=BIGINT},
       deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
       deleted_by = #{record.deletedBy,jdbcType=BIGINT},
+      route_id = #{record.routeId,jdbcType=VARCHAR},
+      app_id = #{record.appId,jdbcType=VARCHAR},
       url = #{record.url,jdbcType=LONGVARCHAR},
       request_demo = #{record.requestDemo,jdbcType=LONGVARCHAR},
       response_demo = #{record.responseDemo,jdbcType=LONGVARCHAR},
@@ -328,13 +352,15 @@
       api_id = #{record.apiId,jdbcType=BIGINT},
       interface_name = #{record.interfaceName,jdbcType=VARCHAR},
       interface_identity = #{record.interfaceIdentity,jdbcType=VARCHAR},
-      is_auth = #{record.isAuth,jdbcType=TINYINT},
+      is_auth = #{record.isAuth,jdbcType=BIT},
       request_method = #{record.requestMethod,jdbcType=VARCHAR},
       response_format = #{record.responseFormat,jdbcType=VARCHAR},
       created_at = #{record.createdAt,jdbcType=TIMESTAMP},
       created_by = #{record.createdBy,jdbcType=BIGINT},
       deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
-      deleted_by = #{record.deletedBy,jdbcType=BIGINT}
+      deleted_by = #{record.deletedBy,jdbcType=BIGINT},
+      route_id = #{record.routeId,jdbcType=VARCHAR},
+      app_id = #{record.appId,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -352,7 +378,7 @@
         interface_identity = #{interfaceIdentity,jdbcType=VARCHAR},
       </if>
       <if test="isAuth != null">
-        is_auth = #{isAuth,jdbcType=TINYINT},
+        is_auth = #{isAuth,jdbcType=BIT},
       </if>
       <if test="requestMethod != null">
         request_method = #{requestMethod,jdbcType=VARCHAR},
@@ -372,6 +398,12 @@
       <if test="deletedBy != null">
         deleted_by = #{deletedBy,jdbcType=BIGINT},
       </if>
+      <if test="routeId != null">
+        route_id = #{routeId,jdbcType=VARCHAR},
+      </if>
+      <if test="appId != null">
+        app_id = #{appId,jdbcType=VARCHAR},
+      </if>
       <if test="url != null">
         url = #{url,jdbcType=LONGVARCHAR},
       </if>
@@ -392,13 +424,15 @@
     set api_id = #{apiId,jdbcType=BIGINT},
       interface_name = #{interfaceName,jdbcType=VARCHAR},
       interface_identity = #{interfaceIdentity,jdbcType=VARCHAR},
-      is_auth = #{isAuth,jdbcType=TINYINT},
+      is_auth = #{isAuth,jdbcType=BIT},
       request_method = #{requestMethod,jdbcType=VARCHAR},
       response_format = #{responseFormat,jdbcType=VARCHAR},
       created_at = #{createdAt,jdbcType=TIMESTAMP},
       created_by = #{createdBy,jdbcType=BIGINT},
       deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
       deleted_by = #{deletedBy,jdbcType=BIGINT},
+      route_id = #{routeId,jdbcType=VARCHAR},
+      app_id = #{appId,jdbcType=VARCHAR},
       url = #{url,jdbcType=LONGVARCHAR},
       request_demo = #{requestDemo,jdbcType=LONGVARCHAR},
       response_demo = #{responseDemo,jdbcType=LONGVARCHAR},
@@ -410,15 +444,18 @@
     set api_id = #{apiId,jdbcType=BIGINT},
       interface_name = #{interfaceName,jdbcType=VARCHAR},
       interface_identity = #{interfaceIdentity,jdbcType=VARCHAR},
-      is_auth = #{isAuth,jdbcType=TINYINT},
+      is_auth = #{isAuth,jdbcType=BIT},
       request_method = #{requestMethod,jdbcType=VARCHAR},
       response_format = #{responseFormat,jdbcType=VARCHAR},
       created_at = #{createdAt,jdbcType=TIMESTAMP},
       created_by = #{createdBy,jdbcType=BIGINT},
       deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
-      deleted_by = #{deletedBy,jdbcType=BIGINT}
+      deleted_by = #{deletedBy,jdbcType=BIGINT},
+      route_id = #{routeId,jdbcType=VARCHAR},
+      app_id = #{appId,jdbcType=VARCHAR}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
   <select id="queryIdByAPIid" resultType="java.lang.Long">
     SELECT id
     FROM resource_api_interface