wangzhinan %!s(int64=2) %!d(string=hai) anos
pai
achega
af37a43869

+ 16 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/interfacemg/BaseUserInterfaceEndpoint.java

@ -1,5 +1,6 @@
package com.yihu.jw.base.endpoint.interfacemg;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.interfacemg.BaseUserInterfaceService;
import com.yihu.jw.entity.interfacemg.BaseThirdUserDO;
@ -16,6 +17,9 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
 * 第三方接口配置管理
 */
@ -49,8 +53,15 @@ public class BaseUserInterfaceEndpoint extends EnvelopRestEndpoint {
    public Envelop userInterfaceStandardSaveAndUpdate (
            @ApiParam(name = "jsonData", value = "第三方接口标准信息配置实体", required = false)
            @RequestParam(value = "jsonData", required = false) String jsonData) throws Exception {
        BaseThirdUserInterfaceStandardDO baseThirdUserInterfaceStandardDO = toEntity(jsonData, BaseThirdUserInterfaceStandardDO.class);
        return success(baseUserInterfaceService.userInterfaceStandardsaveAndUpdate(baseThirdUserInterfaceStandardDO));
        JSONArray array = JSONArray.parseArray(jsonData);
        List<BaseThirdUserInterfaceStandardDO> interfaceStandardDOList = new ArrayList<>();
        for (int i=0;i<array.size();i++){
            JSONObject object = array.getJSONObject(i);
            BaseThirdUserInterfaceStandardDO baseThirdUserInterfaceStandardDO = toEntity(object.toJSONString(), BaseThirdUserInterfaceStandardDO.class);
            interfaceStandardDOList.add(baseThirdUserInterfaceStandardDO);
        }
        return success(baseUserInterfaceService.userInterfaceStandardsaveAndUpdate(interfaceStandardDOList));
    }
    @PostMapping(value = BaseRequestMapping.UserInterface.userInterfaceLogsaveAndUpdate)
@ -96,11 +107,13 @@ public class BaseUserInterfaceEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "condition", required = false) String condition,
            @ApiParam(name = "userInterfaceId", value = "接口id", required = false)
            @RequestParam(value = "userInterfaceId", required = false) String userInterfaceId,
            @ApiParam(name = "stdDatasetId", value = "数据集id", required = false)
            @RequestParam(value = "stdDatasetId", required = false) String stdDatasetId,
            @ApiParam(name = "page", value = "页数", required = false)
            @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "size", value = "页码", required = false)
            @RequestParam(value = "size", required = false) Integer size) throws Exception {
        return success(baseUserInterfaceService.selectUserInterfaceStandardByCondition(condition,userInterfaceId,page,size));
        return success(baseUserInterfaceService.selectUserInterfaceStandardByCondition(condition,userInterfaceId,stdDatasetId,page,size));
    }
    @GetMapping(value = BaseRequestMapping.UserInterface.selectUserInterfaceLogByCondition)

+ 15 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/service/interfacemg/BaseUserInterfaceService.java

@ -148,6 +148,7 @@ public class BaseUserInterfaceService extends BaseJpaService<BaseThirdUserInterf
                "\trequest_mode AS \"requestMode\",\n" +
                "\tresponse_type AS \"responseType\",\n" +
                "\tSTATUS AS \"status\",\n" +
                "\tadapter_version AS \"adapterVersion\",\n" +
                "\tdel as \"del\"\n" +
                "FROM\n" +
                "\tbase_third_user_interface where 1=1 ";
