Commit 7823f81b authored by 赵啸非's avatar 赵啸非

修改区域树查询

parent 400a4a03
......@@ -28,7 +28,6 @@ set JVM_CONFIG=%JVM_CONFIG% -Dapp.name=%PROJECT_NAME%
set JVM_CONFIG=%JVM_CONFIG% -Dapp.port=%PORT%
set JVM_CONFIG=%JVM_CONFIG% -Djava.io.tmpdir=%TEMP_PATH%
set JVM_CONFIG=%JVM_CONFIG% -Dbasedir=%BASEDIR%
set JVM_CONFIG=%JVM_CONFIG% -Dloader.path=file://%BASEDIR%/conf,file://%BASEDIR%/lib
set DEBUG_OPTS=
......
......@@ -60,7 +60,6 @@ exec "$JAVACMD" $JAVA_OPTS \
-Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \
-Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5503 \
-jar $MAIN_CLASS \
> /dev/null &
......
package com.mortals.xhx.base.framework.config;
import com.mortals.framework.springcloud.config.web.BaseWebMvcConfigurer;
import com.mortals.xhx.base.framework.feign.HierarchicalContract;
import feign.Contract;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -12,6 +14,12 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class AccountConfig {
@Bean
public Contract feignContract() {
return new HierarchicalContract();
}
@Bean
public BaseWebMvcConfigurer getBaseWebMvc(){
return new BaseWebMvcConfigurer(false,null);
......
package com.mortals.xhx.base.framework.feign;
import feign.MethodMetadata;
import feign.Util;
import org.springframework.cloud.openfeign.support.SpringMvcContract;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
import static org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation;
/**
* 解决feign不能多继承
* @author: zxfei
* @date: 2021/8/13 0:20
* @description:
**/
public class HierarchicalContract extends SpringMvcContract {
private ResourceLoader resourceLoader;
@Override
public List<MethodMetadata> parseAndValidateMetadata(final Class<?> targetType) {
Util.checkState(targetType.getTypeParameters().length == 0,
"Parameterized types unsupported: %s",
targetType.getSimpleName());
final Map<String, MethodMetadata> result = new LinkedHashMap<>();
for (final Method method : targetType.getMethods()) {
if (method.getDeclaringClass() == Object.class || (method.getModifiers() & Modifier.STATIC) != 0
|| Util.isDefault(method)) {
continue;
}
final MethodMetadata metadata = this.parseAndValidateMetadata(targetType, method);
Util.checkState(!result.containsKey(metadata.configKey()), "Overrides unsupported: %s", metadata.configKey());
result.put(metadata.configKey(), metadata);
}
return new ArrayList<>(result.values());
}
@Override
public MethodMetadata parseAndValidateMetadata(final Class<?> targetType, final Method method) {
final MethodMetadata methodMetadata = super.parseAndValidateMetadata(targetType, method);
final LinkedList<Class<?>> classHierarchy = new LinkedList<>();
classHierarchy.add(targetType);
this.findClass(targetType, method.getDeclaringClass(), classHierarchy);
classHierarchy.stream()
.map(this::processPathValue)
.filter(Optional::isPresent)
.map(Optional::get)
.findFirst()
.ifPresent((path) -> methodMetadata.template().insert(0, path));
return methodMetadata;
}
private Optional<String> processPathValue(final Class<?> clz) {
Optional<String> result = Optional.empty();
final RequestMapping classAnnotation = clz.getAnnotation(RequestMapping.class);
if (classAnnotation != null) {
final RequestMapping synthesizeAnnotation = synthesizeAnnotation(classAnnotation, clz);
// Prepend path from class annotation if specified
if (synthesizeAnnotation.value().length > 0) {
String pathValue = Util.emptyToNull(synthesizeAnnotation.value()[0]);
pathValue = this.resolveValue(pathValue);
if (!pathValue.startsWith("/")) {
pathValue = "/" + pathValue;
}
result = Optional.of(pathValue);
}
}
return result;
}
private String resolveValue(final String value) {
if (StringUtils.hasText(value) && this.resourceLoader instanceof ConfigurableApplicationContext) {
return ((ConfigurableApplicationContext) this.resourceLoader).getEnvironment().resolvePlaceholders(value);
}
return value;
}
@Override
protected void processAnnotationOnClass(final MethodMetadata data, final Class<?> clz) {
// skip this step
}
private boolean findClass(final Class<?> currentClass, final Class<?> searchClass,
final LinkedList<Class<?>> classHierarchy) {
if (currentClass == searchClass) {
return true;
}
final Class<?>[] interfaces = currentClass.getInterfaces();
for (final Class<?> currentInterface : interfaces) {
classHierarchy.add(currentInterface);
final boolean findClass = this.findClass(currentInterface, searchClass, classHierarchy);
if (findClass) {
return true;
}
classHierarchy.removeLast();
}
return false;
}
@Override
public void setResourceLoader(final ResourceLoader resourceLoader) {
this.resourceLoader = resourceLoader;
super.setResourceLoader(resourceLoader);
}
}
package com.mortals.xhx.common;
/**
* @author: zxfei
* @date: 2021/11/22 11:17
* @description:
**/
public class BrokerConfig {
}
......@@ -25,57 +25,6 @@
<common-lib.version>0.0.1-SNAPSHOT</common-lib.version>
</properties>
<!-- <profiles>
<profile>
<id>develop</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profiles.active>develop</profiles.active>
<profiles.server.port>13211</profiles.server.port>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>192.168.0.251:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/mortals/app/logs</profiles.log.path>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<profiles.active>test</profiles.active>
<profiles.server.port>13211</profiles.server.port>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>192.168.0.251:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/mortals/app/logs</profiles.log.path>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<profiles.server.port>19211</profiles.server.port>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>192.168.0.100:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.100</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.nacos.server-addr>192.168.0.100:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>stp</profiles.nacos.namespace>
<profiles.log.path>/mortals/app/logs</profiles.log.path>
</properties>
</profile>
</profiles>-->
<dependencyManagement>
<dependencies>
<dependency>
......
......@@ -265,10 +265,10 @@ size|Integer|否|每页条数,值为-1,查询所有记录
**请求样例:**
```
{
"page":1,
"size":10
}
{
"page":1,
"size":10
}
```
**响应参数:**
......@@ -287,20 +287,10 @@ data|object|数据对象
&emsp;&emsp;loginName|String|登录名
&emsp;&emsp;realName|String|用户名
&emsp;&emsp;mobile|String|用户手机号
&emsp;&emsp;phone|String|用户联系电话
&emsp;&emsp;email|String|用户邮箱
&emsp;&emsp;qq|String|QQ号码
&emsp;&emsp;userType|Integer|用户类型(0.系统用户,1.普通用户,2.工作人员)
&emsp;&emsp;siteIds|String|所属站点id,多个逗号分隔
&emsp;&emsp;areaCodes|String|所属区域code,多个逗号分隔
&emsp;&emsp;roleId|String|所属角色id,多个逗号分隔
&emsp;&emsp;roleName|String|所属角色名称,多个逗号分隔
&emsp;&emsp;status|Integer|用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
&emsp;&emsp;createTime|Date|创建时间
&emsp;&emsp;createUserId|Long|创建用户
&emsp;&emsp;createUserName|String|创建用户名称
&emsp;&emsp;lastLoginTime|Date|最后一次登录时间
&emsp;&emsp;lastLoginAddress|String|最后一次登录地址
dict|object|字典对象
&emsp;userType|object|字典属性对象,详见附录
&emsp;status|object|字典属性对象,详见附录
......@@ -346,20 +336,11 @@ data|object|数据对象
&emsp;loginLimitAddress|String|登录限制地址,多个IP地址用逗号分隔,可以使用IP段匹配,如:172.17.*非空:则只能该值内的IP可以登录
&emsp;realName|String|用户名
&emsp;mobile|String|用户手机号
&emsp;phone|String|用户联系电话
&emsp;email|String|用户邮箱
&emsp;qq|String|QQ号码
&emsp;userType|Integer|用户类型(0.系统用户,1.普通用户,2.工作人员)
&emsp;siteIds|String|所属站点id,多个逗号分隔
&emsp;areaCodes|String|所属区域code,多个逗号分隔
&emsp;roleId|String|所属角色Id,多个逗号分隔
&emsp;roleName|String|所属角色名称,多个逗号分隔
&emsp;status|Integer|用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
&emsp;createTime|Date|创建时间
&emsp;createUserId|Long|创建用户
&emsp;createUserName|String|创建用户名称
&emsp;lastLoginTime|Date|最后一次登录时间
&emsp;lastLoginAddress|String|最后一次登录地址
dict|object|字典对象
&emsp;userType|object|字典属性对象,详见附录
&emsp;status|object|字典属性对象,详见附录
......@@ -369,24 +350,6 @@ dict|object|字典对象
{
"code": 1,
"data": {
"id":3476,
"loginName":"pvnl27",
"loginPwd":"izbru3",
"loginLimitAddress":"bpvgc9",
"realName":"3y7knu",
"mobile":"02xs3t",
"phone":"aoqnmo",
"email":"ecyoti",
"qq":"420syx",
"userType":4214,
"siteIds":"m54eoc",
"areaCodes":"utuj9d",
"status":8589,
"createTime":"2022-06-02",
"createUserId":9375,
"createUserName":"ts6g6e",
"lastLoginTime":"2022-06-02",
"lastLoginAddress":"mwpz6s"
}
}
```
......@@ -409,28 +372,17 @@ loginName|String|是|登录名
loginPwd|String|是|登录密码
realName|String|是|用户真实姓名
mobile|String|是|用户手机号
phone|String|是|用户联系电话
email|String|是|用户邮箱
qq|String|是|QQ号码
userType|Integer|是|用户类型(0.系统用户,1.普通用户,2.工作人员)
siteIds|String|是|所属站点id,多个逗号分隔
areaCodes|String|是|所属区域code,多个逗号分隔
status|Integer|是|用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
siteIds|String|否|所属站点id,多个逗号分隔
areaCodes|String|否|所属区域code,多个逗号分隔
**请求样例:**
```
{
"loginName":"6njc9h",
"loginPwd":"e8iiea",
"realName":"coyvcd",
"mobile":"avklzq",
"phone":"6da3c3",
"email":"yyl8wf",
"qq":"y8tw1p",
"userType":4441,
"siteIds":"hgh6s1",
"areaCodes":"a4cexd",
"status":710
"areaCodes":"a4cexd"
}
```
......@@ -443,25 +395,15 @@ msg|String|消息
data|object|数据对象
&emsp;id|Long|保存后主键id
&emsp;entity|object|保存更新实体
&emsp;&emsp;id|Long|用户ID,主键,自增长
&emsp;&emsp;id|Long|用户ID
&emsp;&emsp;loginName|String|登录名
&emsp;&emsp;loginLimitAddress|String|登录限制地址,多个IP地址用逗号分隔,可以使用IP段匹配,如:172.17.*非空:则只能该值内的IP可以登录
&emsp;&emsp;realName|String|用户名
&emsp;&emsp;mobile|String|用户手机号
&emsp;&emsp;phone|String|用户联系电话
&emsp;&emsp;email|String|用户邮箱
&emsp;&emsp;qq|String|QQ号码
&emsp;&emsp;userType|Integer|用户类型(0.系统用户,1.普通用户,2.工作人员)
&emsp;&emsp;siteIds|String|所属站点id,多个逗号分隔
&emsp;&emsp;areaCodes|String|所属区域code,多个逗号分隔
&emsp;&emsp;roleId|String|所属角色id,多个逗号分隔
&emsp;&emsp;roleName|String|所属角色名称,多个逗号分隔
&emsp;&emsp;status|Integer|用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
&emsp;&emsp;createTime|Date|创建时间
&emsp;&emsp;createUserId|Long|创建用户
&emsp;&emsp;createUserName|String|创建用户名称
&emsp;&emsp;lastLoginTime|Date|最后一次登录时间
&emsp;&emsp;lastLoginAddress|String|最后一次登录地址
**响应消息样例:**
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment