diff --git a/Linux服务器监听运维功能.md b/Linux服务器监听运维功能.md index 40ecb25..22f9c45 100644 --- a/Linux服务器监听运维功能.md +++ b/Linux服务器监听运维功能.md @@ -317,15 +317,6 @@ | POST | http://ip:port/background/findAllAvailableInterface | | Content-Type | application/json;charset=UTF-8 | -| 请求参数 | | | | | -| -------- | -------- | ------- | ---- | ------------------ | -| 参数项 | 名称 | 类型 | 必选 | 描述 | -| configId | 服务主键 | Integer | 是 | 主键(formdata形式) | -``` -请求示例 -"configId": 1 -``` - | 返回结果 | | | | | ------------ | -------------------- | ------ | --------------------------------- | | 参数项 | 名称 | 类型 | 描述 | @@ -375,8 +366,8 @@ ``` 请求示例 "configId": 1 -"interfaceMouldId": "start", -"params": "{"TPXX":"#file#"}", +"interfaceMouldId": 1, +"params": {"TPXX":"#file#"}, "multipartFile": xxx ``` diff --git a/src/main/java/com/objecteye/config/RestTemplateConfig.java b/src/main/java/com/objecteye/config/RestTemplateConfig.java index ad62ec9..7407d6e 100644 --- a/src/main/java/com/objecteye/config/RestTemplateConfig.java +++ b/src/main/java/com/objecteye/config/RestTemplateConfig.java @@ -22,9 +22,9 @@ public class RestTemplateConfig { public ClientHttpRequestFactory simpleClientHttpRequestFactory() { SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); //单位为ms - factory.setReadTimeout(5000); + factory.setReadTimeout(6 * 5000); //单位为ms - factory.setConnectTimeout(5000); + factory.setConnectTimeout(6 * 5000); return factory; } } diff --git a/src/main/java/com/objecteye/controller/BackGroundController.java b/src/main/java/com/objecteye/controller/BackGroundController.java index 0509872..a86d6a2 100644 --- a/src/main/java/com/objecteye/controller/BackGroundController.java +++ b/src/main/java/com/objecteye/controller/BackGroundController.java @@ -52,8 +52,8 @@ public class BackGroundController extends BasicController { @ApiOperation("sdk控制器") @RequestMapping(value = "sdkController", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) - public CommonResult sdkController(@RequestBody Map requestMap) { - return jsonObjectResultHandle(iBackGroundService.sdkController(requestMap)); + public CommonResult sdkController(@RequestParam Integer configId) { + return jsonObjectResultHandle(iBackGroundService.sdkController(configId)); } @ApiOperation("配置启动服务") @@ -96,12 +96,18 @@ public class BackGroundController extends BasicController { @ApiOperation("获取配置服务支持的所有接口信息") @RequestMapping(value = "findAllAvailableInterface", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) - public CommonResult findAllAvailableInterface(@RequestParam Integer configId) { - List syServiceInterfaceMoulds = iBackGroundService.findAllAvailableInterface(configId); + public CommonResult findAllAvailableInterface() { + List syServiceInterfaceMoulds = iBackGroundService.findAllAvailableInterface(); if (syServiceInterfaceMoulds.size() > 0) { return CommonResult.success(syServiceInterfaceMoulds); } else { return CommonResult.success(201, "未找到数据", null); } } + + @ApiOperation("获取引擎返回结果对应信息表") + @RequestMapping(value = "findVehicleResultContent", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public CommonResult findVehicleResultContent() { + return CommonResult.success(iBackGroundService.findVehicleResultContent()); + } } diff --git a/src/main/java/com/objecteye/entity/SyServiceInterfaceMould.java b/src/main/java/com/objecteye/entity/SyServiceInterfaceMould.java index 18fd1cb..536e771 100644 --- a/src/main/java/com/objecteye/entity/SyServiceInterfaceMould.java +++ b/src/main/java/com/objecteye/entity/SyServiceInterfaceMould.java @@ -10,8 +10,6 @@ public class SyServiceInterfaceMould implements Serializable { private Integer id; - private Integer mouldId; - private String methodType; private String contentType; @@ -30,14 +28,6 @@ public class SyServiceInterfaceMould implements Serializable { this.id = id; } - public Integer getMouldId() { - return mouldId; - } - - public void setMouldId(Integer mouldId) { - this.mouldId = mouldId; - } - public String getMethodType() { return methodType; } @@ -94,11 +84,6 @@ public class SyServiceInterfaceMould implements Serializable { return this; } - public Builder mouldId(Integer mouldId) { - obj.setMouldId(mouldId); - return this; - } - public Builder methodType(String methodType) { obj.setMethodType(methodType); return this; @@ -131,7 +116,6 @@ public class SyServiceInterfaceMould implements Serializable { public enum Column { id("id", "id", "INTEGER", false), - mouldId("mould_id", "mouldId", "INTEGER", false), methodType("method_type", "methodType", "VARCHAR", false), contentType("content_type", "contentType", "VARCHAR", false), uri("uri", "uri", "VARCHAR", false), diff --git a/src/main/java/com/objecteye/entity/SyServiceInterfaceMouldExample.java b/src/main/java/com/objecteye/entity/SyServiceInterfaceMouldExample.java index 7d66bfb..80bff95 100644 --- a/src/main/java/com/objecteye/entity/SyServiceInterfaceMouldExample.java +++ b/src/main/java/com/objecteye/entity/SyServiceInterfaceMouldExample.java @@ -271,96 +271,6 @@ public class SyServiceInterfaceMouldExample { return (Criteria) this; } - public Criteria andMouldIdIsNull() { - addCriterion("mould_id is null"); - return (Criteria) this; - } - - public Criteria andMouldIdIsNotNull() { - addCriterion("mould_id is not null"); - return (Criteria) this; - } - - public Criteria andMouldIdEqualTo(Integer value) { - addCriterion("mould_id =", value, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdEqualToColumn(SyServiceInterfaceMould.Column column) { - addCriterion(new StringBuilder("mould_id = ").append(column.getEscapedColumnName()).toString()); - return (Criteria) this; - } - - public Criteria andMouldIdNotEqualTo(Integer value) { - addCriterion("mould_id <>", value, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdNotEqualToColumn(SyServiceInterfaceMould.Column column) { - addCriterion(new StringBuilder("mould_id <> ").append(column.getEscapedColumnName()).toString()); - return (Criteria) this; - } - - public Criteria andMouldIdGreaterThan(Integer value) { - addCriterion("mould_id >", value, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdGreaterThanColumn(SyServiceInterfaceMould.Column column) { - addCriterion(new StringBuilder("mould_id > ").append(column.getEscapedColumnName()).toString()); - return (Criteria) this; - } - - public Criteria andMouldIdGreaterThanOrEqualTo(Integer value) { - addCriterion("mould_id >=", value, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdGreaterThanOrEqualToColumn(SyServiceInterfaceMould.Column column) { - addCriterion(new StringBuilder("mould_id >= ").append(column.getEscapedColumnName()).toString()); - return (Criteria) this; - } - - public Criteria andMouldIdLessThan(Integer value) { - addCriterion("mould_id <", value, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdLessThanColumn(SyServiceInterfaceMould.Column column) { - addCriterion(new StringBuilder("mould_id < ").append(column.getEscapedColumnName()).toString()); - return (Criteria) this; - } - - public Criteria andMouldIdLessThanOrEqualTo(Integer value) { - addCriterion("mould_id <=", value, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdLessThanOrEqualToColumn(SyServiceInterfaceMould.Column column) { - addCriterion(new StringBuilder("mould_id <= ").append(column.getEscapedColumnName()).toString()); - return (Criteria) this; - } - - public Criteria andMouldIdIn(List values) { - addCriterion("mould_id in", values, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdNotIn(List values) { - addCriterion("mould_id not in", values, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdBetween(Integer value1, Integer value2) { - addCriterion("mould_id between", value1, value2, "mouldId"); - return (Criteria) this; - } - - public Criteria andMouldIdNotBetween(Integer value1, Integer value2) { - addCriterion("mould_id not between", value1, value2, "mouldId"); - return (Criteria) this; - } - public Criteria andMethodTypeIsNull() { addCriterion("method_type is null"); return (Criteria) this; diff --git a/src/main/java/com/objecteye/entity/SyVehicleResultContent.java b/src/main/java/com/objecteye/entity/SyVehicleResultContent.java new file mode 100644 index 0000000..d34a7f1 --- /dev/null +++ b/src/main/java/com/objecteye/entity/SyVehicleResultContent.java @@ -0,0 +1,192 @@ +package com.objecteye.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + +public class SyVehicleResultContent implements Serializable { + + private static final long serialVersionUID = 4743402171237822727L; + + private Integer id; + + private String code; + + private String itemName; + + private String itemType; + + private String description; + + private String contentTable; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getItemType() { + return itemType; + } + + public void setItemType(String itemType) { + this.itemType = itemType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getContentTable() { + return contentTable; + } + + public void setContentTable(String contentTable) { + this.contentTable = contentTable; + } + + public static SyVehicleResultContent.Builder builder() { + return new SyVehicleResultContent.Builder(); + } + + public static class Builder { + private SyVehicleResultContent obj; + + public Builder() { + this.obj = new SyVehicleResultContent(); + } + + public Builder id(Integer id) { + obj.setId(id); + return this; + } + + public Builder code(String code) { + obj.setCode(code); + return this; + } + + public Builder itemName(String itemName) { + obj.setItemName(itemName); + return this; + } + + public Builder itemType(String itemType) { + obj.setItemType(itemType); + return this; + } + + public Builder description(String description) { + obj.setDescription(description); + return this; + } + + public Builder contentTable(String contentTable) { + obj.setContentTable(contentTable); + return this; + } + + public SyVehicleResultContent build() { + return this.obj; + } + } + + public enum Column { + id("id", "id", "INTEGER", false), + code("code", "code", "VARCHAR", false), + itemName("item_name", "itemName", "VARCHAR", false), + itemType("item_type", "itemType", "VARCHAR", false), + description("description", "description", "VARCHAR", false), + contentTable("content_table", "contentTable", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "\""; + + private static final String ENDING_DELIMITER = "\""; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/objecteye/entity/SyVehicleResultContentExample.java b/src/main/java/com/objecteye/entity/SyVehicleResultContentExample.java new file mode 100644 index 0000000..aa63151 --- /dev/null +++ b/src/main/java/com/objecteye/entity/SyVehicleResultContentExample.java @@ -0,0 +1,910 @@ +package com.objecteye.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SyVehicleResultContentExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + protected Integer offset; + + protected Integer rows; + + public SyVehicleResultContentExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public SyVehicleResultContentExample orderBy(String orderByClause) { + this.setOrderByClause(orderByClause); + return this; + } + + public SyVehicleResultContentExample orderBy(String... orderByClauses) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < orderByClauses.length; i++) { + sb.append(orderByClauses[i]); + if (i < orderByClauses.length - 1) { + sb.append(" , "); + } + } + this.setOrderByClause(sb.toString()); + return this; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(this); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + rows = null; + offset = null; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getOffset() { + return this.offset; + } + + public void setRows(Integer rows) { + this.rows = rows; + } + + public Integer getRows() { + return this.rows; + } + + public SyVehicleResultContentExample limit(Integer rows) { + this.rows = rows; + return this; + } + + public SyVehicleResultContentExample limit(Integer offset, Integer rows) { + this.offset = offset; + this.rows = rows; + return this; + } + + public SyVehicleResultContentExample page(Integer page, Integer pageSize) { + this.offset = (page - 1) * pageSize; + this.rows = pageSize; + return this; + } + + public static Criteria newAndCreateCriteria() { + SyVehicleResultContentExample example = new SyVehicleResultContentExample(); + return example.createCriteria(); + } + + public SyVehicleResultContentExample when(boolean condition, IExampleWhen then) { + if (condition) { + then.example(this); + } + return this; + } + + public SyVehicleResultContentExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) { + if (condition) { + then.example(this); + } else { + otherwise.example(this); + } + return this; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("code = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("code <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("code > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("code >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("code < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("code <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andItemNameIsNull() { + addCriterion("item_name is null"); + return (Criteria) this; + } + + public Criteria andItemNameIsNotNull() { + addCriterion("item_name is not null"); + return (Criteria) this; + } + + public Criteria andItemNameEqualTo(String value) { + addCriterion("item_name =", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_name = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemNameNotEqualTo(String value) { + addCriterion("item_name <>", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameNotEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_name <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemNameGreaterThan(String value) { + addCriterion("item_name >", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameGreaterThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_name > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemNameGreaterThanOrEqualTo(String value) { + addCriterion("item_name >=", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameGreaterThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_name >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemNameLessThan(String value) { + addCriterion("item_name <", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameLessThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_name < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemNameLessThanOrEqualTo(String value) { + addCriterion("item_name <=", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameLessThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_name <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemNameLike(String value) { + addCriterion("item_name like", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameNotLike(String value) { + addCriterion("item_name not like", value, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameIn(List values) { + addCriterion("item_name in", values, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameNotIn(List values) { + addCriterion("item_name not in", values, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameBetween(String value1, String value2) { + addCriterion("item_name between", value1, value2, "itemName"); + return (Criteria) this; + } + + public Criteria andItemNameNotBetween(String value1, String value2) { + addCriterion("item_name not between", value1, value2, "itemName"); + return (Criteria) this; + } + + public Criteria andItemTypeIsNull() { + addCriterion("item_type is null"); + return (Criteria) this; + } + + public Criteria andItemTypeIsNotNull() { + addCriterion("item_type is not null"); + return (Criteria) this; + } + + public Criteria andItemTypeEqualTo(String value) { + addCriterion("item_type =", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_type = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemTypeNotEqualTo(String value) { + addCriterion("item_type <>", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeNotEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_type <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemTypeGreaterThan(String value) { + addCriterion("item_type >", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeGreaterThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_type > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemTypeGreaterThanOrEqualTo(String value) { + addCriterion("item_type >=", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeGreaterThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_type >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemTypeLessThan(String value) { + addCriterion("item_type <", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeLessThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_type < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemTypeLessThanOrEqualTo(String value) { + addCriterion("item_type <=", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeLessThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("item_type <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andItemTypeLike(String value) { + addCriterion("item_type like", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeNotLike(String value) { + addCriterion("item_type not like", value, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeIn(List values) { + addCriterion("item_type in", values, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeNotIn(List values) { + addCriterion("item_type not in", values, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeBetween(String value1, String value2) { + addCriterion("item_type between", value1, value2, "itemType"); + return (Criteria) this; + } + + public Criteria andItemTypeNotBetween(String value1, String value2) { + addCriterion("item_type not between", value1, value2, "itemType"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("description = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("description <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("description > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("description >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("description < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("description <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andContentTableIsNull() { + addCriterion("content_table is null"); + return (Criteria) this; + } + + public Criteria andContentTableIsNotNull() { + addCriterion("content_table is not null"); + return (Criteria) this; + } + + public Criteria andContentTableEqualTo(String value) { + addCriterion("content_table =", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("content_table = ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andContentTableNotEqualTo(String value) { + addCriterion("content_table <>", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableNotEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("content_table <> ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andContentTableGreaterThan(String value) { + addCriterion("content_table >", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableGreaterThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("content_table > ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andContentTableGreaterThanOrEqualTo(String value) { + addCriterion("content_table >=", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableGreaterThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("content_table >= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andContentTableLessThan(String value) { + addCriterion("content_table <", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableLessThanColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("content_table < ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andContentTableLessThanOrEqualTo(String value) { + addCriterion("content_table <=", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableLessThanOrEqualToColumn(SyVehicleResultContent.Column column) { + addCriterion(new StringBuilder("content_table <= ").append(column.getEscapedColumnName()).toString()); + return (Criteria) this; + } + + public Criteria andContentTableLike(String value) { + addCriterion("content_table like", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableNotLike(String value) { + addCriterion("content_table not like", value, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableIn(List values) { + addCriterion("content_table in", values, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableNotIn(List values) { + addCriterion("content_table not in", values, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableBetween(String value1, String value2) { + addCriterion("content_table between", value1, value2, "contentTable"); + return (Criteria) this; + } + + public Criteria andContentTableNotBetween(String value1, String value2) { + addCriterion("content_table not between", value1, value2, "contentTable"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + private SyVehicleResultContentExample example; + + protected Criteria(SyVehicleResultContentExample example) { + super(); + this.example = example; + } + + public SyVehicleResultContentExample example() { + return this.example; + } + + @Deprecated + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { + if (ifAdd) { + add.add(this); + } + return this; + } + + public Criteria when(boolean condition, ICriteriaWhen then) { + if (condition) { + then.criteria(this); + } + return this; + } + + public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) { + if (condition) { + then.criteria(this); + } else { + otherwise.criteria(this); + } + return this; + } + + @Deprecated + public interface ICriteriaAdd { + Criteria add(Criteria add); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } + + public interface ICriteriaWhen { + void criteria(Criteria criteria); + } + + public interface IExampleWhen { + void example(com.objecteye.entity.SyVehicleResultContentExample example); + } +} \ No newline at end of file diff --git a/src/main/java/com/objecteye/mapper/SyVehicleResultContentMapper.java b/src/main/java/com/objecteye/mapper/SyVehicleResultContentMapper.java new file mode 100644 index 0000000..6a85415 --- /dev/null +++ b/src/main/java/com/objecteye/mapper/SyVehicleResultContentMapper.java @@ -0,0 +1,33 @@ +package com.objecteye.mapper; + +import com.objecteye.entity.SyVehicleResultContent; +import com.objecteye.entity.SyVehicleResultContentExample; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface SyVehicleResultContentMapper { + long countByExample(SyVehicleResultContentExample example); + + int deleteByExample(SyVehicleResultContentExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(SyVehicleResultContent record); + + int insertSelective(SyVehicleResultContent record); + + SyVehicleResultContent selectOneByExample(SyVehicleResultContentExample example); + + List selectByExample(SyVehicleResultContentExample example); + + SyVehicleResultContent selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") SyVehicleResultContent record, @Param("example") SyVehicleResultContentExample example); + + int updateByExample(@Param("record") SyVehicleResultContent record, @Param("example") SyVehicleResultContentExample example); + + int updateByPrimaryKeySelective(SyVehicleResultContent record); + + int updateByPrimaryKey(SyVehicleResultContent record); +} \ No newline at end of file diff --git a/src/main/java/com/objecteye/service/IBackGroundService.java b/src/main/java/com/objecteye/service/IBackGroundService.java index e7a3d54..5e18419 100644 --- a/src/main/java/com/objecteye/service/IBackGroundService.java +++ b/src/main/java/com/objecteye/service/IBackGroundService.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.objecteye.common.PageResult; import com.objecteye.entity.SyBasicResourceHistory; import com.objecteye.entity.SyServiceInterfaceMould; +import com.objecteye.entity.SyVehicleResultContent; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -55,10 +56,9 @@ public interface IBackGroundService { /** * sdk启动器 * - * @param requestMap 请求参数 - * @return 结果集 + * @param configId@return 结果集 */ - JSONObject sdkController(Map requestMap); + JSONObject sdkController(Integer configId); /** * 配置启动服务 @@ -121,8 +121,14 @@ public interface IBackGroundService { /** * 获取配置服务支持的所有接口信息(固定对应的itemName为 serviceInterface, interfaceMould) * - * @param configId 服务主键 * @return 支持的所有接口信息 */ - List findAllAvailableInterface(Integer configId); + List findAllAvailableInterface(); + + /** + * 获取引擎返回结果对应信息表 + * + * @return 结果集 + */ + Map> findVehicleResultContent(); } diff --git a/src/main/java/com/objecteye/service/impl/BackGroundServiceImpl.java b/src/main/java/com/objecteye/service/impl/BackGroundServiceImpl.java index 229c433..1492a81 100644 --- a/src/main/java/com/objecteye/service/impl/BackGroundServiceImpl.java +++ b/src/main/java/com/objecteye/service/impl/BackGroundServiceImpl.java @@ -8,10 +8,7 @@ import com.objecteye.common.GeneralContent; import com.objecteye.common.PageResult; import com.objecteye.entity.*; import com.objecteye.exception.CustomXException; -import com.objecteye.mapper.SyBasicResourceHistoryMapper; -import com.objecteye.mapper.SyServiceConfigItemMapper; -import com.objecteye.mapper.SyServiceConfigMapper; -import com.objecteye.mapper.SyServiceInterfaceMouldMapper; +import com.objecteye.mapper.*; import com.objecteye.service.IBackGroundService; import com.objecteye.service.IOccupationOfBasicResourcesService; import com.objecteye.utils.LinuxUtils; @@ -29,7 +26,11 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; @@ -40,6 +41,8 @@ import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.*; import java.util.stream.Collectors; @@ -59,8 +62,16 @@ public class BackGroundServiceImpl implements IBackGroundService { @Autowired private SyServiceInterfaceMouldMapper syServiceInterfaceMouldMapper; @Autowired + private SyVehicleResultContentMapper syVehicleResultContentMapper; + @Autowired private RestTemplate restTemplate; + @Value("${testBase64Path}") + private String TEST_BASE64_PATH; + @Value("${testPicUrl}") + private String TEST_PIC_URL; + + /** * 定时写入的定制信息 */ @@ -241,17 +252,14 @@ public class BackGroundServiceImpl implements IBackGroundService { /** * sdk启动器 * - * @param requestMap 请求参数 - * @return 结果集 + * @param configId@return 结果集 */ - @Override - public JSONObject sdkController(Map requestMap) { - String configId = (String) requestMap.get("configId"); + public JSONObject sdkController(Integer configId) { String uri = "/vehicle/loadConfig"; String configItemName = "http,port"; List syServiceConfigItems = syServiceConfigItemMapper.selectByExample(SyServiceConfigItemExample.newAndCreateCriteria() - .andConfigIdEqualTo(Integer.valueOf(configId)).andItemNameIn(Arrays.asList(configItemName.split(","))) + .andConfigIdEqualTo(configId).andItemNameIn(Arrays.asList(configItemName.split(","))) .example()); String http = null; String port = null; @@ -268,13 +276,24 @@ public class BackGroundServiceImpl implements IBackGroundService { return resultObj; } + List configItems = syServiceConfigItemMapper.selectByExample(SyServiceConfigItemExample.newAndCreateCriteria().andConfigIdEqualTo(configId) + .andItemNameIn(new ArrayList<>(GeneralContent.DOCKER_CONFIG_PARAMS_MAP.keySet())).example()); + Map requestParams = configItems.stream().collect(Collectors.toMap(SyServiceConfigItem::getItemName, configItem -> { + if ("true".equals(configItem.getItemValue())) { + return 1; + } else if (null == configItem.getItemValue() || "false".equals(configItem.getItemValue())) { + return 0; + } else { + return Integer.parseInt(configItem.getItemValue()); + } + })); List errorList = new ArrayList<>(); - Map restRequestMap = new HashMap<>(); + Map restRequestMap = new HashMap<>(); for (String param : GeneralContent.DOCKER_CONFIG_PARAMS_MAP.keySet()) { - if (!requestMap.containsKey(param)) { + if (!requestParams.containsKey(param)) { errorList.add(param + "参数不能为空"); } else { - restRequestMap.put(param, (String) requestMap.get(param)); + restRequestMap.put(param, requestParams.get(param)); } } if (errorList.size() > 0) { @@ -282,7 +301,10 @@ public class BackGroundServiceImpl implements IBackGroundService { return resultObj; } - ResponseEntity responseEntity = restTemplate.postForEntity(http + ":" + port + uri, restRequestMap, String.class); + HttpHeaders httpHeaders = new HttpHeaders(); + httpHeaders.setContentType(MediaType.APPLICATION_JSON); + HttpEntity httpEntity = new HttpEntity<>(restRequestMap, httpHeaders); + ResponseEntity responseEntity = restTemplate.postForEntity("http://" + http + ":" + port + uri, httpEntity, String.class); resultObj = JSON.parseObject(responseEntity.getBody()); return resultObj; } @@ -394,6 +416,7 @@ public class BackGroundServiceImpl implements IBackGroundService { } List configItems = configIdItemsMap.get(syServiceConfig.getId()); VSyServiceMainTable vSyServiceMainTable = new VSyServiceMainTable(); + vSyServiceMainTable.setServiceName(syServiceConfig.getServiceName()); vSyServiceMainTable.setUpdateTime(DateUtil.format(new Date(syServiceConfig.getUpdateTime()), "yyyy-MM-dd HH:mm:ss")); vSyServiceMainTable.setConfigId(syServiceConfig.getId()); @@ -483,6 +506,7 @@ public class BackGroundServiceImpl implements IBackGroundService { cmd += containerId + " " + syServiceConfigItem.getItemValue(); } List outList = new ArrayList<>(); + log.info("BackGroundServiceImpl|serviceDockerOthers|cmd: {}", cmd); LinuxUtils.executeLinuxCmd(cmd, outList); if ("remove".equals(action)) { redisTemplate.opsForHash().delete(GeneralContent.REDIS_SERVICE_DOCKER_CONTAINER_ID, configId); @@ -547,10 +571,14 @@ public class BackGroundServiceImpl implements IBackGroundService { } if ("0".equals(resultCode)) { resultObj.put("result", resultMsg); + // sdkController + try { + sdkController(configId); + } catch (Exception ignored) { + } } else { resultObj.put("error", resultMsg); } - } else { resultObj.put("error", "没有找到对应数据"); } @@ -648,39 +676,38 @@ public class BackGroundServiceImpl implements IBackGroundService { /** * 获取配置服务支持的所有接口信息(固定对应的itemName为 serviceInterface, interfaceMould) * - * @param configId 服务主键 * @return 支持的所有接口信息 */ @Override - public List findAllAvailableInterface(Integer configId) { - // serviceInterface(除接口模板外还有的接口信息), interfaceMould(接口模板对应的id) - List syServiceConfigItems = syServiceConfigItemMapper.selectByExample(SyServiceConfigItemExample - .newAndCreateCriteria() - .andConfigIdEqualTo(configId) - .andItemNameIn(Arrays.asList("serviceInterface", "interfaceMould")).example()); - - List interfaceMouldIdList = new ArrayList<>(); - List mouldIdList = new ArrayList<>(); - for (SyServiceConfigItem syServiceConfigItem : syServiceConfigItems) { - if (syServiceConfigItem == null) { - continue; - } - if ("serviceInterface".equals(syServiceConfigItem.getItemName())) { - interfaceMouldIdList.add(Integer.valueOf(syServiceConfigItem.getItemValue())); - } else if ("interfaceMould".equals(syServiceConfigItem.getItemName())) { - mouldIdList.add(Integer.valueOf(syServiceConfigItem.getItemValue())); + public List findAllAvailableInterface() { + List interfaceMoulds = syServiceInterfaceMouldMapper.selectByExample(SyServiceInterfaceMouldExample.newAndCreateCriteria().example()); + interfaceMoulds.forEach(syServiceInterfaceMould -> { + if (syServiceInterfaceMould.getUri().contains("analysisBase64")) { + JSONObject tempJson = new JSONObject(); + try { + byte[] bytes = Files.readAllBytes(Paths.get(TEST_BASE64_PATH)); + tempJson.put("TPXX", Base64.getEncoder().encodeToString(bytes)); + } catch (IOException e) { + e.printStackTrace(); + } + syServiceInterfaceMould.setDefaultJson(tempJson.toJSONString()); + } else if (syServiceInterfaceMould.getUri().contains("analysisUrl")) { + JSONObject tempJson = new JSONObject(); + tempJson.put("TPXX", TEST_PIC_URL); + syServiceInterfaceMould.setDefaultJson(tempJson.toJSONString()); } - } - SyServiceInterfaceMouldExample syServiceInterfaceMouldExample = new SyServiceInterfaceMouldExample(); - boolean hasCondition = false; - if (interfaceMouldIdList.size() > 0) { - hasCondition = true; - syServiceInterfaceMouldExample.or(SyServiceInterfaceMouldExample.newAndCreateCriteria().andIdIn(interfaceMouldIdList)); - } - if (mouldIdList.size() > 0) { - hasCondition = true; - syServiceInterfaceMouldExample.or(SyServiceInterfaceMouldExample.newAndCreateCriteria().andMouldIdIn(mouldIdList)); - } - return hasCondition ? syServiceInterfaceMouldMapper.selectByExample(syServiceInterfaceMouldExample) : new ArrayList<>(); + }); + return interfaceMoulds; + } + + /** + * 获取引擎返回结果对应信息表 + * + * @return 结果集 + */ + @Override + public Map> findVehicleResultContent() { + List contents = syVehicleResultContentMapper.selectByExample(SyVehicleResultContentExample.newAndCreateCriteria().example()); + return contents.stream().collect(Collectors.groupingBy(SyVehicleResultContent::getContentTable)); } } diff --git a/src/main/java/com/objecteye/vo/VSyServiceMainTable.java b/src/main/java/com/objecteye/vo/VSyServiceMainTable.java index cbc248f..9daccef 100644 --- a/src/main/java/com/objecteye/vo/VSyServiceMainTable.java +++ b/src/main/java/com/objecteye/vo/VSyServiceMainTable.java @@ -13,6 +13,10 @@ public class VSyServiceMainTable implements Serializable { private static final long serialVersionUID = -7792368195135334610L; /** + * 配置服务名称 + */ + private String serviceName; + /** * 显卡编号 */ private String gpuId; diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index fb96cb6..4d01f03 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,9 +3,7 @@ spring: url: jdbc:mysql://192.168.10.153:3306/sy_vehicle?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai username: root password: 123456 - data: - mongodb: - uri: mongodb://vehicle:shiyu2018@192.168.10.153:27017/vehicle + servlet: multipart: max-file-size: 20MB diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 960259c..ccf9cff 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,18 +1,15 @@ spring: datasource: - url: jdbc:mysql://192.168.10.117:3306/sy_sdk?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + url: jdbc:mysql://192.168.10.6:3306/sy_sdk?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai username: root password: 123456 - data: - mongodb: - uri: mongodb://vehicle:shiyu2018@192.168.10.117:27017/vehicle servlet: multipart: max-file-size: 20MB max-request-size: 20MB redis: database: 0 - host: 192.168.10.117 + host: 192.168.10.6 port: 6379 jedis: pool: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index beecb56..04e1c77 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,12 +1,6 @@ spring: profiles: active: test #默认开发环境 - rabbitmq: - host: 192.168.10.117 - port: 5672 - username: shiyu - password: shiyu - virtualHost: / mybatis: @@ -27,5 +21,9 @@ logging: # path: /var/logs #配置日志文件名称 server: - port: 8888 - address: 192.168.10.117 \ No newline at end of file + port: 8845 + address: 192.168.10.6 + +# 默认预留的引擎测试文件信息 +testBase64Path: /home/haoyu/static/picture/test01.jpg +testPicUrl: http://192.168.10.6:8891/picture/test01.jpg \ No newline at end of file diff --git a/src/main/resources/com.objecteye.mapper/SyServiceInterfaceMouldMapper.xml b/src/main/resources/com.objecteye.mapper/SyServiceInterfaceMouldMapper.xml index 084182e..9a455f8 100644 --- a/src/main/resources/com.objecteye.mapper/SyServiceInterfaceMouldMapper.xml +++ b/src/main/resources/com.objecteye.mapper/SyServiceInterfaceMouldMapper.xml @@ -2,13 +2,12 @@ - - - - - - - + + + + + + @@ -69,20 +68,20 @@ - id, mould_id, method_type, content_type, uri, default_json, sort + id, method_type, content_type, uri, default_json, sort - + select + + distinct + + + from sy_service_interface_mould + + + + order by ${orderByClause} @@ -94,33 +93,33 @@ - + - delete - from sy_service_interface_mould - where id = #{id,jdbcType=INTEGER} + delete + from sy_service_interface_mould + where id = #{id,jdbcType=INTEGER} delete from sy_service_interface_mould - + SELECT LAST_INSERT_ID() - insert into sy_service_interface_mould (id, mould_id, method_type, - content_type, uri, default_json, - sort) - values (#{id,jdbcType=INTEGER}, #{mouldId,jdbcType=INTEGER}, #{methodType,jdbcType=VARCHAR}, - #{contentType,jdbcType=VARCHAR}, #{uri,jdbcType=VARCHAR}, #{defaultJson,jdbcType=VARCHAR}, - #{sort,jdbcType=INTEGER}) + insert into sy_service_interface_mould (id, method_type, content_type, + uri, default_json, sort + ) + values (#{id,jdbcType=INTEGER}, #{methodType,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, + #{uri,jdbcType=VARCHAR}, #{defaultJson,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER} + ) @@ -129,9 +128,6 @@ insert into sy_service_interface_mould id, - - mould_id, - method_type, @@ -150,9 +146,6 @@ #{id,jdbcType=INTEGER}, - - #{mouldId,jdbcType=INTEGER}, - #{methodType,jdbcType=VARCHAR}, @@ -170,22 +163,19 @@ - + update sy_service_interface_mould id = #{record.id,jdbcType=INTEGER}, - - mould_id = #{record.mouldId,jdbcType=INTEGER}, - method_type = #{record.methodType,jdbcType=VARCHAR}, @@ -203,28 +193,24 @@ - + - update sy_service_interface_mould - set id = #{record.id,jdbcType=INTEGER}, - mould_id = #{record.mouldId,jdbcType=INTEGER}, - method_type = #{record.methodType,jdbcType=VARCHAR}, - content_type = #{record.contentType,jdbcType=VARCHAR}, - uri = #{record.uri,jdbcType=VARCHAR}, - default_json = #{record.defaultJson,jdbcType=VARCHAR}, - sort = #{record.sort,jdbcType=INTEGER} - - + update sy_service_interface_mould + set id = #{record.id,jdbcType=INTEGER}, + method_type = #{record.methodType,jdbcType=VARCHAR}, + content_type = #{record.contentType,jdbcType=VARCHAR}, + uri = #{record.uri,jdbcType=VARCHAR}, + default_json = #{record.defaultJson,jdbcType=VARCHAR}, + sort = #{record.sort,jdbcType=INTEGER} + + update sy_service_interface_mould - - mould_id = #{mouldId,jdbcType=INTEGER}, - method_type = #{methodType,jdbcType=VARCHAR}, @@ -244,26 +230,25 @@ where id = #{id,jdbcType=INTEGER} - update sy_service_interface_mould - set mould_id = #{mouldId,jdbcType=INTEGER}, - method_type = #{methodType,jdbcType=VARCHAR}, - content_type = #{contentType,jdbcType=VARCHAR}, - uri = #{uri,jdbcType=VARCHAR}, - default_json = #{defaultJson,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER} - where id = #{id,jdbcType=INTEGER} + update sy_service_interface_mould + set method_type = #{methodType,jdbcType=VARCHAR}, + content_type = #{contentType,jdbcType=VARCHAR}, + uri = #{uri,jdbcType=VARCHAR}, + default_json = #{defaultJson,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} - + select + + from sy_service_interface_mould + + + + + order by ${orderByClause} + + limit 1 \ No newline at end of file diff --git a/src/main/resources/com.objecteye.mapper/SyVehicleResultContentMapper.xml b/src/main/resources/com.objecteye.mapper/SyVehicleResultContentMapper.xml new file mode 100644 index 0000000..65f9c54 --- /dev/null +++ b/src/main/resources/com.objecteye.mapper/SyVehicleResultContentMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, code, item_name, item_type, description, content_table + + + + + delete + from sy_vehicle_result_content + where id = #{id,jdbcType=INTEGER} + + + delete from sy_vehicle_result_content + + + + + + + SELECT LAST_INSERT_ID() + + insert into sy_vehicle_result_content (id, code, item_name, + item_type, description, content_table + ) + values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{itemName,jdbcType=VARCHAR}, + #{itemType,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{contentTable,jdbcType=VARCHAR} + ) + + + + SELECT LAST_INSERT_ID() + + insert into sy_vehicle_result_content + + id, + + code, + + + item_name, + + + item_type, + + + description, + + + content_table, + + + + #{id,jdbcType=INTEGER}, + + #{code,jdbcType=VARCHAR}, + + + #{itemName,jdbcType=VARCHAR}, + + + #{itemType,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{contentTable,jdbcType=VARCHAR}, + + + + + + update sy_vehicle_result_content + + + id = #{record.id,jdbcType=INTEGER}, + + + code = #{record.code,jdbcType=VARCHAR}, + + + item_name = #{record.itemName,jdbcType=VARCHAR}, + + + item_type = #{record.itemType,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + content_table = #{record.contentTable,jdbcType=VARCHAR}, + + + + + + + + update sy_vehicle_result_content + set id = #{record.id,jdbcType=INTEGER}, + code = #{record.code,jdbcType=VARCHAR}, + item_name = #{record.itemName,jdbcType=VARCHAR}, + item_type = #{record.itemType,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + content_table = #{record.contentTable,jdbcType=VARCHAR} + + + + + + update sy_vehicle_result_content + + + code = #{code,jdbcType=VARCHAR}, + + + item_name = #{itemName,jdbcType=VARCHAR}, + + + item_type = #{itemType,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + content_table = #{contentTable,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update sy_vehicle_result_content + set code = #{code,jdbcType=VARCHAR}, + item_name = #{itemName,jdbcType=VARCHAR}, + item_type = #{itemType,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + content_table = #{contentTable,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + \ No newline at end of file