@ -177,13 +178,18 @@ public class BaseUserInterfaceService extends BaseJpaService<BaseThirdUserInterf
    /**
     * 新增/更新第三方接口标准信息
     * @param userInterfaceStandardDO
     * @param userInterfaceStandardDOList
     * @return
     */
    public BaseThirdUserInterfaceStandardDO userInterfaceStandardsaveAndUpdate(BaseThirdUserInterfaceStandardDO userInterfaceStandardDO){
        userInterfaceStandardDO.setCreateTime(new Date());
        userInterfaceStandardDO.setUpdateTime(new Date());
        return baseThirdUserInterfaceStandardDao.save(userInterfaceStandardDO);
    public BaseThirdUserInterfaceStandardDO userInterfaceStandardsaveAndUpdate(List<BaseThirdUserInterfaceStandardDO> userInterfaceStandardDOList){
        BaseThirdUserInterfaceStandardDO userInterfaceStandardDO = new BaseThirdUserInterfaceStandardDO();
        for (BaseThirdUserInterfaceStandardDO interfaceStandardDO:userInterfaceStandardDOList){
            interfaceStandardDO.setCreateTime(new Date());
            interfaceStandardDO.setUpdateTime(new Date());
            userInterfaceStandardDO = baseThirdUserInterfaceStandardDao.save(interfaceStandardDO);
        }
        return userInterfaceStandardDO;
    }
@ -194,7 +200,7 @@ public class BaseUserInterfaceService extends BaseJpaService<BaseThirdUserInterf
     * @param size
     * @return
     */
    public JSONObject selectUserInterfaceStandardByCondition(String condition,String userInterfaceId,Integer page,Integer size){
    public JSONObject selectUserInterfaceStandardByCondition(String condition,String userInterfaceId,String stdDatasetId,Integer page,Integer size){
        String sql = "SELECT\n" +
                "\tid as \"id\",\n" +
                "\tuser_interface_id AS \"userInterfaceId\",\n" +
@ -212,6 +218,9 @@ public class BaseUserInterfaceService extends BaseJpaService<BaseThirdUserInterf
        if (StringUtils.isNoneBlank(condition)){
            conditionSql += " and (std_metadata_name like '%"+condition+"%' or std_metadata_name like '%\"+condition+\"%') ";
        }
        if (StringUtils.isNoneBlank(stdDatasetId)){
            conditionSql += " and std_dataset_id = '"+stdDatasetId+"' ";
        }
        if (StringUtils.isNoneBlank(userInterfaceId)){
            conditionSql += " and user_interface_id = '"+userInterfaceId+"' ";
        }

+ 30 - 17
svr/svr-quota/src/main/resources/application.yml

@ -9,22 +9,34 @@ info:
    version: 1.0.0
spring:
  # REDIS
  data:
    redis:
      repositories:
        enabled: false
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 200
      minimum-idle: 10
      connection-timeout: 60000 #连接超时时间(毫秒),默认值30秒.
      connection-test-query: SELECT 1
      idle-timeout: 60000 #连接超时时间(毫秒),默认值30秒.
      max-lifetime: 3000000 #连接最大存活时间,默认值30分钟.设置应该比mysql设置的超时时间短
  redis:
    database: 0 # Database index used by the connection factory.
    timeout: 0 # Connection timeout in milliseconds.
    pool:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 20
    max-idle: 8
    min-idle: 8
    validation-query: SELECT 1
    test-on-borrow: true
    #sentinel:
    #  master: # Name of Redis server.
    #  nodes: # Comma-separated list of host:port pairs.
    jedis:
      pool:
        max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
        max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
        max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
        min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
  jackson:
    serialization:
      fail-on-empty-beans: false
hadoop:
  hbase-properties:
@ -42,9 +54,10 @@ eureka:
  instance:
    prefer-ip-address: false
    instance-id: ${spring.cloud.client.ip-address}:10031
---
spring:
  profiles: dev
  profiles: mlwTest
  datasource:
    url: jdbc:mysql://172.19.103.50:3306/healtharchive?useUnicode=true&characterEncoding=UTF-8&useSSL=false
    username: chenweishan
@ -68,7 +81,7 @@ hadoop:
---
spring:
  profiles: mlwTest
  profiles: dev
  datasource:
    url: jdbc:mysql://172.26.0.114:3306/healtharchive?useUnicode=true&characterEncoding=UTF-8&useSSL=false
    username: root
@ -84,8 +97,8 @@ spring:
    jest:
      uris: http://172.26.0.56:9200
elasticsearch:
  cluster-name: jkzl
  cluster-nodes: 172.26.0.56:9300
  cluster-name: elasticsearch
  cluster-nodes: 172.26.0.34:9300
hadoop:
  hbase-properties:
    hbase.zookeeper.quorum: node1.hde.h3c.com,node2.hde.h3c.com,node3.hde.h3c.com

+ 3 - 3
svr/svr-quota/src/main/resources/bootstrap.yml

@ -9,7 +9,7 @@ spring:
---
spring:
  profiles: dev
  profiles: mlwTest
  cloud:
    config:
      uri: ${spring.config.uri:http://172.26.0.125:1221}
@ -25,8 +25,8 @@ spring:
---
spring:
  profiles: mlwTest
  profiles: dev
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://72.26.0.153:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.153:1221}
      label: ${wlyy.spring.config.label:master}