.
This commit is contained in:
parent
173839b257
commit
9db8e5b2e8
83
pom.xml
Normal file
83
pom.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<?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/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>jfly</name>
|
||||
<groupId>com.lxyer</groupId>
|
||||
<artifactId>jfly</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jfinal</groupId>
|
||||
<artifactId>jfinal</artifactId>
|
||||
<version>3.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>6.0.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<version>2.7.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- ehcache 支持 -->
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache-core</artifactId>
|
||||
<version>2.6.11</version>
|
||||
</dependency>
|
||||
|
||||
<!-- redis 支持 -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
<version>2.48</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.cedarsoftware</groupId>
|
||||
<artifactId>java-util</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>3.0-alpha-1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
45
src/main/java/com/lxyer/config/DbMap.java
Normal file
45
src/main/java/com/lxyer/config/DbMap.java
Normal file
@ -0,0 +1,45 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
import com.jfinal.kit.PathKit;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.lxyer.model.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
* <pre>
|
||||
* Example:
|
||||
* public void configPlugin(Plugins me) {
|
||||
* ActiveRecordPlugin arp = new ActiveRecordPlugin(...);
|
||||
* DbMap.mapping(arp);
|
||||
* me.add(arp);
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
public class DbMap {
|
||||
|
||||
public static void mapping(ActiveRecordPlugin arp) {
|
||||
arp.addMapping("act_log", "logid", ActLog.class);
|
||||
arp.addMapping("comment", "commentId", Comment.class);
|
||||
arp.addMapping("content", "contentId", Content.class);
|
||||
arp.addMapping("content_item", "itemId", ContentItem.class);
|
||||
// Composite Primary Key order: tid,cate,attr
|
||||
arp.addMapping("dyna_attr", "tid,cate,attr", DynaAttr.class);
|
||||
arp.addMapping("user", "userId", User.class);
|
||||
}
|
||||
|
||||
public static void addSqlTemplate(ActiveRecordPlugin arp) {
|
||||
String baseSqlTemplatePath = PathKit.getWebRootPath() + "/WEB-INF/classes/sql/";
|
||||
arp.setBaseSqlTemplatePath(baseSqlTemplatePath);
|
||||
|
||||
File sqlFiles = new File(baseSqlTemplatePath);
|
||||
File[] files = sqlFiles.listFiles();
|
||||
for (File f : files){
|
||||
if (f.isFile() || f.getName().endsWith(".sql")){
|
||||
arp.addSqlTemplate(f.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
37
src/main/java/com/lxyer/config/E.java
Normal file
37
src/main/java/com/lxyer/config/E.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
/**
|
||||
* Created by Lxyer at 2017/9/10 15:35.
|
||||
*/
|
||||
public class E {
|
||||
|
||||
public enum DynamicAttr {
|
||||
//table,id_k,gk, cate
|
||||
NEWS("dyna_attr", "contentId", "tid", 1),
|
||||
PRODUCTION("dyna_attr", "contentId", "tid", 2),
|
||||
USER("dyna_attr", "userId", "tid", 3)
|
||||
;
|
||||
private String table;
|
||||
private String id_k;
|
||||
private String gk;
|
||||
private int cate;
|
||||
DynamicAttr(String table, String id_k, String gk, int cate) {
|
||||
this.table = table;
|
||||
this.id_k = id_k;
|
||||
this.gk = gk;
|
||||
this.cate = cate;
|
||||
}
|
||||
public String table(){
|
||||
return this.table;
|
||||
}
|
||||
public String id_k(){
|
||||
return this.id_k;
|
||||
}
|
||||
public String gk(){
|
||||
return this.gk;
|
||||
}
|
||||
public int getCate() {
|
||||
return cate;
|
||||
}
|
||||
}
|
||||
}
|
35
src/main/java/com/lxyer/config/F.java
Normal file
35
src/main/java/com/lxyer/config/F.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 14:35.
|
||||
*/
|
||||
public class F {
|
||||
public enum DynamicAttr {
|
||||
//table,id_k,gk, cate
|
||||
NEWS("dyna_attr", "contentId", "tid", 1),
|
||||
USER("dyna_attr", "userId", "tid", 2)
|
||||
;
|
||||
private String table;
|
||||
private String id_k;
|
||||
private String gk;
|
||||
private int cate;
|
||||
DynamicAttr(String table, String id_k, String gk, int cate) {
|
||||
this.table = table;
|
||||
this.id_k = id_k;
|
||||
this.gk = gk;
|
||||
this.cate = cate;
|
||||
}
|
||||
public String table(){
|
||||
return this.table;
|
||||
}
|
||||
public String id_k(){
|
||||
return this.id_k;
|
||||
}
|
||||
public String gk(){
|
||||
return this.gk;
|
||||
}
|
||||
public int getCate() {
|
||||
return cate;
|
||||
}
|
||||
}
|
||||
}
|
66
src/main/java/com/lxyer/config/FlyConfig.java
Normal file
66
src/main/java/com/lxyer/config/FlyConfig.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
import com.jfinal.config.*;
|
||||
import com.jfinal.kit.PathKit;
|
||||
import com.jfinal.kit.PropKit;
|
||||
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
||||
import com.jfinal.plugin.ehcache.EhCachePlugin;
|
||||
import com.jfinal.plugin.hikaricp.HikariCpPlugin;
|
||||
import com.jfinal.plugin.redis.RedisPlugin;
|
||||
import com.jfinal.template.Engine;
|
||||
import com.lxyer.config.handler.UrlHandler;
|
||||
import com.lxyer.config.interceptor.LoginInterceptor;
|
||||
import com.lxyer.config.route.AdminRoute;
|
||||
import com.lxyer.config.route.SiteRoute;
|
||||
|
||||
/**
|
||||
* Created by Lxyer at 2018/01/07
|
||||
*/
|
||||
public class FlyConfig extends JFinalConfig {
|
||||
|
||||
@Override
|
||||
public void configConstant(Constants me) {
|
||||
me.setDevMode(true);
|
||||
PropKit.use("config.properties");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configRoute(Routes me) {
|
||||
me.add(new AdminRoute());
|
||||
me.add(new SiteRoute());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configEngine(Engine me) {
|
||||
Engine.setMainEngine(me);
|
||||
me.setBaseTemplatePath(PathKit.getWebRootPath());
|
||||
|
||||
me.addSharedFunction("/WEB-INF/_t/layout.html");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configPlugin(Plugins me) {
|
||||
loadPropertyFile("config.properties");
|
||||
|
||||
HikariCpPlugin hikariPlguin = new HikariCpPlugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password"), "com.mysql.cj.jdbc.Driver");
|
||||
ActiveRecordPlugin arp = new ActiveRecordPlugin(hikariPlguin);
|
||||
me.add(hikariPlguin);
|
||||
me.add(arp);
|
||||
|
||||
DbMap.mapping(arp);
|
||||
DbMap.addSqlTemplate(arp);
|
||||
|
||||
me.add(new RedisPlugin(getProperty("redis.cache_name"), getProperty("redis.host"), getPropertyToInt("redis.port"), getPropertyToInt("redis.timeout")));
|
||||
me.add(new EhCachePlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configInterceptor(Interceptors me) {
|
||||
me.add(new LoginInterceptor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configHandler(Handlers me) {
|
||||
me.add(new UrlHandler());
|
||||
}
|
||||
}
|
17
src/main/java/com/lxyer/config/handler/UrlHandler.java
Normal file
17
src/main/java/com/lxyer/config/handler/UrlHandler.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.lxyer.config.handler;
|
||||
|
||||
import com.jfinal.handler.Handler;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 11:20.
|
||||
*/
|
||||
public class UrlHandler extends Handler {
|
||||
@Override
|
||||
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
|
||||
|
||||
next.handle(target, request, response, isHandled);
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.lxyer.config.interceptor;
|
||||
|
||||
import com.jfinal.aop.Interceptor;
|
||||
import com.jfinal.aop.Invocation;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 11:22.
|
||||
*/
|
||||
public class LoginInterceptor implements Interceptor {
|
||||
@Override
|
||||
public void intercept(Invocation inv) {
|
||||
inv.invoke();
|
||||
}
|
||||
}
|
13
src/main/java/com/lxyer/config/route/AdminRoute.java
Normal file
13
src/main/java/com/lxyer/config/route/AdminRoute.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.lxyer.config.route;
|
||||
|
||||
import com.jfinal.config.Routes;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 11:19.
|
||||
*/
|
||||
public class AdminRoute extends Routes {
|
||||
@Override
|
||||
public void config() {
|
||||
|
||||
}
|
||||
}
|
16
src/main/java/com/lxyer/config/route/SiteRoute.java
Normal file
16
src/main/java/com/lxyer/config/route/SiteRoute.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.lxyer.config.route;
|
||||
|
||||
import com.jfinal.config.Routes;
|
||||
import com.lxyer.controller.HomeController;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 11:16.
|
||||
*/
|
||||
public class SiteRoute extends Routes {
|
||||
@Override
|
||||
public void config() {
|
||||
setBaseViewPath("/WEB-INF/fly");
|
||||
|
||||
add("/", HomeController.class);
|
||||
}
|
||||
}
|
49
src/main/java/com/lxyer/controller/HomeController.java
Normal file
49
src/main/java/com/lxyer/controller/HomeController.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.SqlPara;
|
||||
import com.jfinal.plugin.ehcache.CacheInterceptor;
|
||||
import com.jfinal.plugin.redis.Cache;
|
||||
import com.jfinal.plugin.redis.Redis;
|
||||
import com.lxyer.model.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 14:40.
|
||||
*/
|
||||
public class HomeController extends IController {
|
||||
|
||||
public void index(){
|
||||
String para = getPara();
|
||||
|
||||
Cache cache = Redis.use();
|
||||
String cacheKey = "user-" + para;
|
||||
|
||||
User user = cache.get(cacheKey);
|
||||
if (user == null)
|
||||
cache.setex(cacheKey, 10, user = User.dao.findById(para+""));
|
||||
|
||||
if (user != null)
|
||||
System.out.println(user.toJson());
|
||||
|
||||
renderText("hello fly");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户
|
||||
*/
|
||||
@Before(CacheInterceptor.class)
|
||||
public void query_user(){
|
||||
|
||||
//User.dao.find("select * from user")
|
||||
|
||||
SqlPara sqlPara = Db.getSqlPara("user.list");
|
||||
|
||||
|
||||
List<User> users = User.dao.find(sqlPara);
|
||||
|
||||
renderJson(users);
|
||||
}
|
||||
}
|
103
src/main/java/com/lxyer/controller/IController.java
Normal file
103
src/main/java/com/lxyer/controller/IController.java
Normal file
@ -0,0 +1,103 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.core.Controller;
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.*;
|
||||
import com.lxyer.config.E;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by Lxyer at 2017/9/10 13:55.
|
||||
*/
|
||||
public class IController extends Controller {
|
||||
|
||||
public Kv getParams(String... key) {
|
||||
Kv kv = Kv.create();
|
||||
for (String k : key) {
|
||||
if (k.contains("=")) { //如果没有值使用默认值
|
||||
kv.put(k.split("=")[0], getPara(k.split("=")[0], k.split("=")[1]));
|
||||
continue;
|
||||
} else if (k.contains("<")) { //强制使用"<"右侧的值
|
||||
kv.put(k.split("<")[0], k.split("<")[1]);
|
||||
continue;
|
||||
}
|
||||
kv.put(k, getPara(k));
|
||||
}
|
||||
return kv;
|
||||
}
|
||||
|
||||
public int getPn(){
|
||||
return getParaToInt("pn", 1);
|
||||
}
|
||||
public int getPs(){
|
||||
return getParaToInt("ps", 15);
|
||||
}
|
||||
public int getPn(int pn){
|
||||
return getParaToInt("pn", pn);
|
||||
}
|
||||
public int getPs(int ps){
|
||||
return getParaToInt("ps", ps);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置动态属性
|
||||
* @param page
|
||||
* @param dynAttr
|
||||
*/
|
||||
public void setDynAttr(Page<Model> page, E.DynamicAttr dynAttr, String ... s){
|
||||
if (page == null || page.getList().size() == 0 || dynAttr == null) return;
|
||||
List ids = new ArrayList<>();
|
||||
page.getList().forEach(x->ids.add(x.getInt(dynAttr.id_k())));
|
||||
if (!ids.isEmpty()) {
|
||||
String ids_ = ids.toString();
|
||||
ids_ = ids_.substring(1, ids_.length() - 1);
|
||||
|
||||
//查询动态属性
|
||||
Kv kv = Kv.by("table", dynAttr.table()).set("id_k", dynAttr.gk()).set("id_v", ids_).set("cate", dynAttr.getCate());
|
||||
if (s.length > 0)
|
||||
kv.set("attr", arrToStr(s));
|
||||
|
||||
SqlPara sqlPara = Db.getSqlPara("m.dyn_attr", kv);
|
||||
List<Record> attrs = Db.find(sqlPara);
|
||||
|
||||
Map<Integer, Kv> attrMap = new HashMap();
|
||||
attrs.forEach(x->{
|
||||
Kv nAttr = attrMap.getOrDefault(x.getInt(dynAttr.gk()), Kv.create());
|
||||
nAttr.set(x.get("attr"), x.get("value"));
|
||||
attrMap.put(x.getInt(dynAttr.gk()), nAttr);
|
||||
});
|
||||
page.getList().forEach(x->{
|
||||
attrMap.getOrDefault(x.getInt(dynAttr.id_k()), Kv.create()).forEach((k, v)->x.put(k+"", v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置动态属性
|
||||
* @param model
|
||||
* @param dynAttr
|
||||
*/
|
||||
public void setDynAttr(Model model, E.DynamicAttr dynAttr, String ... ss){
|
||||
Kv kv = Kv.by("table", dynAttr.table()).set("id_k", dynAttr.gk()).set("id_v", model.getInt(dynAttr.id_k())).set("cate", dynAttr.getCate());
|
||||
if (ss.length > 0) kv.set("attr", arrToStr(ss));
|
||||
|
||||
SqlPara sqlPara = Db.getSqlPara("m.dyn_attr", kv);
|
||||
List<Record> attrs = Db.find(sqlPara);
|
||||
attrs.forEach(x-> model.put(x.get("attr"), x.get("value")));
|
||||
}
|
||||
|
||||
private String arrToStr(String ... ss){
|
||||
String str = "";
|
||||
for (String x : ss){
|
||||
str += "'"+x+"',";
|
||||
}
|
||||
if (str.length() > 0)
|
||||
str = str.substring(0, str.length()-1);
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
11
src/main/java/com/lxyer/model/ActLog.java
Normal file
11
src/main/java/com/lxyer/model/ActLog.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.lxyer.model;
|
||||
|
||||
import com.lxyer.model.base.BaseActLog;
|
||||
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ActLog extends BaseActLog<ActLog> {
|
||||
|
||||
}
|
11
src/main/java/com/lxyer/model/Comment.java
Normal file
11
src/main/java/com/lxyer/model/Comment.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.lxyer.model;
|
||||
|
||||
import com.lxyer.model.base.BaseComment;
|
||||
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Comment extends BaseComment<Comment> {
|
||||
|
||||
}
|
11
src/main/java/com/lxyer/model/Content.java
Normal file
11
src/main/java/com/lxyer/model/Content.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.lxyer.model;
|
||||
|
||||
import com.lxyer.model.base.BaseContent;
|
||||
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Content extends BaseContent<Content> {
|
||||
|
||||
}
|
11
src/main/java/com/lxyer/model/ContentItem.java
Normal file
11
src/main/java/com/lxyer/model/ContentItem.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.lxyer.model;
|
||||
|
||||
import com.lxyer.model.base.BaseContentItem;
|
||||
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ContentItem extends BaseContentItem<ContentItem> {
|
||||
|
||||
}
|
11
src/main/java/com/lxyer/model/DynaAttr.java
Normal file
11
src/main/java/com/lxyer/model/DynaAttr.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.lxyer.model;
|
||||
|
||||
import com.lxyer.model.base.BaseDynaAttr;
|
||||
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DynaAttr extends BaseDynaAttr<DynaAttr> {
|
||||
|
||||
}
|
12
src/main/java/com/lxyer/model/User.java
Normal file
12
src/main/java/com/lxyer/model/User.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.lxyer.model;
|
||||
|
||||
import com.lxyer.model.base.BaseUser;
|
||||
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class User extends BaseUser<User> {
|
||||
public static final User dao = new User().dao();
|
||||
|
||||
}
|
85
src/main/java/com/lxyer/model/_Generator.java
Normal file
85
src/main/java/com/lxyer/model/_Generator.java
Normal file
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* 请勿将俱乐部专享资源复制给其他人,保护知识产权即是保护我们所在的行业,进而保护我们自己的利益
|
||||
* 即便是公司的同事,也请尊重 JFinal 作者的努力与付出,不要复制给同事
|
||||
*
|
||||
* 如果你尚未加入俱乐部,请立即删除该项目,或者现在加入俱乐部:http://jfinal.com/club
|
||||
*
|
||||
* 俱乐部将提供 jfinal-club 项目文档与设计资源、专用 QQ 群,以及作者在俱乐部定期的分享与答疑,
|
||||
* 价值远比仅仅拥有 jfinal club 项目源代码要大得多
|
||||
*
|
||||
* JFinal 俱乐部是五年以来首次寻求外部资源的尝试,以便于有资源创建更加
|
||||
* 高品质的产品与服务,为大家带来更大的价值,所以请大家多多支持,不要将
|
||||
* 首次的尝试扼杀在了摇篮之中
|
||||
*/
|
||||
|
||||
package com.lxyer.model;
|
||||
|
||||
|
||||
import com.jfinal.kit.PathKit;
|
||||
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
||||
import com.jfinal.plugin.activerecord.generator.Generator;
|
||||
import com.jfinal.plugin.hikaricp.HikariCpPlugin;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* Model、BaseModel、_MappingKit 生成器
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public class _Generator {
|
||||
|
||||
/**
|
||||
* 部分功能使用 Db + Record 模式实现,无需生成 model 的 table 在此配置
|
||||
*/
|
||||
private static String[] excludedTable = {
|
||||
/*"comment",
|
||||
"content",
|
||||
"content_item",
|
||||
"dyna_attr",
|
||||
"tree",
|
||||
"user"*/
|
||||
};
|
||||
|
||||
/**
|
||||
* 重用 JFinalClubConfig 中的数据源配置,避免冗余配置
|
||||
*/
|
||||
public static DataSource getDataSource() {
|
||||
//HikariCpPlugin hikariCpPlugin = new HikariCpPlugin("jdbc:mysql://558cfc37a10ef.sh.cdb.myqcloud.com:3817/db_toutiao?nullNamePatternMatchesAll=true", "cdb_outerroot", "l237809796", "com.mysql.cj.jdbc.Driver");
|
||||
HikariCpPlugin hikariCpPlugin = new HikariCpPlugin("jdbc:mysql://dbserver:3306/jfly?nullNamePatternMatchesAll=true", "guest", "hello", "com.mysql.cj.jdbc.Driver");
|
||||
hikariCpPlugin.start();
|
||||
return hikariCpPlugin.getDataSource();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// base model 所使用的包名
|
||||
String baseModelPackageName = "com.lxyer.model.base";
|
||||
// base model 文件保存路径
|
||||
String baseModelOutputDir = PathKit.getWebRootPath()
|
||||
+ "/src/main/java/com/lxyer/model/dev/base";
|
||||
|
||||
System.out.println("输出路径:"+ baseModelOutputDir);
|
||||
|
||||
// model 所使用的包名 (MappingKit 默认使用的包名)
|
||||
String modelPackageName = "com.lxyer.dev";
|
||||
// model 文件保存路径 (MappingKit 与 DataDictionary 文件默认保存路径)
|
||||
String modelOutputDir = baseModelOutputDir + "/..";
|
||||
|
||||
// 创建生成器
|
||||
Generator gen = new Generator(getDataSource(), baseModelPackageName, baseModelOutputDir, modelPackageName, modelOutputDir);
|
||||
// 设置数据库方言
|
||||
gen.setDialect(new MysqlDialect());
|
||||
// 添加不需要生成的表名
|
||||
for (String table : excludedTable) {
|
||||
gen.addExcludedTable(table);
|
||||
}
|
||||
// 设置是否在 Model 中生成 getDao 对象
|
||||
gen.setGenerateDaoInModel(false);
|
||||
// 设置是否生成字典文件
|
||||
gen.setGenerateDataDictionary(false);
|
||||
gen.setMappingKitClassName("DbMap");
|
||||
// 设置需要被移除的表名前缀用于生成modelName。例如表名 "osc_user",移除前缀 "osc_"后生成的model名为 "User"而非 OscUser
|
||||
// gernerator.setRemovedTableNamePrefixes("t_");
|
||||
// 生成
|
||||
gen.generate();
|
||||
}
|
||||
}
|
68
src/main/java/com/lxyer/model/base/BaseActLog.java
Normal file
68
src/main/java/com/lxyer/model/base/BaseActLog.java
Normal file
@ -0,0 +1,68 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseActLog<M extends BaseActLog<M>> extends Model<M> implements IBean {
|
||||
|
||||
public void setLogid(java.lang.Integer logid) {
|
||||
set("logid", logid);
|
||||
}
|
||||
|
||||
public java.lang.Integer getLogid() {
|
||||
return getInt("logid");
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
|
||||
public void setTid(java.lang.Integer tid) {
|
||||
set("tid", tid);
|
||||
}
|
||||
|
||||
public java.lang.Integer getTid() {
|
||||
return getInt("tid");
|
||||
}
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
|
||||
public void setRemark(java.lang.String remark) {
|
||||
set("remark", remark);
|
||||
}
|
||||
|
||||
public java.lang.String getRemark() {
|
||||
return getStr("remark");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
|
||||
}
|
84
src/main/java/com/lxyer/model/base/BaseComment.java
Normal file
84
src/main/java/com/lxyer/model/base/BaseComment.java
Normal file
@ -0,0 +1,84 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseComment<M extends BaseComment<M>> extends Model<M> implements IBean {
|
||||
|
||||
public void setCommentId(java.lang.Integer commentId) {
|
||||
set("commentId", commentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCommentId() {
|
||||
return getInt("commentId");
|
||||
}
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setPid(java.lang.Integer pid) {
|
||||
set("pid", pid);
|
||||
}
|
||||
|
||||
public java.lang.Integer getPid() {
|
||||
return getInt("pid");
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
|
||||
public void setContent(java.lang.String content) {
|
||||
set("content", content);
|
||||
}
|
||||
|
||||
public java.lang.String getContent() {
|
||||
return getStr("content");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
|
||||
public void setSupportNum(java.lang.Integer supportNum) {
|
||||
set("supportNum", supportNum);
|
||||
}
|
||||
|
||||
public java.lang.Integer getSupportNum() {
|
||||
return getInt("supportNum");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
|
||||
}
|
124
src/main/java/com/lxyer/model/base/BaseContent.java
Normal file
124
src/main/java/com/lxyer/model/base/BaseContent.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseContent<M extends BaseContent<M>> extends Model<M> implements IBean {
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setTitle(java.lang.String title) {
|
||||
set("title", title);
|
||||
}
|
||||
|
||||
public java.lang.String getTitle() {
|
||||
return getStr("title");
|
||||
}
|
||||
|
||||
public void setDigest(java.lang.String digest) {
|
||||
set("digest", digest);
|
||||
}
|
||||
|
||||
public java.lang.String getDigest() {
|
||||
return getStr("digest");
|
||||
}
|
||||
|
||||
public void setContent(java.lang.String content) {
|
||||
set("content", content);
|
||||
}
|
||||
|
||||
public java.lang.String getContent() {
|
||||
return getStr("content");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
|
||||
public void setType(java.lang.Integer type) {
|
||||
set("type", type);
|
||||
}
|
||||
|
||||
public java.lang.Integer getType() {
|
||||
return getInt("type");
|
||||
}
|
||||
|
||||
public void setReplyNum(java.lang.Integer replyNum) {
|
||||
set("replyNum", replyNum);
|
||||
}
|
||||
|
||||
public java.lang.Integer getReplyNum() {
|
||||
return getInt("replyNum");
|
||||
}
|
||||
|
||||
public void setViewNum(java.lang.Integer viewNum) {
|
||||
set("viewNum", viewNum);
|
||||
}
|
||||
|
||||
public java.lang.Integer getViewNum() {
|
||||
return getInt("viewNum");
|
||||
}
|
||||
|
||||
public void setWonderful(java.lang.Integer wonderful) {
|
||||
set("wonderful", wonderful);
|
||||
}
|
||||
|
||||
public java.lang.Integer getWonderful() {
|
||||
return getInt("wonderful");
|
||||
}
|
||||
|
||||
public void setTop(java.lang.Integer top) {
|
||||
set("top", top);
|
||||
}
|
||||
|
||||
public java.lang.Integer getTop() {
|
||||
return getInt("top");
|
||||
}
|
||||
|
||||
public void setSolved(java.lang.Integer solved) {
|
||||
set("solved", solved);
|
||||
}
|
||||
|
||||
public java.lang.Integer getSolved() {
|
||||
return getInt("solved");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
|
||||
}
|
44
src/main/java/com/lxyer/model/base/BaseContentItem.java
Normal file
44
src/main/java/com/lxyer/model/base/BaseContentItem.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseContentItem<M extends BaseContentItem<M>> extends Model<M> implements IBean {
|
||||
|
||||
public void setItemId(java.lang.Integer itemId) {
|
||||
set("itemId", itemId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getItemId() {
|
||||
return getInt("itemId");
|
||||
}
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.util.Date getCreateTime() {
|
||||
return get("createTime");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
|
||||
}
|
44
src/main/java/com/lxyer/model/base/BaseDynaAttr.java
Normal file
44
src/main/java/com/lxyer/model/base/BaseDynaAttr.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseDynaAttr<M extends BaseDynaAttr<M>> extends Model<M> implements IBean {
|
||||
|
||||
public void setTid(java.lang.Integer tid) {
|
||||
set("tid", tid);
|
||||
}
|
||||
|
||||
public java.lang.Integer getTid() {
|
||||
return getInt("tid");
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
|
||||
public void setAttr(java.lang.String attr) {
|
||||
set("attr", attr);
|
||||
}
|
||||
|
||||
public java.lang.String getAttr() {
|
||||
return getStr("attr");
|
||||
}
|
||||
|
||||
public void setValue(java.lang.String value) {
|
||||
set("value", value);
|
||||
}
|
||||
|
||||
public java.lang.String getValue() {
|
||||
return getStr("value");
|
||||
}
|
||||
|
||||
}
|
116
src/main/java/com/lxyer/model/base/BaseUser.java
Normal file
116
src/main/java/com/lxyer/model/base/BaseUser.java
Normal file
@ -0,0 +1,116 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseUser<M extends BaseUser<M>> extends Model<M> implements IBean {
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setUsername(java.lang.String username) {
|
||||
set("username", username);
|
||||
}
|
||||
|
||||
public java.lang.String getUsername() {
|
||||
return getStr("username");
|
||||
}
|
||||
|
||||
public void setPassword(java.lang.String password) {
|
||||
set("password", password);
|
||||
}
|
||||
|
||||
public java.lang.String getPassword() {
|
||||
return getStr("password");
|
||||
}
|
||||
|
||||
public void setSex(java.lang.Integer sex) {
|
||||
set("sex", sex);
|
||||
}
|
||||
|
||||
public java.lang.Integer getSex() {
|
||||
return getInt("sex");
|
||||
}
|
||||
|
||||
public void setPhone(java.lang.String phone) {
|
||||
set("phone", phone);
|
||||
}
|
||||
|
||||
public java.lang.String getPhone() {
|
||||
return getStr("phone");
|
||||
}
|
||||
|
||||
public void setNickname(java.lang.String nickname) {
|
||||
set("nickname", nickname);
|
||||
}
|
||||
|
||||
public java.lang.String getNickname() {
|
||||
return getStr("nickname");
|
||||
}
|
||||
|
||||
public void setAvatar(java.lang.String avatar) {
|
||||
set("avatar", avatar);
|
||||
}
|
||||
|
||||
public java.lang.String getAvatar() {
|
||||
return getStr("avatar");
|
||||
}
|
||||
|
||||
public void setRealname(java.lang.String realname) {
|
||||
set("realname", realname);
|
||||
}
|
||||
|
||||
public java.lang.String getRealname() {
|
||||
return getStr("realname");
|
||||
}
|
||||
|
||||
public void setEmail(java.lang.String email) {
|
||||
set("email", email);
|
||||
}
|
||||
|
||||
public java.lang.String getEmail() {
|
||||
return getStr("email");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
|
||||
public void setSign(java.lang.String sign) {
|
||||
set("sign", sign);
|
||||
}
|
||||
|
||||
public java.lang.String getSign() {
|
||||
return getStr("sign");
|
||||
}
|
||||
|
||||
public void setCity(java.lang.String city) {
|
||||
set("city", city);
|
||||
}
|
||||
|
||||
public java.lang.String getCity() {
|
||||
return getStr("city");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
|
||||
}
|
10
src/main/resources/config.properties
Normal file
10
src/main/resources/config.properties
Normal file
@ -0,0 +1,10 @@
|
||||
#------------------------------------------------#
|
||||
jdbcUrl=jdbc\:mysql\://dbserver\:3306/jfly?useUnicode\=true&characterEncoding\=utf8&useSSL\=false
|
||||
user=root
|
||||
password=*hello9796!
|
||||
|
||||
redis.cache_name=jfly
|
||||
redis.database=1
|
||||
redis.host=dbserver
|
||||
redis.port=6379
|
||||
redis.timeout=5000
|
209
src/main/resources/db/jfly.sql
Normal file
209
src/main/resources/db/jfly.sql
Normal file
File diff suppressed because one or more lines are too long
80
src/main/resources/ehcache.xml
Normal file
80
src/main/resources/ehcache.xml
Normal file
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="ehcache.xsd"
|
||||
updateCheck="false" monitoring="autodetect"
|
||||
dynamicConfig="true">
|
||||
|
||||
<diskStore path="java.io.tmpdir"/>
|
||||
|
||||
<defaultCache
|
||||
maxEntriesLocalHeap="10000"
|
||||
eternal="false"
|
||||
overflowToDisk="true"
|
||||
timeToIdleSeconds="604800"
|
||||
timeToLiveSeconds="129000">
|
||||
</defaultCache>
|
||||
|
||||
<!--
|
||||
Sample cache named sampleCache1
|
||||
This cache contains a maximum in memory of 10000 elements, and will expire
|
||||
an element if it is idle for more than 5 minutes and lives for more than
|
||||
10 minutes.
|
||||
|
||||
If there are more than 10000 elements it will overflow to the
|
||||
disk cache, which in this configuration will go to wherever java.io.tmp is
|
||||
defined on your system. On a standard Linux system this will be /tmp"
|
||||
-->
|
||||
<cache name="sampleCache1"
|
||||
maxEntriesLocalHeap="10000"
|
||||
maxEntriesLocalDisk="1000"
|
||||
eternal="false"
|
||||
overflowToDisk="true"
|
||||
diskSpoolBufferSizeMB="20"
|
||||
timeToIdleSeconds="300"
|
||||
timeToLiveSeconds="600"
|
||||
memoryStoreEvictionPolicy="LFU"
|
||||
transactionalMode="off"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Sample cache named sampleCache2
|
||||
This cache has a maximum of 1000 elements in memory. There is no overflow to disk, so 1000
|
||||
is also the maximum cache size. Note that when a cache is eternal, timeToLive and
|
||||
timeToIdle are not used and do not need to be specified.
|
||||
-->
|
||||
<cache name="sampleCache2"
|
||||
maxEntriesLocalHeap="1000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"
|
||||
memoryStoreEvictionPolicy="FIFO"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Sample cache named sampleCache3. This cache overflows to disk. The disk store is
|
||||
persistent between cache and VM restarts. The disk expiry thread interval is set to 10
|
||||
minutes, overriding the default of 2 minutes.
|
||||
-->
|
||||
<cache name="sampleCache3"
|
||||
maxEntriesLocalHeap="500"
|
||||
eternal="false"
|
||||
overflowToDisk="true"
|
||||
timeToIdleSeconds="300"
|
||||
timeToLiveSeconds="600"
|
||||
diskPersistent="true"
|
||||
diskExpiryThreadIntervalSeconds="1"
|
||||
memoryStoreEvictionPolicy="LFU"
|
||||
/>
|
||||
|
||||
</ehcache>
|
||||
<!-- maxEntriesLocalHeap="10000" 内存最多1W条-->
|
||||
<!-- maxEntriesLocalDisk="20000" 磁盘最多2W条-->
|
||||
<!-- eternal="false" 是否自动过期-->
|
||||
<!-- overflowToDisk="true" 是否自动存磁盘-->
|
||||
<!-- diskSpoolBufferSizeMB="50" DiskStore使用的磁盘大小,默认值30MB。每个cache使用各自的DiskStore-->
|
||||
<!-- timeToIdleSeconds="1800" 空闲过期时间-->
|
||||
<!-- timeToLiveSeconds="3600" 最长使用时间-->
|
||||
<!-- memoryStoreEvictionPolicy="LFU" 缓存策略-->
|
||||
<!-- transactionalMode="off" 使ehcache作为JTA事务的参与者-->
|
||||
<!-- FIFO (先进先出). -->
|
||||
<!-- LFU 最少使用) -->
|
||||
<!-- LRU 最近最少使用(ehcache 默认值) -->
|
3
src/main/resources/sql/user.sql
Normal file
3
src/main/resources/sql/user.sql
Normal file
@ -0,0 +1,3 @@
|
||||
#sql("user.list")
|
||||
SELECT * FROM `user`
|
||||
#end
|
11
src/main/webapp/WEB-INF/_t/layout.html
Normal file
11
src/main/webapp/WEB-INF/_t/layout.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!--- Created by JUECHENG at 2018/1/7 11:24. --->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
20
src/main/webapp/WEB-INF/web.xml
Normal file
20
src/main/webapp/WEB-INF/web.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1">
|
||||
|
||||
<filter>
|
||||
<filter-name>jfly</filter-name>
|
||||
<filter-class>com.jfinal.core.JFinalFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>configClass</param-name>
|
||||
<param-value>com.lxyer.config.FlyConfig</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>jfly</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
</web-app>
|
Loading…
Reference in New Issue
Block a user