Skip to content

Commit

Permalink
【重大变更】重构项目结构,将meta文件保存到独立的meta模块中。已经生成的代码需要按照NopMigrateTask中的做法进行迁移
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Aug 19, 2023
1 parent 6489ec5 commit 9af52c4
Show file tree
Hide file tree
Showing 370 changed files with 1,368 additions and 444 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# 更新日志

## 变更 2023-08-19
* 重构项目结构,将meta文件保存到独立的meta模块中。已经生成的代码需要按照NopMigrateTask中的做法进行迁移
2 changes: 1 addition & 1 deletion docs/dev-guide/graphql/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthResource&gt;"
bizObjName="NopAuthResource"/>
</prop>
<!--LOC:[90:22:0:0]/nop/biz/xlib/biz-gen.xlib#/_delta/default/nop/auth/model/NopAuthSite/NopAuthSite.xmeta-->
<!--LOC:[90:22:0:0]/nop/core/xlib/biz-gen.xlib#/_delta/default/nop/auth/model/NopAuthSite/NopAuthSite.xmeta-->
<prop name="resourcesConnection" displayName="资源列表" internal="true" graphql:connectionProp="resources">
<graphql:inputType>io.nop.api.core.beans.graphql.GraphQLConnectionInput</graphql:inputType>
<schema type="io.nop.api.core.beans.graphql.GraphQLConnection&lt;io.nop.auth.dao.entity.NopAuthResource&gt;"
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-guide/recipe/add-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ public class NopAuthRoleBizModel extends CrudBizModel<NopAuthRole> {
$toLocalDate是扩展类型转换函数。所有的表达式最后都可以通过$toLocalDate/$toInt()等方式调用ConvertHelper上的类型转换函数。

对于一些常见的可复用转换函数等,我们可以利用Nop平台内置的`x:gen-extends``x:post-extends`等元编程机制自动生成属性定义。
参见[biz-gen.xlib](https://gitee.com/canonical-entropy/nop-entropy/blob/master/nop-biz/src/main/resources/_vfs/nop/biz/xlib/biz-gen.xlib)
参见[biz-gen.xlib](https://gitee.com/canonical-entropy/nop-entropy/blob/master/nop-biz/src/main/resources/_vfs/nop/core/xlib/biz-gen.xlib)

8 changes: 8 additions & 0 deletions docs/theory/advantage-of-lowcode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 低代码开发的优势体现在哪里?

很多人对低代码开发的理解局限在可视化拖拉拽,坦率的说,如果仅仅是一种辅助开发的可视化界面,它很难说有什么本质上的优势。从生产效率上说,熟练一些的程序员手工编写代码的速度一般会超越可视化设计界面(很多人有可视化设计器也不使用),而且编写代码还可以利用函数、组件等抽象手段进行封装,持续减少需要重复编写的代码量。而使用可视化设计工具,一般情况下会绑定到某种组件结构,使用者完全被束缚在一定的抽象层次上,无法在此基础上进行再次封装,大量类似的设置不得不在多个页面上重复又重复。可视化界面会在初期方便那些对组件属性不熟悉、对一般编程概念缺乏了解的人员,除此以外的作用可以说乏善可陈。

> 有些相对完善的低代码平台会提供丰富的组件库,使用这些精心设计和调制好的组件可以大大加快开发速度。但本质上这种开发优势不是由低代码开发平台带来的,而是由组件库带来的。如果组件库直接开源,那么直接编写代码引用这些组件库同样可以极大的加快开发速度。
如果仅仅把低代码看作是一种工具类产品,那它既有优势又有很明显的劣势,比如可调试性、可扩展性等一般都大大落后于传统开发模式。但是,如果从更广泛的编程范式演化的角度上说,低代码开发意味着新一轮的编程范式的迁移和转换,描述式编程借着低代码的东风正在不断蚕食命令式编程的传统领地,呼唤着新的融合式的编程范式。

2 changes: 1 addition & 1 deletion docs/theory/xdsl-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Nop平台提供了一个IDEA插件[nop-idea-plugin](https://gitee.com/canonical-
x:schema="/nop/schema/xmeta.xdef" xmlns:x="/nop/schema/xdsl.xdef" >

<x:post-extends>
<biz-gen:GenDictLabelFields xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:GenDictLabelFields xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>
</meta>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package io.nop.api.core.beans.graphql;

import io.nop.api.core.annotations.data.DataBean;
import io.nop.api.core.annotations.graphql.GraphQLInput;
import io.nop.api.core.beans.TreeBean;
import io.nop.api.core.beans.query.OrderFieldBean;

Expand All @@ -17,6 +18,7 @@
* 针对关联子表的查询条件,属性命名与GraphQL标准的Connection保持一致
*/
@DataBean
@GraphQLInput
public class GraphQLConnectionInput {
/**
* first表示从afterCursor开始向后取n条数据
Expand Down
2 changes: 1 addition & 1 deletion nop-auth/nop-auth-app/src/main/resources/nop-vfs-index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
/nop/biz/beans/biz-defaults.beans.xml
/nop/biz/xlib/biz!check.xlib
/nop/biz/xlib/biz!filter.xlib
/nop/biz/xlib/biz-gen.xlib
/nop/core/xlib/biz-gen.xlib
/nop/codegen/xlib/gen.xlib
/nop/codegen/xlib/meta-gen.xlib
/nop/codegen/xlib/web-gen.xlib
Expand Down
41 changes: 41 additions & 0 deletions nop-auth/nop-auth-meta/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<artifactId>nop-auth</artifactId>
<groupId>io.github.entropy-cloud</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>nop-auth-meta</artifactId>

<dependencies>
<dependency>
<artifactId>nop-auth-codegen</artifactId>
<groupId>io.github.entropy-cloud</groupId>
<version>2.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>nop-auth-dao</artifactId>
<groupId>io.github.entropy-cloud</groupId>
<version>2.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<classpathScope>test</classpathScope>
</configuration>
</plugin>
</plugins>
</build>
</project>
4 changes: 4 additions & 0 deletions nop-auth/nop-auth-meta/precompile/gen-meta.xgen
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<c:script>
codeGenerator.renderModel('/nop/auth/orm/app.orm.xml','/nop/templates/meta', '/',$scope);
</c:script>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<displayProp>deptName</displayProp>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -77,7 +77,7 @@
<prop name="parent" displayName="父资源" i18n-en:displayName="Parent" tagSet="pub,ref-pub" ext:kind="to-one"
internal="true" queryable="true" ext:joinLeftProp="parentId" ext:joinRightProp="deptId"
ext:joinRightDisplayProp="deptName" insertable="false" updatable="false" lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthDept" bizObjName="NopAuthDept"/>
<schema bizObjName="NopAuthDept"/>
</prop>
<prop name="parent.deptName" displayName="父资源" i18n-en:displayName="Parent" internal="true" queryable="true"
sortable="true" lazy="true">
Expand All @@ -86,7 +86,9 @@
<prop name="children" displayName="子资源" i18n-en:displayName="Children" tagSet="pub" ext:kind="to-many"
internal="true" ext:joinLeftProp="deptId" ext:joinRightProp="parentId" ext:joinRightDisplayProp="deptName"
insertable="false" updatable="false" lazy="true">
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthDept&gt;" bizObjName="NopAuthDept"/>
<schema>
<item bizObjName="NopAuthDept"/>
</schema>
</prop>
</props>
</meta>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<primaryKey>userId,loginType</primaryKey>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -57,7 +57,7 @@
<prop name="user" displayName="用户" i18n-en:displayName="User" ext:kind="to-one" internal="true" queryable="true"
ext:joinLeftProp="userId" ext:joinRightProp="userId" ext:joinRightDisplayProp="userName" mandatory="true"
lazy="true" published="false">
<schema type="io.nop.auth.dao.entity.NopAuthUser" bizObjName="NopAuthUser"/>
<schema bizObjName="NopAuthUser"/>
</prop>
</props>
</meta>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<primaryKey>logId</primaryKey>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -69,7 +69,7 @@
<prop name="session" displayName="会话" i18n-en:displayName="Session" tagSet="pub" ext:kind="to-one"
internal="true" queryable="true" ext:joinLeftProp="sessionId" ext:joinRightProp="sessionId"
insertable="false" updatable="false" lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthSession" bizObjName="NopAuthSession"/>
<schema bizObjName="NopAuthSession"/>
</prop>
</props>
</meta>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<displayProp>name</displayProp>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<displayProp>displayName</displayProp>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -136,7 +136,7 @@
ext:kind="to-one" internal="true" queryable="true" ext:joinLeftProp="parentId"
ext:joinRightProp="resourceId" ext:joinRightDisplayProp="displayName" insertable="false" updatable="false"
lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthResource" bizObjName="NopAuthResource"/>
<schema bizObjName="NopAuthResource"/>
</prop>
<prop name="parent.displayName" displayName="父资源" i18n-en:displayName="Parent" internal="true" queryable="true"
sortable="true" lazy="true">
Expand All @@ -146,7 +146,7 @@
tagSet="pub,ref-pub,cascade-delete,ref-connection,queryable,sortable" ext:kind="to-one" internal="true"
queryable="true" ext:joinLeftProp="siteId" ext:joinRightProp="siteId"
ext:joinRightDisplayProp="displayName" insertable="false" updatable="false" mandatory="true" lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthSite" bizObjName="NopAuthSite"/>
<schema bizObjName="NopAuthSite"/>
</prop>
<prop name="site.displayName" displayName="子系统" i18n-en:displayName="Site" internal="true" queryable="true"
sortable="true" lazy="true">
Expand All @@ -155,15 +155,17 @@
<prop name="children" displayName="子资源" i18n-en:displayName="Children" tagSet="pub" ext:kind="to-many"
internal="true" ext:joinLeftProp="resourceId" ext:joinRightProp="parentId"
ext:joinRightDisplayProp="displayName" insertable="false" updatable="false" lazy="true">
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthResource&gt;"
bizObjName="NopAuthResource"/>
<schema>
<item bizObjName="NopAuthResource"/>
</schema>
</prop>
<prop name="roleMappings" displayName="角色映射" i18n-en:displayName="Roles"
tagSet="pub,cascade-delete,insertable,updatable" ext:kind="to-many" internal="true"
ext:joinLeftProp="resourceId" ext:joinRightProp="resourceId" insertable="true" updatable="true"
lazy="true">
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthRoleResource&gt;"
bizObjName="NopAuthRoleResource"/>
<schema>
<item bizObjName="NopAuthRoleResource"/>
</schema>
</prop>
<prop name="metaConfigComponent" tagSet="json,pub" ext:kind="component" internal="true" insertable="true"
updatable="true" lazy="true">
Expand All @@ -175,7 +177,7 @@
</prop>
<prop name="relatedRoleList" displayName="角色列表" i18n-en:displayName="Role List" ext:kind="to-many"
internal="true" lazy="true">
<schema type="List&lt;io.nop.auth.dao.entity.NopAuthRole&gt;">
<schema>
<item bizObjName="NopAuthRole"/>
</schema>
</prop>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<displayProp>roleName</displayProp>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys>
Expand Down Expand Up @@ -65,18 +65,20 @@
<prop name="userMappings" displayName="用户映射" i18n-en:displayName="UserMappings"
tagSet="pub,cascade-delete,insertable,updatable" ext:kind="to-many" internal="true"
ext:joinLeftProp="roleId" ext:joinRightProp="roleId" insertable="true" updatable="true" lazy="true">
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthUserRole&gt;"
bizObjName="NopAuthUserRole"/>
<schema>
<item bizObjName="NopAuthUserRole"/>
</schema>
</prop>
<prop name="resourceMappings" displayName="资源映射" i18n-en:displayName="Resources"
tagSet="pub,cascade-delete,insertable,updatable" ext:kind="to-many" internal="true"
ext:joinLeftProp="roleId" ext:joinRightProp="roleId" insertable="true" updatable="true" lazy="true">
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthRoleResource&gt;"
bizObjName="NopAuthRoleResource"/>
<schema>
<item bizObjName="NopAuthRoleResource"/>
</schema>
</prop>
<prop name="relatedUserList" displayName="用户列表" i18n-en:displayName="User List" ext:kind="to-many"
internal="true" lazy="true">
<schema type="List&lt;io.nop.auth.dao.entity.NopAuthUser&gt;">
<schema>
<item bizObjName="NopAuthUser"/>
</schema>
</prop>
Expand All @@ -91,7 +93,7 @@
</prop>
<prop name="relatedResourceList" displayName="资源列表" i18n-en:displayName="Resource List" ext:kind="to-many"
internal="true" lazy="true">
<schema type="List&lt;io.nop.auth.dao.entity.NopAuthResource&gt;">
<schema>
<item bizObjName="NopAuthResource"/>
</schema>
</prop>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<primaryKey>sid</primaryKey>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -70,7 +70,7 @@
tagSet="pub,ref-pub,ref-cascade-delete,ref-insertable,ref-updatable" ext:kind="to-one" internal="true"
queryable="true" ext:joinLeftProp="roleId" ext:joinRightProp="roleId" ext:joinRightDisplayProp="roleName"
insertable="false" updatable="false" mandatory="true" lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthRole" bizObjName="NopAuthRole"/>
<schema bizObjName="NopAuthRole"/>
</prop>
<prop name="role.roleName" displayName="角色" i18n-en:displayName="Role" internal="true" queryable="true"
sortable="true" lazy="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<primaryKey>sid</primaryKey>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -58,7 +58,7 @@
tagSet="pub,ref-pub,ref-cascade-delete,ref-insertable,ref-updatable" ext:kind="to-one" internal="true"
queryable="true" ext:joinLeftProp="roleId" ext:joinRightProp="roleId" ext:joinRightDisplayProp="roleName"
insertable="false" updatable="false" mandatory="true" lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthRole" bizObjName="NopAuthRole"/>
<schema bizObjName="NopAuthRole"/>
</prop>
<prop name="role.roleName" displayName="角色" i18n-en:displayName="Role" internal="true" queryable="true"
sortable="true" lazy="true">
Expand All @@ -68,7 +68,7 @@
tagSet="pub,ref-pub,ref-cascade-delete,ref-insertable,ref-updatable" ext:kind="to-one" internal="true"
queryable="true" ext:joinLeftProp="resourceId" ext:joinRightProp="resourceId"
ext:joinRightDisplayProp="displayName" insertable="false" updatable="false" lazy="true">
<schema type="io.nop.auth.dao.entity.NopAuthResource" bizObjName="NopAuthResource"/>
<schema bizObjName="NopAuthResource"/>
</prop>
<prop name="resource.displayName" displayName="资源" i18n-en:displayName="Resource" internal="true"
queryable="true" sortable="true" lazy="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<primaryKey>sessionId</primaryKey>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<displayProp>displayName</displayProp>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down Expand Up @@ -71,8 +71,9 @@
<prop name="resources" displayName="资源列表" i18n-en:displayName="Resources" tagSet="pub,connection"
ext:kind="to-many" internal="true" ext:joinLeftProp="siteId" ext:joinRightProp="siteId"
ext:joinRightDisplayProp="displayName" insertable="false" updatable="false" lazy="true">
<schema type="io.nop.orm.IOrmEntitySet&lt;io.nop.auth.dao.entity.NopAuthResource&gt;"
bizObjName="NopAuthResource"/>
<schema>
<item bizObjName="NopAuthResource"/>
</schema>
</prop>
<prop name="extConfigComponent" tagSet="json,pub" ext:kind="component" internal="true" insertable="true"
updatable="true" lazy="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<displayProp>name</displayProp>

<x:post-extends>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/biz/xlib/biz-gen.xlib"/>
<biz-gen:DefaultMetaPostExtends xpl:lib="/nop/core/xlib/biz-gen.xlib"/>
</x:post-extends>

<keys/>
Expand Down
Loading

0 comments on commit 9af52c4

Please sign in to comment.