| | |
| | | import com.se.simu.helper.CaffeineHelper; |
| | | import com.se.simu.service.ProjectRelatedService; |
| | | import com.se.simu.utils.CustomWebClient; |
| | | import com.se.simu.utils.EntityLibraryUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | if (!isExists) { |
| | | token = (String) CaffeineHelper.get(CacheConstants.USER_CACHE_KEY + "entity_db_token"); |
| | | } else { |
| | | // 获取token |
| | | LoginParams loginParams = new LoginParams(); |
| | | loginParams.setUserid("admin"); |
| | | loginParams.setPassword("admin"); |
| | | loginEntity(loginParams); |
| | | token = (String) CaffeineHelper.get(CacheConstants.USER_CACHE_KEY + "entity_db_token"); |
| | | try { |
| | | token = EntityLibraryUtils.login(); |
| | | CaffeineHelper.remove(CacheConstants.USER_CACHE_KEY + "entity_db_token"); |
| | | CaffeineHelper.put(CacheConstants.USER_CACHE_KEY + "entity_db_token", token); |
| | | }catch (Exception e){ |
| | | return "登录失败!"; |
| | | } |
| | | } |
| | | log.info("token = " + token); |
| | | // 添加form参数 |
| | |
| | | params.put("containCount", true); |
| | | params.put("count", Objects.nonNull(entityTypeInfo.getCount()) ? entityTypeInfo.getCount() : 20); |
| | | params.put("dbid", Objects.nonNull(entityTypeInfo.getDbid()) ? entityTypeInfo.getDbid() : "85257774fdb64e5f99f6778696cad02a"); |
| | | params.put("layerid", Objects.nonNull(entityTypeInfo.getLayerid()) ? entityTypeInfo.getLayerid() : "f6ff4412-4886-4c4b-83f7-13de24ee8353"); |
| | | params.put("layerid", Objects.nonNull(entityTypeInfo.getLayerid()) ? entityTypeInfo.getLayerid() : "8208c5be-adc1-4e7b-b952-37362e0bef32"); |
| | | params.put("like", ""); |
| | | params.put("querytype", "entity"); |
| | | |