commit 760f7ab0c3cbc1c45b64187dd3e30c64ce9fb8ad Author: onlyxx Date: Tue Dec 22 22:20:19 2020 +0800 第五章 diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..2f33908 --- /dev/null +++ b/build.gradle @@ -0,0 +1,128 @@ +apply plugin: 'java' + + +ext { + /** + * 项目中依赖的jar的路径 + * 1.如果依赖的jar需要打包到zip中,放置在lib根目录下 + * 2.如果依赖的jar仅仅是编译时需要,防止在lib下子目录下即可 + */ + libPath = "$projectDir/../webroot/WEB-INF/lib" + + /** + * 是否对插件的class进行加密保护,防止反编译 + */ + guard = true + + def pluginInfo = getPluginInfo() + pluginPre = "fine-plugin" + pluginName = pluginInfo.id + pluginVersion = pluginInfo.version + + outputPath = "$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0/classes" +} + +group = 'com.fr.plugin' +version = '10.0' +sourceCompatibility = '8' + +sourceSets { + main { + java.outputDir = file(outputPath) + output.resourcesDir = file(outputPath) + } +} + +ant.importBuild("encrypt.xml") +//定义ant变量 +ant.projectDir = projectDir +ant.references["compile.classpath"] = ant.path { + fileset(dir: libPath, includes: '**/*.jar') + fileset(dir: ".", includes: "**/*.jar") +} + +classes.dependsOn('clean') + +task copyFiles(type: Copy, dependsOn: 'classes') { + from outputPath + into "$projectDir/classes" +} + +task preJar(type: Copy, dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plain_javas') { + from "$projectDir/classes" + into "$projectDir/transform-classes" + include "**/*.*" +} +jar.dependsOn("preJar") +classes.dependsOn("copyPluginXML") + +task copyPluginXML(type: Copy) { + print "copyed plugin.xml file" + from "$projectDir/plugin.xml" + into file("$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0/") +} +task makeJar(type: Jar, dependsOn: preJar) { + from fileTree(dir: "$projectDir/transform-classes") + baseName pluginPre + appendix pluginName + version pluginVersion + destinationDir = file("$buildDir/libs") + + doLast() { + delete file("$projectDir/classes") + delete file("$projectDir/transform-classes") + } +} + +task copyFile(type: Copy, dependsOn: ["makeJar"]) { + from "$buildDir/libs" + from("$projectDir/lib") { + include "*.jar" + } + from "$projectDir/plugin.xml" + into file("$buildDir/temp/plugin") +} + +task zip(type: Zip, dependsOn: ["copyFile"]) { + from "$buildDir/temp/plugin" + destinationDir file("$buildDir/install") + baseName pluginPre + appendix pluginName + version pluginVersion +} + +//控制build时包含哪些文件,排除哪些文件 +processResources { +// exclude everything +// 用*.css没效果 +// exclude '**/*.css' +// except this file +// include 'xx.xml' +} + +/*读取plugin.xml中的version*/ + +def getPluginInfo() { + def xmlFile = file("plugin.xml") + if (!xmlFile.exists()) { + return ["id": "none", "version": "1.0.0"] + } + def plugin = new XmlParser().parse(xmlFile) + def version = plugin.version[0].text() + def id = plugin.id[0].text() + return ["id": id, "version": version] +} + +repositories { + mavenLocal() + maven { + url = uri('http://mvn.finedevelop.com/repository/maven-public/') + } +} + +dependencies { + //使用本地jar + implementation fileTree(dir: 'lib', include: ['**/*.jar']) + implementation fileTree(dir: libPath, include: ['**/*.jar']) +} + diff --git a/doc/插件开发成长计划系列教程-第五章.pptx b/doc/插件开发成长计划系列教程-第五章.pptx new file mode 100644 index 0000000..ef8711c Binary files /dev/null and b/doc/插件开发成长计划系列教程-第五章.pptx differ diff --git a/encrypt.xml b/encrypt.xml new file mode 100644 index 0000000..1401cd1 --- /dev/null +++ b/encrypt.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/gson-2.3.1.jar b/lib/gson-2.3.1.jar new file mode 100644 index 0000000..250132c Binary files /dev/null and b/lib/gson-2.3.1.jar differ diff --git a/lib/report/.gitkeep b/lib/report/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..570ca39 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,36 @@ + + + com.fr.plugin.zzl.db.config + + yes + 1.0 + 10.0 + 2018-07-31 + author + + + [2018-07-31]初始化插件。
+ ]]>
+ + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..a6ffd32 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# 函数插件 + +该函数可以对一组数值求绝对值。 \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/MyDecisionDBAccessProvider.java b/src/main/java/com/fr/plugin/MyDecisionDBAccessProvider.java new file mode 100644 index 0000000..6d0edbf --- /dev/null +++ b/src/main/java/com/fr/plugin/MyDecisionDBAccessProvider.java @@ -0,0 +1,50 @@ +package com.fr.plugin; + + +import com.fr.decision.plugin.db.AbstractDecisionDBAccessProvider; +import com.fr.plugin.dao.MyDao; +import com.fr.plugin.entity.MyEntity; +import com.fr.plugin.transform.ExecuteFunctionRecord; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.stable.db.accessor.DBAccessor; +import com.fr.stable.db.dao.BaseDAO; +import com.fr.stable.db.dao.DAOProvider; + +//第一步类 继承AbstractDecisionDBAccessProvider +@FunctionRecorder +public class MyDecisionDBAccessProvider extends AbstractDecisionDBAccessProvider { + + //第二步 注册数据库访问类 + @Override + @ExecuteFunctionRecord + public DAOProvider[] registerDAO() { + return new DAOProvider[]{ + //注意这里是匿名类 + new DAOProvider() { + @Override + public Class getEntityClass() { + return MyEntity.class; + } + + @Override + public Class getDAOClass() { + return MyDao.class; + } + } + }; + } + + //第三步新建一个DBAccessor 静态变量 + private static DBAccessor dbAccessor = null; + + //第四步写一个公开的静态方法去获取DBAccessor + public static DBAccessor getDbAccessor() { + return dbAccessor; + } + + //第五步 重写数据库访问器注入函数(当数据库访问器准备好之后由fr注入到这里) + @Override + public void onDBAvailable(DBAccessor dbAccessor) { + MyDecisionDBAccessProvider.dbAccessor = dbAccessor; + } +} diff --git a/src/main/java/com/fr/plugin/MyFunctionConstants.java b/src/main/java/com/fr/plugin/MyFunctionConstants.java new file mode 100644 index 0000000..8d2c2d6 --- /dev/null +++ b/src/main/java/com/fr/plugin/MyFunctionConstants.java @@ -0,0 +1,6 @@ +package com.fr.plugin; + +public class MyFunctionConstants { + + public static final String PLUGIN_ID = "com.fr.plugin.zzl.db.config"; +} diff --git a/src/main/java/com/fr/plugin/MyHttpProvider.java b/src/main/java/com/fr/plugin/MyHttpProvider.java new file mode 100644 index 0000000..71d8233 --- /dev/null +++ b/src/main/java/com/fr/plugin/MyHttpProvider.java @@ -0,0 +1,18 @@ +package com.fr.plugin; + +import com.fr.decision.fun.HttpHandler; +import com.fr.decision.fun.impl.AbstractHttpHandlerProvider; +import com.fr.plugin.http.AddApi; +import com.fr.plugin.http.ListApi; +import com.fr.plugin.http.ModApi; + +public class MyHttpProvider extends AbstractHttpHandlerProvider { + @Override + public HttpHandler[] registerHandlers() { + return new HttpHandler[]{ + new ListApi(), + new AddApi(), + new ModApi() + }; + } +} diff --git a/src/main/java/com/fr/plugin/MyLife.java b/src/main/java/com/fr/plugin/MyLife.java new file mode 100644 index 0000000..a3a420e --- /dev/null +++ b/src/main/java/com/fr/plugin/MyLife.java @@ -0,0 +1,19 @@ +package com.fr.plugin; + +import com.fr.plugin.config.MyConfig; +import com.fr.plugin.config.MySimpleConfig; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor; + +public class MyLife extends AbstractPluginLifecycleMonitor { + @Override + public void afterRun(PluginContext pluginContext) { + MyConfig.getInstance();//初始化激活一下插件配置 + MySimpleConfig.getInstance(); + } + + @Override + public void beforeStop(PluginContext pluginContext) { + + } +} diff --git a/src/main/java/com/fr/plugin/MyLocalFinder.java b/src/main/java/com/fr/plugin/MyLocalFinder.java new file mode 100644 index 0000000..7064243 --- /dev/null +++ b/src/main/java/com/fr/plugin/MyLocalFinder.java @@ -0,0 +1,10 @@ +package com.fr.plugin; + +import com.fr.stable.fun.impl.AbstractLocaleFinder; + +public class MyLocalFinder extends AbstractLocaleFinder { + @Override + public String find() { + return "com/fr/plugin/my18n"; + } +} diff --git a/src/main/java/com/fr/plugin/MyURLAlias2Provider.java b/src/main/java/com/fr/plugin/MyURLAlias2Provider.java new file mode 100644 index 0000000..1ce5988 --- /dev/null +++ b/src/main/java/com/fr/plugin/MyURLAlias2Provider.java @@ -0,0 +1,20 @@ +package com.fr.plugin; + +import com.fr.decision.fun.impl.AbstractURLAliasProvider; +import com.fr.decision.webservice.url.alias.URLAlias; +import com.fr.decision.webservice.url.alias.URLAliasFactory; +import com.fr.plugin.transform.ExecuteFunctionRecord; +import com.fr.plugin.transform.FunctionRecorder; + +@FunctionRecorder +public class MyURLAlias2Provider extends AbstractURLAliasProvider { + @Override + @ExecuteFunctionRecord + public URLAlias[] registerAlias() { + return new URLAlias[]{ + URLAliasFactory.createPluginAlias("/createMyData","/add",true), + URLAliasFactory.createPluginAlias("/editorMyData","/mod",true), + URLAliasFactory.createPluginAlias("/listMyData","/list",true), + }; + } +} diff --git a/src/main/java/com/fr/plugin/config/MyConfig.java b/src/main/java/com/fr/plugin/config/MyConfig.java new file mode 100644 index 0000000..f58a1ca --- /dev/null +++ b/src/main/java/com/fr/plugin/config/MyConfig.java @@ -0,0 +1,53 @@ +package com.fr.plugin.config; + +import com.fr.config.ConfigContext; +import com.fr.config.DefaultConfiguration; +import com.fr.config.holder.Conf; +import com.fr.config.holder.factory.Holders; +import com.fr.stable.StringUtils; + +//第一步类继承自DefaultConfiguration +public class MyConfig extends DefaultConfiguration { + private static MyConfig config = null; + + //第二步写一个单例访问器(相当于注册配置和初始化) + public static MyConfig getInstance() { + if (config == null) { + config = ConfigContext.getConfigInstance(MyConfig.class); + } + return config; + } + + //补充,可以通过重写这个父类实现来实现在数据库中配置的namespace + @Override + public String getNameSpace() { + return "zzlMyConfig"; + } + + //第三步 注册要写的配置 + private Conf minSource = Holders.simple(60); + private Conf maxSource = Holders.simple(100); + + //第四步生成对应配置的get和set,注意这里要手动将Conf<*> 直接改成 * +// public void setApiUrl(Conf apiUrl) { +// this.apiUrl = apiUrl; +// } + + + + public Integer getMinSource() { + return minSource.get(); + } + + public void setMinSource(Integer minSource) { + this.minSource.set(minSource); + } + + public Integer getMaxSource() { + return maxSource.get(); + } + + public void setMaxSource(Integer maxSource) { + this.maxSource.set(maxSource); + } +} diff --git a/src/main/java/com/fr/plugin/config/MySimpleConfig.java b/src/main/java/com/fr/plugin/config/MySimpleConfig.java new file mode 100644 index 0000000..efaf7c3 --- /dev/null +++ b/src/main/java/com/fr/plugin/config/MySimpleConfig.java @@ -0,0 +1,85 @@ +package com.fr.plugin.config; + +import com.fr.config.*; +import com.fr.config.holder.Conf; +import com.fr.config.holder.factory.Holders; +import com.fr.stable.StringUtils; + +@Visualization(category = "Plugin-Config_Demo") +public class MySimpleConfig extends DefaultConfiguration { + private static volatile MySimpleConfig config = null; + + public static MySimpleConfig getInstance() { + if (config == null) { + config = ConfigContext.getConfigInstance(MySimpleConfig.class); + } + return config; + } + + + @Identifier(value = "text", name = "Plugin-Config_Property_Text", description = "Plugin-Config_Property_Text_Description", status = Status.SHOW) + private Conf text = Holders.simple(StringUtils.EMPTY); + + @Identifier(value = "count", name = "Plugin-Config_Property_Count", description = "Plugin-Config_Property_Count_Description", status = Status.SHOW) + private Conf count = Holders.simple(100); + + @Identifier(value = "price", name = "Plugin-Config_Property_Price", description = "Plugin-Config_Property_Price_Description", status = Status.SHOW) + private Conf price = Holders.simple(1000.0); + + @Identifier(value = "time", name = "Plugin-Config_Property_Time", description = "Plugin-Config_Property_Time_Description", status = Status.SHOW) + private Conf time = Holders.simple(99999999L); + + @Identifier(value = "student", name = "Plugin-Config_Property_Student", description = "Plugin-Config_Property_Student_Description", status = Status.SHOW) + private Conf student = Holders.simple(true); + + public String getText() { + return text.get(); + } + + public void setText(String text) { + this.text.set(text); + } + + public Integer getCount() { + return count.get(); + } + + public void setCount(Integer count) { + this.count.set(count); + } + + public Double getPrice() { + return price.get(); + } + + public void setPrice(Double price) { + this.price.set(price); + } + + public Long getTime() { + return time.get(); + } + + public void setTime(Long time) { + this.time.set(time); + } + + public Boolean getStudent() { + return student.get(); + } + + public void setStudent(Boolean student) { + this.student.set(student); + } + + @Override + public Object clone() throws CloneNotSupportedException { + MySimpleConfig cloned = (MySimpleConfig) super.clone(); + cloned.text = (Conf) text.clone(); + cloned.count = (Conf) count.clone(); + cloned.price = (Conf) price.clone(); + cloned.time = (Conf) time.clone(); + cloned.student = (Conf) student.clone(); + return cloned; + } +} diff --git a/src/main/java/com/fr/plugin/dao/MyDao.java b/src/main/java/com/fr/plugin/dao/MyDao.java new file mode 100644 index 0000000..6b54ae4 --- /dev/null +++ b/src/main/java/com/fr/plugin/dao/MyDao.java @@ -0,0 +1,17 @@ +package com.fr.plugin.dao; + +import com.fr.plugin.entity.MyEntity; +import com.fr.stable.db.dao.BaseDAO; +import com.fr.stable.db.session.DAOSession; + + +public class MyDao extends BaseDAO { + public MyDao(DAOSession daoSession) { + super(daoSession); + } + + @Override + protected Class getEntityClass() { + return MyEntity.class; + } +} diff --git a/src/main/java/com/fr/plugin/entity/MyEntity.java b/src/main/java/com/fr/plugin/entity/MyEntity.java new file mode 100644 index 0000000..a4d775c --- /dev/null +++ b/src/main/java/com/fr/plugin/entity/MyEntity.java @@ -0,0 +1,59 @@ +package com.fr.plugin.entity; + +import com.fr.stable.db.entity.BaseEntity; +import com.fr.third.javax.persistence.Column; +import com.fr.third.javax.persistence.Entity; +import com.fr.third.javax.persistence.Table; + +import java.util.Date; + +//第一步添加这两个注解,特别是table的name属性要唯一,并将类继承到BaseEntity,会自动生产id字段 +@Entity +@Table( + name = "zzl_my_table" +) +public class MyEntity extends BaseEntity { + + //第二步注册要使用的字段加上@Column注解 + @Column( + name = "userName", + unique = true +// scale = 0, +// length = 255 + ) + private String userName; + + @Column( + name = "source" + ) + private Integer source; + @Column( + name = "createTime" + ) + private Date createTime; + + //第三步生成对应的get和set + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Integer getSource() { + return source; + } + + public void setSource(Integer source) { + this.source = source; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/src/main/java/com/fr/plugin/http/AddApi.java b/src/main/java/com/fr/plugin/http/AddApi.java new file mode 100644 index 0000000..7c0c79b --- /dev/null +++ b/src/main/java/com/fr/plugin/http/AddApi.java @@ -0,0 +1,77 @@ +package com.fr.plugin.http; + +import com.fr.decision.fun.impl.BaseHttpHandler; +import com.fr.json.JSONObject; +import com.fr.plugin.MyDecisionDBAccessProvider; +import com.fr.plugin.config.MyConfig; +import com.fr.plugin.dao.MyDao; +import com.fr.plugin.entity.MyEntity; +import com.fr.stable.db.accessor.DBAccessor; +import com.fr.third.springframework.web.bind.annotation.RequestMethod; +import com.fr.web.utils.WebUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Date; +import java.util.UUID; + +public class AddApi extends BaseHttpHandler { + @Override + public RequestMethod getMethod() { + return null; + } + + @Override + public String getPath() { + return "/add"; + } + + @Override + public boolean isPublic() { + return true; + } + + @Override + public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + DBAccessor dbAccessor = MyDecisionDBAccessProvider.getDbAccessor(); + //通过这两个函数获取的参数可以避免中文乱码和空指针 + String userName = WebUtils.getHTTPRequestParameter(httpServletRequest, "userName"); + Integer source = WebUtils.getHTTPRequestIntParameter(httpServletRequest, "source"); + //使用配置 + MyConfig myConfig = MyConfig.getInstance(); + Integer minSource = myConfig.getMinSource(); + Integer maxSource = myConfig.getMaxSource(); + + //参数校验 + if(sourcemaxSource){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("msg", "add source fail ,source bigger than "+maxSource); + jsonObject.put("code", 101); + WebUtils.printAsJSON(httpServletResponse, jsonObject); + return; + } + MyEntity myEntity = new MyEntity(); + myEntity.setSource(source); + myEntity.setUserName(userName); + myEntity.setId(UUID.randomUUID().toString()); + myEntity.setCreateTime(new Date()); + + //执行新增操作 + dbAccessor.runDMLAction(daoContext -> { + daoContext.getDAO(MyDao.class).add(myEntity); + return null; + }); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("msg", "success"); + jsonObject.put("code", 200); + WebUtils.printAsJSON(httpServletResponse, jsonObject); + } +} diff --git a/src/main/java/com/fr/plugin/http/ListApi.java b/src/main/java/com/fr/plugin/http/ListApi.java new file mode 100644 index 0000000..e69ae4d --- /dev/null +++ b/src/main/java/com/fr/plugin/http/ListApi.java @@ -0,0 +1,56 @@ +package com.fr.plugin.http; + +import com.fr.decision.fun.impl.BaseHttpHandler; +import com.fr.json.JSONArray; +import com.fr.json.JSONArrayWriter; +import com.fr.json.JSONObject; +import com.fr.json.JSONObjectWriter; +import com.fr.plugin.MyDecisionDBAccessProvider; +import com.fr.plugin.dao.MyDao; +import com.fr.plugin.entity.MyEntity; +import com.fr.stable.StringUtils; +import com.fr.stable.db.accessor.DBAccessor; +import com.fr.stable.db.action.DBAction; +import com.fr.stable.db.dao.DAOContext; +import com.fr.stable.query.QueryFactory; +import com.fr.stable.query.condition.QueryCondition; +import com.fr.stable.query.restriction.RestrictionFactory; +import com.fr.third.springframework.web.bind.annotation.RequestMethod; +import com.fr.web.utils.WebUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +public class ListApi extends BaseHttpHandler { + @Override + public RequestMethod getMethod() { + return null; + } + + @Override + public String getPath() { + return "/list"; + } + + @Override + public boolean isPublic() { + return true; + } + + @Override + public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + DBAccessor dbAccessor = MyDecisionDBAccessProvider.getDbAccessor(); + String userName = httpServletRequest.getParameter("userName"); + List entityList = dbAccessor.runQueryAction(daoContext -> { + QueryCondition queryCondition = QueryFactory.create(); + if (StringUtils.isNotBlank(userName) ) { + queryCondition.addRestriction(RestrictionFactory.eq("userName", userName)); + } + List entityList1 = daoContext.getDAO(MyDao.class).find(queryCondition); + return entityList1; + }); + JSONArray jsonArray = JSONArray.create(entityList); + WebUtils.printAsJSON(httpServletResponse, jsonArray); + } +} diff --git a/src/main/java/com/fr/plugin/http/ModApi.java b/src/main/java/com/fr/plugin/http/ModApi.java new file mode 100644 index 0000000..9d4eacc --- /dev/null +++ b/src/main/java/com/fr/plugin/http/ModApi.java @@ -0,0 +1,63 @@ +package com.fr.plugin.http; + +import com.fr.decision.fun.impl.BaseHttpHandler; +import com.fr.json.JSONObject; +import com.fr.plugin.MyDecisionDBAccessProvider; +import com.fr.plugin.dao.MyDao; +import com.fr.plugin.entity.MyEntity; +import com.fr.stable.db.accessor.DBAccessor; +import com.fr.stable.query.QueryFactory; +import com.fr.stable.query.restriction.RestrictionFactory; +import com.fr.third.springframework.web.bind.annotation.RequestMethod; +import com.fr.web.utils.WebUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Date; +import java.util.UUID; + +public class ModApi extends BaseHttpHandler { + @Override + public RequestMethod getMethod() { + return null; + } + + @Override + public String getPath() { + return "/mod"; + } + + @Override + public boolean isPublic() { + return true; + } + + @Override + public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { + DBAccessor dbAccessor = MyDecisionDBAccessProvider.getDbAccessor(); + //通过这两个函数获取的参数可以避免中文乱码和空指针 + String userName = WebUtils.getHTTPRequestParameter(httpServletRequest, "userName"); + Integer source = WebUtils.getHTTPRequestIntParameter(httpServletRequest, "source"); + //先查找要更新的用户 + MyEntity entity = dbAccessor.runQueryAction(daoContext -> daoContext.getDAO(MyDao.class) + .findOne(QueryFactory.create().addRestriction(RestrictionFactory.eq("userName", userName))) + ); + if (entity != null) { + entity.setSource(source); + dbAccessor.runDMLAction(daoContext -> { + //执行更新操作 + daoContext.getDAO(MyDao.class).update(entity); + return null; + }); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("msg", "success"); + jsonObject.put("code", 200); + WebUtils.printAsJSON(httpServletResponse, jsonObject); + } else { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("msg", "user not find"); + jsonObject.put("code", -1); + WebUtils.printAsJSON(httpServletResponse, jsonObject); + } + } +} diff --git a/src/main/resources/com/fr/plugin/my18n.properties b/src/main/resources/com/fr/plugin/my18n.properties new file mode 100644 index 0000000..9225611 --- /dev/null +++ b/src/main/resources/com/fr/plugin/my18n.properties @@ -0,0 +1,12 @@ +Plugin-Config_Demo=MyConfig +Plugin-Config_Property_Text=Account +Plugin-Config_Property_Count=Count +Plugin-Config_Property_Text_Description=This is a text property. +Plugin-Config_Property_Count_Description=This is a int property. +Plugin-Config_Group=Plugin +Plugin-Config_Property_Price=Price +Plugin-Config_Property_Price_Description=This is a price property. +Plugin-Config_Property_Time=Time +Plugin-Config_Property_Time_Description=This is a time proeprty. +Plugin-Config_Property_Student=Student +Plugin-Config_Property_Student_Description=This is a bool property. \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/my18n_zh_CN.properties b/src/main/resources/com/fr/plugin/my18n_zh_CN.properties new file mode 100644 index 0000000..d01325e --- /dev/null +++ b/src/main/resources/com/fr/plugin/my18n_zh_CN.properties @@ -0,0 +1,12 @@ +Plugin-Config_Demo=\u793A\u4F8B\u63D2\u4EF6 +Plugin-Config_Property_Text=\u8D26\u53F7 +Plugin-Config_Property_Count=\u6570\u91CF +Plugin-Config_Property_Text_Description=\u8FD9\u662F\u4E00\u4E2A\u6587\u672C\u7C7B\u578B\u7684\u914D\u7F6E\u5C5E\u6027\u3002 +Plugin-Config_Property_Count_Description=\u8FD9\u662F\u4E00\u4E2A\u6574\u6570\u7C7B\u578B\u7684\u914D\u7F6E\u5C5E\u6027\u3002 +Plugin-Config_Group=\u63D2\u4EF6\u914D\u7F6E +Plugin-Config_Property_Price=\u4EF7\u683C +Plugin-Config_Property_Price_Description=\u8FD9\u662F\u7528\u6765\u8BBE\u7F6E\u4EF7\u683C\u7684\u3002 +Plugin-Config_Property_Time=\u65F6\u95F4 +Plugin-Config_Property_Time_Description=\u8FD9\u662F\u7528\u6765\u8BBE\u7F6E\u6709\u6548\u65F6\u95F4\u7684 +Plugin-Config_Property_Student=\u5B66\u751F +Plugin-Config_Property_Student_Description=\u8FD9\u662F\u7528\u6765\u8BBE\u7F6E\u662F\u5426\u4E3A\u5B66\u751F\u7684\u3002 \ No newline at end of file