.
This commit is contained in:
parent
e1f3052174
commit
42bbbac170
@ -18,17 +18,17 @@ import java.io.File;
|
||||
* </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 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);
|
||||
arp.addMapping("user_pwd", "userId", UserPwd.class);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addSqlTemplate(ActiveRecordPlugin arp) {
|
||||
String baseSqlTemplatePath = PathKit.getRootClassPath() + "/sql/";
|
||||
@ -36,8 +36,8 @@ public class DbMap {
|
||||
|
||||
File sqlFiles = new File(baseSqlTemplatePath);
|
||||
File[] files = sqlFiles.listFiles();
|
||||
for (File f : files){
|
||||
if (f.isFile() || f.getName().endsWith(".sql")){
|
||||
for (File f : files) {
|
||||
if (f.isFile() || f.getName().endsWith(".sql")) {
|
||||
arp.addSqlTemplate(f.getName());
|
||||
}
|
||||
}
|
||||
|
@ -8,27 +8,31 @@ public class E {
|
||||
public enum DynamicAttr {
|
||||
//table,id_k,gk, cate
|
||||
NEWS("dyna_attr", "contentId", "tid", 1),
|
||||
USER("dyna_attr", "userId", "tid", 3)
|
||||
;
|
||||
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(){
|
||||
|
||||
public String table() {
|
||||
return this.table;
|
||||
}
|
||||
public String id_k(){
|
||||
|
||||
public String id_k() {
|
||||
return this.id_k;
|
||||
}
|
||||
public String gk(){
|
||||
|
||||
public String gk() {
|
||||
return this.gk;
|
||||
}
|
||||
|
||||
public int getCate() {
|
||||
return cate;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ public class FlyConfig extends JFinalConfig {
|
||||
@Override
|
||||
public void configConstant(Constants me) {
|
||||
me.setDevMode(true);
|
||||
me.setInjectDependency(true);
|
||||
PropKit.use("config.properties");
|
||||
}
|
||||
|
||||
@ -54,8 +55,9 @@ public class FlyConfig extends JFinalConfig {
|
||||
DbMap.mapping(arp);
|
||||
DbMap.addSqlTemplate(arp);
|
||||
|
||||
me.add(new RedisPlugin(getProperty("redis.cache_name"), getProperty("redis.host"), getPropertyToInt("redis.port"), getPropertyToInt("redis.timeout"), getProperty("redis.password")));
|
||||
me.add(new EhCachePlugin());
|
||||
//redis 配置
|
||||
//me.add(new RedisPlugin(getProperty("redis.cache_name"), getProperty("redis.host"), getPropertyToInt("redis.port"), getPropertyToInt("redis.timeout"), getProperty("redis.password")));
|
||||
//me.add(new EhCachePlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,7 +14,7 @@ public class JBean {
|
||||
public static final JBean success = new JBean(1, "操作成功");
|
||||
public static final JBean error = new JBean(-1, "操作失败");
|
||||
|
||||
public JBean(int code){
|
||||
public JBean(int code) {
|
||||
this.code = code;
|
||||
if (code == 1)
|
||||
this.msg = "操作成功";
|
||||
@ -24,11 +24,12 @@ public class JBean {
|
||||
this.msg = "未登录,请前往登录";
|
||||
}
|
||||
|
||||
public JBean(int code, String msg){
|
||||
public JBean(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
public JBean(int code, String msg, Object obj){
|
||||
|
||||
public JBean(int code, String msg, Object obj) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.obj = obj;
|
||||
@ -61,6 +62,7 @@ public class JBean {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public JBean setCode(int code, String msg, Object obj) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
@ -76,8 +78,9 @@ public class JBean {
|
||||
this.obj = obj;
|
||||
return this;
|
||||
}
|
||||
public <K, V> JBean set(Object k, Object v){
|
||||
if (!(obj instanceof Map)){
|
||||
|
||||
public <K, V> JBean set(Object k, Object v) {
|
||||
if (!(obj instanceof Map)) {
|
||||
obj = new HashMap();
|
||||
}
|
||||
((Map) obj).put(k, v);
|
||||
@ -89,23 +92,27 @@ public class JBean {
|
||||
下面的是一些快速创建JsonBean的方式,
|
||||
使用中可以使用new ,同时也可以直接使用
|
||||
*/
|
||||
public static JBean success(Object obj){
|
||||
return new JBean(1, "操作成功",obj);
|
||||
public static JBean success(Object obj) {
|
||||
return new JBean(1, "操作成功", obj);
|
||||
}
|
||||
public static JBean success(int code, String msg){
|
||||
|
||||
public static JBean success(int code, String msg) {
|
||||
return new JBean(1, msg);
|
||||
}
|
||||
public static JBean success(int code, String msg, Object obj){
|
||||
|
||||
public static JBean success(int code, String msg, Object obj) {
|
||||
return new JBean(1, msg, obj);
|
||||
}
|
||||
|
||||
public static JBean error(int code, String msg){
|
||||
public static JBean error(int code, String msg) {
|
||||
return new JBean(code, msg);
|
||||
}
|
||||
public static JBean error(int code, String msg, Object obj){
|
||||
|
||||
public static JBean error(int code, String msg, Object obj) {
|
||||
return new JBean(code, msg, obj);
|
||||
}
|
||||
public static JBean error(String msg){
|
||||
|
||||
public static JBean error(String msg) {
|
||||
return new JBean(-1, msg);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ import java.text.SimpleDateFormat;
|
||||
*/
|
||||
public final class LxyKit {
|
||||
|
||||
public static String dateFmt(long time){
|
||||
public static String dateFmt(long time) {
|
||||
/**
|
||||
* 刚刚 60秒内 60 * 1000
|
||||
* x分钟前 1小时候内 60 * 60*1000
|
||||
@ -24,18 +24,18 @@ public final class LxyKit {
|
||||
long diff = now - time;
|
||||
if (diff < 60 * 1000)
|
||||
return "刚刚";
|
||||
else if (diff < 60 * 60 *1000)
|
||||
return Math.floorDiv(diff, 60 *1000) + "分钟前";
|
||||
else if (diff < 24 * 60*60*1000)
|
||||
return Math.floorDiv(diff, 60 *60*1000) + "小时前";
|
||||
else if (diff > 24 * 60*60*1000 && diff < 7 * 24*60*60*1000)
|
||||
return Math.floorDiv(diff, 24 * 60*60*1000) + "天前";
|
||||
else if (diff < 60 * 60 * 1000)
|
||||
return Math.floorDiv(diff, 60 * 1000) + "分钟前";
|
||||
else if (diff < 24 * 60 * 60 * 1000)
|
||||
return Math.floorDiv(diff, 60 * 60 * 1000) + "小时前";
|
||||
else if (diff > 24 * 60 * 60 * 1000 && diff < 7 * 24 * 60 * 60 * 1000)
|
||||
return Math.floorDiv(diff, 24 * 60 * 60 * 1000) + "天前";
|
||||
else
|
||||
return new SimpleDateFormat("yyyy-MM-dd").format(time);
|
||||
|
||||
}
|
||||
|
||||
public static String md5IfNeed(String password){
|
||||
public static String md5IfNeed(String password) {
|
||||
if (password == null || password.isEmpty()) return "";
|
||||
if (password.length() == 32) return password;
|
||||
MessageDigest md5 = null;
|
||||
|
@ -1,26 +0,0 @@
|
||||
package com.lxyer.config;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 23:45.
|
||||
*/
|
||||
public class MyException extends RuntimeException {
|
||||
public MyException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public MyException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public MyException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public MyException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
protected MyException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
}
|
@ -21,14 +21,14 @@ public class LoginInterceptor implements Interceptor {
|
||||
HttpServletResponse response = controller.getResponse();
|
||||
|
||||
User user = controller.getSessionAttr("user");
|
||||
if (user == null){
|
||||
if ("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))){
|
||||
controller.renderJson(new JBean(-1,"请登录后再尝试"));
|
||||
if (user == null) {
|
||||
if ("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))) {
|
||||
controller.renderJson(new JBean(-1, "请登录后再尝试"));
|
||||
return;
|
||||
}else {
|
||||
} else {
|
||||
controller.redirect("/user/login");
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
inv.invoke();
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
package com.lxyer.config.route;
|
||||
|
||||
import com.jfinal.config.Routes;
|
||||
import com.lxyer.controller.CommentController;
|
||||
import com.lxyer.controller.HomeController;
|
||||
import com.lxyer.controller.JieController;
|
||||
import com.lxyer.controller.UserController;
|
||||
import com.lxyer.controller.*;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 11:16.
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.aop.Clear;
|
||||
import com.jfinal.aop.*;
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.lxyer.config.JBean;
|
||||
@ -15,12 +14,14 @@ import com.lxyer.service.CommentService;
|
||||
@Before(LoginInterceptor.class)
|
||||
public class CommentController extends IController {
|
||||
|
||||
CommentService service = CommentService.me;
|
||||
@Inject
|
||||
CommentService service;
|
||||
|
||||
/**
|
||||
* 评论列表
|
||||
*/
|
||||
@Clear(LoginInterceptor.class)
|
||||
public void list(){
|
||||
public void list() {
|
||||
Kv kv = getParams("contentId");
|
||||
Page<Comment> page = Comment.dao.findPage(getPn(), getPs(), kv);
|
||||
|
||||
@ -31,7 +32,7 @@ public class CommentController extends IController {
|
||||
* 评论详情
|
||||
*/
|
||||
@Clear(LoginInterceptor.class)
|
||||
public void info(){
|
||||
public void info() {
|
||||
|
||||
}
|
||||
|
||||
@ -39,7 +40,7 @@ public class CommentController extends IController {
|
||||
* 评论保存
|
||||
*/
|
||||
@Before(LoginInterceptor.class)
|
||||
public void save(){
|
||||
public void save() {
|
||||
Comment comment = getModel(Comment.class);
|
||||
|
||||
service.save(comment, getUserId());
|
||||
@ -49,14 +50,14 @@ public class CommentController extends IController {
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
public void update_status(){
|
||||
public void update_status() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论点赞
|
||||
*/
|
||||
public void support(){
|
||||
public void support() {
|
||||
JBean bean = new JBean(1);
|
||||
Integer commentId = getParaToInt("commentId");
|
||||
Integer ok = getParaToInt("ok");
|
||||
|
@ -4,6 +4,6 @@ package com.lxyer.controller;
|
||||
* 文件管理
|
||||
* Created by JUECHENG at 2018/1/7 16:44.
|
||||
*/
|
||||
public class FileController extends IController{
|
||||
public class FileController extends IController {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.aop.Inject;
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.lxyer.model.Content;
|
||||
@ -13,21 +14,26 @@ import java.util.List;
|
||||
public class HomeController extends IController {
|
||||
public static final Kv column = Kv.by("qz", 10).set("fx", 20).set("jy", 30).set("gg", 40).set("dt", 50);//栏目
|
||||
|
||||
public void index(){
|
||||
@Inject
|
||||
Content contentDao;
|
||||
@Inject
|
||||
User userDao;
|
||||
|
||||
public void index() {
|
||||
|
||||
//置顶贴
|
||||
List<Content> top = Content.dao.findPage(1, 5, Kv.by("top", 1)).getList();
|
||||
List<Content> top = contentDao.findPage(1, 5, Kv.by("top", 1)).getList();
|
||||
|
||||
//非置顶贴
|
||||
List<Content> contents = Content.dao.findPage(1, 30,Kv.by("top", 0)).getList();
|
||||
List<Content> contents = contentDao.findPage(1, 30, Kv.by("top", 0)).getList();
|
||||
|
||||
//热帖
|
||||
|
||||
//热议
|
||||
List<Content> hotReply = Content.dao.findPage(1, 8, Kv.by("order", "replyNum DESC")).getList();
|
||||
List<Content> hotReply = contentDao.findPage(1, 8, Kv.by("order", "replyNum DESC")).getList();
|
||||
|
||||
//最新加入
|
||||
List<User> lastReg = User.dao.findPage(1, 8, Kv.by("order", "createTime DESC")).getList();
|
||||
List<User> lastReg = userDao.findPage(1, 8, Kv.by("order", "createTime DESC")).getList();
|
||||
|
||||
setAttr("top", top);
|
||||
setAttr("contents", contents);
|
||||
@ -40,7 +46,7 @@ public class HomeController extends IController {
|
||||
/**
|
||||
* 帖子栏目列表
|
||||
*/
|
||||
public void column(){
|
||||
public void column() {
|
||||
String para = getPara(0, "");
|
||||
int solved = getParaToInt("solved", -1);
|
||||
int wonderful = getParaToInt("wonderful", -1);
|
||||
|
@ -9,10 +9,7 @@ import com.lxyer.config.E;
|
||||
import com.lxyer.config.JBean;
|
||||
import com.lxyer.model.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by Lxyer at 2017/9/10 13:55.
|
||||
@ -21,7 +18,7 @@ public class IController extends Controller {
|
||||
|
||||
public static final Cache cache = Redis.use();
|
||||
|
||||
public void index(){
|
||||
public void index() {
|
||||
String para = getPara(0, "index");
|
||||
|
||||
render(para + ".html");
|
||||
@ -33,7 +30,7 @@ public class IController extends Controller {
|
||||
return user == null ? null : user.getUserId();
|
||||
}
|
||||
|
||||
public User getUser(){
|
||||
public User getUser() {
|
||||
return getSessionAttr("user");
|
||||
}
|
||||
|
||||
@ -52,32 +49,36 @@ public class IController extends Controller {
|
||||
return kv;
|
||||
}
|
||||
|
||||
public void renderJBean(Object obj){
|
||||
public void renderJBean(Object obj) {
|
||||
renderJson(new JBean(1, null, obj));
|
||||
}
|
||||
|
||||
public int getPn(){
|
||||
public int getPn() {
|
||||
return getParaToInt("pn", 1);
|
||||
}
|
||||
public int getPs(){
|
||||
|
||||
public int getPs() {
|
||||
return getParaToInt("ps", 15);
|
||||
}
|
||||
public int getPn(int pn){
|
||||
|
||||
public int getPn(int pn) {
|
||||
return getParaToInt("pn", pn);
|
||||
}
|
||||
public int getPs(int ps){
|
||||
|
||||
public int getPs(int ps) {
|
||||
return getParaToInt("ps", ps);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置动态属性
|
||||
*
|
||||
* @param page
|
||||
* @param dynAttr
|
||||
*/
|
||||
public void setDynAttr(Page<Model> page, E.DynamicAttr dynAttr, String ... s){
|
||||
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())));
|
||||
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);
|
||||
@ -91,45 +92,46 @@ public class IController extends Controller {
|
||||
List<Record> attrs = Db.find(sqlPara);
|
||||
|
||||
Map<Integer, Kv> attrMap = new HashMap();
|
||||
attrs.forEach(x->{
|
||||
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));
|
||||
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){
|
||||
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")));
|
||||
attrs.forEach(x -> model.put(x.get("attr"), x.get("value")));
|
||||
}
|
||||
|
||||
private String arrToStr(String ... ss){
|
||||
private String arrToStr(String... ss) {
|
||||
String str = "";
|
||||
for (String x : ss){
|
||||
str += "'"+x+"',";
|
||||
for (String x : ss) {
|
||||
str += "'" + x + "',";
|
||||
}
|
||||
if (str.length() > 0)
|
||||
str = str.substring(0, str.length()-1);
|
||||
str = str.substring(0, str.length() - 1);
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* todo:文件上传
|
||||
*/
|
||||
public void upFile(){
|
||||
public void upFile() {
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.aop.Clear;
|
||||
import com.jfinal.aop.*;
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Page;
|
||||
import com.lxyer.config.JBean;
|
||||
@ -16,16 +15,16 @@ import java.util.List;
|
||||
* Created by JUECHENG at 2018/1/7 16:48.
|
||||
*/
|
||||
@Before(LoginInterceptor.class)
|
||||
public class JieController extends IController{
|
||||
public class JieController extends IController {
|
||||
|
||||
private ContentService service = ContentService.me;
|
||||
private int userId;
|
||||
@Inject
|
||||
private ContentService service;
|
||||
|
||||
/**
|
||||
* 帖子详情
|
||||
*/
|
||||
@Clear(LoginInterceptor.class)
|
||||
public void index(){
|
||||
public void index() {
|
||||
int contentId = getParaToInt(0);
|
||||
|
||||
Content content = Content.dao.findFirst(Kv.by("contentId", contentId));
|
||||
@ -48,7 +47,7 @@ public class JieController extends IController{
|
||||
/**
|
||||
* 添加/修改帖子
|
||||
*/
|
||||
public void add(){
|
||||
public void add() {
|
||||
setAttr("bean", Content.dao.findById(getParaToInt()));
|
||||
|
||||
render("add.html");
|
||||
@ -68,7 +67,7 @@ public class JieController extends IController{
|
||||
/**
|
||||
* 帖子删除
|
||||
*/
|
||||
public void del(){
|
||||
public void del() {
|
||||
JBean bean = new JBean(1);
|
||||
try {
|
||||
service.del(getParaToInt("contentId"), getUserId());
|
||||
@ -82,7 +81,7 @@ public class JieController extends IController{
|
||||
/**
|
||||
* 帖子收藏
|
||||
*/
|
||||
public void collect(){
|
||||
public void collect() {
|
||||
JBean bean = new JBean(1);
|
||||
|
||||
Integer contentId = getParaToInt("contentId");
|
||||
@ -100,7 +99,7 @@ public class JieController extends IController{
|
||||
/**
|
||||
* 帖子加精/置顶
|
||||
*/
|
||||
public void set(){
|
||||
public void set() {
|
||||
JBean bean = new JBean(1);
|
||||
|
||||
Integer contentId = getParaToInt("id");
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.lxyer.controller;
|
||||
|
||||
import com.jfinal.aop.Inject;
|
||||
import com.lxyer.config.JBean;
|
||||
import com.lxyer.model.User;
|
||||
import com.lxyer.service.UserService;
|
||||
@ -9,12 +10,13 @@ import com.lxyer.service.UserService;
|
||||
*/
|
||||
public class UserController extends IController {
|
||||
|
||||
private UserService userService = UserService.me;
|
||||
@Inject
|
||||
private UserService userService;
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public void create(){
|
||||
public void create() {
|
||||
JBean bean = new JBean(1);
|
||||
String email = getPara("email");
|
||||
String pwd = getPara("pwd");
|
||||
@ -32,12 +34,12 @@ public class UserController extends IController {
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
public void login(){
|
||||
public void login() {
|
||||
String para = getPara();
|
||||
if (para == null) {
|
||||
render("login.html");
|
||||
return;
|
||||
}else if ("out".equals(para)){
|
||||
} else if ("out".equals(para)) {
|
||||
removeSessionAttr("user");
|
||||
renderJson(JBean.success);
|
||||
return;
|
||||
@ -65,14 +67,14 @@ public class UserController extends IController {
|
||||
/**
|
||||
* todo:用户修改资料
|
||||
*/
|
||||
public void update(){
|
||||
public void update() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
public void repwd(){
|
||||
public void repwd() {
|
||||
JBean bean = new JBean(1);
|
||||
String pwd = getPara("pwd");
|
||||
|
||||
|
@ -7,25 +7,25 @@ import com.lxyer.model.base.BaseComment;
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Comment extends BaseComment<Comment> {
|
||||
public static final Comment dao = new Comment().dao();
|
||||
public static final Comment dao = new Comment().dao();
|
||||
|
||||
@Override
|
||||
public String sqlSpace() {
|
||||
return "comment";
|
||||
}
|
||||
@Override
|
||||
public String sqlSpace() {
|
||||
return "comment";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comment getDao() {
|
||||
return dao;
|
||||
}
|
||||
@Override
|
||||
public Comment getDao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新点赞数
|
||||
* @param commentId
|
||||
*/
|
||||
public static void upSupportNum(Integer commentId) {
|
||||
Db.update(Db.getSqlPara("comment.upSupportNum", Kv.by("commentId", commentId)));
|
||||
}
|
||||
/**
|
||||
* 更新点赞数
|
||||
*
|
||||
* @param commentId
|
||||
*/
|
||||
public static void upSupportNum(Integer commentId) {
|
||||
Db.update(Db.getSqlPara("comment.upSupportNum", Kv.by("commentId", commentId)));
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import com.lxyer.model.base.BaseContent;
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Content extends BaseContent<Content> {
|
||||
public static final Content dao = new Content().dao();
|
||||
|
||||
@ -21,7 +20,7 @@ public class Content extends BaseContent<Content> {
|
||||
return dao;
|
||||
}
|
||||
|
||||
public static void upReplyNum(int contentId){
|
||||
public static void upReplyNum(int contentId) {
|
||||
Db.update(Db.getSqlPara("content.upReplyNum", Kv.by("contentId", contentId)));
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import com.lxyer.model.base.BaseContentItem;
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ContentItem extends BaseContentItem<ContentItem> {
|
||||
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import com.lxyer.model.base.BaseDynaAttr;
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DynaAttr extends BaseDynaAttr<DynaAttr> {
|
||||
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ 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();
|
||||
|
||||
|
@ -6,7 +6,6 @@ import com.lxyer.model.base.BaseUserPwd;
|
||||
/**
|
||||
* Generated by JFinal.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class UserPwd extends BaseUserPwd<UserPwd> {
|
||||
public static final UserPwd dao = new UserPwd().dao();
|
||||
|
||||
@ -16,7 +15,7 @@ public class UserPwd extends BaseUserPwd<UserPwd> {
|
||||
setPwd(LxyKit.md5IfNeed(getPwd()));
|
||||
if (findById(getUserId()) == null) {
|
||||
return super.save();
|
||||
}else {
|
||||
} else {
|
||||
return super.update();
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
/**
|
||||
* 请勿将俱乐部专享资源复制给其他人,保护知识产权即是保护我们所在的行业,进而保护我们自己的利益
|
||||
* 即便是公司的同事,也请尊重 JFinal 作者的努力与付出,不要复制给同事
|
||||
*
|
||||
* <p>
|
||||
* 如果你尚未加入俱乐部,请立即删除该项目,或者现在加入俱乐部:http://jfinal.com/club
|
||||
*
|
||||
* <p>
|
||||
* 俱乐部将提供 jfinal-club 项目文档与设计资源、专用 QQ 群,以及作者在俱乐部定期的分享与答疑,
|
||||
* 价值远比仅仅拥有 jfinal club 项目源代码要大得多
|
||||
*
|
||||
* <p>
|
||||
* JFinal 俱乐部是五年以来首次寻求外部资源的尝试,以便于有资源创建更加
|
||||
* 高品质的产品与服务,为大家带来更大的价值,所以请大家多多支持,不要将
|
||||
* 首次的尝试扼杀在了摇篮之中
|
||||
@ -25,62 +25,61 @@ 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",
|
||||
"act_log",
|
||||
"user",
|
||||
"user_pwd"
|
||||
};
|
||||
/**
|
||||
* 部分功能使用 Db + Record 模式实现,无需生成 model 的 table 在此配置
|
||||
*/
|
||||
private static String[] excludedTable = {
|
||||
"comment",
|
||||
"content",
|
||||
"content_item",
|
||||
"dyna_attr",
|
||||
"act_log",
|
||||
"user",
|
||||
"user_pwd"
|
||||
};
|
||||
|
||||
/**
|
||||
* 重用 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();
|
||||
}
|
||||
/**
|
||||
* 重用 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";
|
||||
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);
|
||||
System.out.println("输出路径:" + baseModelOutputDir);
|
||||
|
||||
// model 所使用的包名 (MappingKit 默认使用的包名)
|
||||
String modelPackageName = "com.lxyer.dev";
|
||||
// model 文件保存路径 (MappingKit 与 DataDictionary 文件默认保存路径)
|
||||
String modelOutputDir = 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();
|
||||
}
|
||||
// 创建生成器
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -1,68 +1,68 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseActLog<M extends BaseActLog<M>> extends Model<M> implements IBean,IModel<M> {
|
||||
public abstract class BaseActLog<M extends BaseActLog<M>> extends Model<M> implements IBean, IModel<M> {
|
||||
|
||||
public void setLogid(java.lang.Integer logid) {
|
||||
set("logid", logid);
|
||||
}
|
||||
|
||||
public java.lang.Integer getLogid() {
|
||||
return getInt("logid");
|
||||
}
|
||||
public void setLogid(java.lang.Integer logid) {
|
||||
set("logid", logid);
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
public java.lang.Integer getLogid() {
|
||||
return getInt("logid");
|
||||
}
|
||||
|
||||
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 void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
public void setTid(java.lang.Integer tid) {
|
||||
set("tid", tid);
|
||||
}
|
||||
|
||||
public void setRemark(java.lang.String remark) {
|
||||
set("remark", remark);
|
||||
}
|
||||
|
||||
public java.lang.String getRemark() {
|
||||
return getStr("remark");
|
||||
}
|
||||
public java.lang.Integer getTid() {
|
||||
return getInt("tid");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,84 +1,84 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseComment<M extends BaseComment<M>> extends Model<M> implements IBean,IModel<M> {
|
||||
public abstract class BaseComment<M extends BaseComment<M>> extends Model<M> implements IBean, IModel<M> {
|
||||
|
||||
public void setCommentId(java.lang.Integer commentId) {
|
||||
set("commentId", commentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCommentId() {
|
||||
return getInt("commentId");
|
||||
}
|
||||
public void setCommentId(java.lang.Integer commentId) {
|
||||
set("commentId", commentId);
|
||||
}
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
public java.lang.Integer getCommentId() {
|
||||
return getInt("commentId");
|
||||
}
|
||||
|
||||
public void setPid(java.lang.Integer pid) {
|
||||
set("pid", pid);
|
||||
}
|
||||
|
||||
public java.lang.Integer getPid() {
|
||||
return getInt("pid");
|
||||
}
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
public void setPid(java.lang.Integer pid) {
|
||||
set("pid", pid);
|
||||
}
|
||||
|
||||
public void setContent(java.lang.String content) {
|
||||
set("content", content);
|
||||
}
|
||||
|
||||
public java.lang.String getContent() {
|
||||
return getStr("content");
|
||||
}
|
||||
public java.lang.Integer getPid() {
|
||||
return getInt("pid");
|
||||
}
|
||||
|
||||
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 void setSupportNum(java.lang.Integer supportNum) {
|
||||
set("supportNum", supportNum);
|
||||
}
|
||||
|
||||
public java.lang.Integer getSupportNum() {
|
||||
return getInt("supportNum");
|
||||
}
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,125 +1,124 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseContent<M extends BaseContent<M>> extends Model<M> implements IBean,IModel<M> {
|
||||
public abstract class BaseContent<M extends BaseContent<M>> extends Model<M> implements IBean, IModel<M> {
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
|
||||
public void setTitle(java.lang.String title) {
|
||||
set("title", title);
|
||||
}
|
||||
|
||||
public java.lang.String getTitle() {
|
||||
return getStr("title");
|
||||
}
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public void setDigest(java.lang.String digest) {
|
||||
set("digest", digest);
|
||||
}
|
||||
|
||||
public java.lang.String getDigest() {
|
||||
return getStr("digest");
|
||||
}
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setContent(java.lang.String content) {
|
||||
set("content", content);
|
||||
}
|
||||
|
||||
public java.lang.String getContent() {
|
||||
return getStr("content");
|
||||
}
|
||||
public void setTitle(java.lang.String title) {
|
||||
set("title", title);
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
public java.lang.String getTitle() {
|
||||
return getStr("title");
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
public void setDigest(java.lang.String digest) {
|
||||
set("digest", digest);
|
||||
}
|
||||
|
||||
public void setType(java.lang.Integer type) {
|
||||
set("type", type);
|
||||
}
|
||||
|
||||
public java.lang.Integer getType() {
|
||||
return getInt("type");
|
||||
}
|
||||
public java.lang.String getDigest() {
|
||||
return getStr("digest");
|
||||
}
|
||||
|
||||
public void setReplyNum(java.lang.Integer replyNum) {
|
||||
set("replyNum", replyNum);
|
||||
}
|
||||
|
||||
public java.lang.Integer getReplyNum() {
|
||||
return getInt("replyNum");
|
||||
}
|
||||
public void setContent(java.lang.String content) {
|
||||
set("content", content);
|
||||
}
|
||||
|
||||
public void setViewNum(java.lang.Integer viewNum) {
|
||||
set("viewNum", viewNum);
|
||||
}
|
||||
|
||||
public java.lang.Integer getViewNum() {
|
||||
return getInt("viewNum");
|
||||
}
|
||||
public java.lang.String getContent() {
|
||||
return getStr("content");
|
||||
}
|
||||
|
||||
public void setWonderful(java.lang.Integer wonderful) {
|
||||
set("wonderful", wonderful);
|
||||
}
|
||||
|
||||
public java.lang.Integer getWonderful() {
|
||||
return getInt("wonderful");
|
||||
}
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public void setTop(java.lang.Integer top) {
|
||||
set("top", top);
|
||||
}
|
||||
|
||||
public java.lang.Integer getTop() {
|
||||
return getInt("top");
|
||||
}
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
|
||||
public void setSolved(java.lang.Integer solved) {
|
||||
set("solved", solved);
|
||||
}
|
||||
|
||||
public java.lang.Integer getSolved() {
|
||||
return getInt("solved");
|
||||
}
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
@ -9,36 +9,36 @@ import com.jfinal.plugin.activerecord.IBean;
|
||||
@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 setItemId(java.lang.Integer itemId) {
|
||||
set("itemId", itemId);
|
||||
}
|
||||
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getContentId() {
|
||||
return getInt("contentId");
|
||||
}
|
||||
public java.lang.Integer getItemId() {
|
||||
return getInt("itemId");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.util.Date createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.util.Date getCreateTime() {
|
||||
return get("createTime");
|
||||
}
|
||||
public void setContentId(java.lang.Integer contentId) {
|
||||
set("contentId", contentId);
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
@ -9,36 +9,36 @@ import com.jfinal.plugin.activerecord.IBean;
|
||||
@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 setTid(java.lang.Integer tid) {
|
||||
set("tid", tid);
|
||||
}
|
||||
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public java.lang.Integer getCate() {
|
||||
return getInt("cate");
|
||||
}
|
||||
public java.lang.Integer getTid() {
|
||||
return getInt("tid");
|
||||
}
|
||||
|
||||
public void setAttr(java.lang.String attr) {
|
||||
set("attr", attr);
|
||||
}
|
||||
|
||||
public java.lang.String getAttr() {
|
||||
return getStr("attr");
|
||||
}
|
||||
public void setCate(java.lang.Integer cate) {
|
||||
set("cate", cate);
|
||||
}
|
||||
|
||||
public void setValue(java.lang.String value) {
|
||||
set("value", value);
|
||||
}
|
||||
|
||||
public java.lang.String getValue() {
|
||||
return getStr("value");
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,108 +1,108 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseUser<M extends BaseUser<M>> extends Model<M> implements IBean,IModel<M> {
|
||||
public abstract class BaseUser<M extends BaseUser<M>> extends Model<M> implements IBean, IModel<M> {
|
||||
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
public void setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public void setUsername(java.lang.String username) {
|
||||
set("username", username);
|
||||
}
|
||||
|
||||
public java.lang.String getUsername() {
|
||||
return getStr("username");
|
||||
}
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setSex(java.lang.Integer sex) {
|
||||
set("sex", sex);
|
||||
}
|
||||
|
||||
public java.lang.Integer getSex() {
|
||||
return getInt("sex");
|
||||
}
|
||||
public void setUsername(java.lang.String username) {
|
||||
set("username", username);
|
||||
}
|
||||
|
||||
public void setPhone(java.lang.String phone) {
|
||||
set("phone", phone);
|
||||
}
|
||||
|
||||
public java.lang.String getPhone() {
|
||||
return getStr("phone");
|
||||
}
|
||||
public java.lang.String getUsername() {
|
||||
return getStr("username");
|
||||
}
|
||||
|
||||
public void setNickname(java.lang.String nickname) {
|
||||
set("nickname", nickname);
|
||||
}
|
||||
|
||||
public java.lang.String getNickname() {
|
||||
return getStr("nickname");
|
||||
}
|
||||
public void setSex(java.lang.Integer sex) {
|
||||
set("sex", sex);
|
||||
}
|
||||
|
||||
public void setAvatar(java.lang.String avatar) {
|
||||
set("avatar", avatar);
|
||||
}
|
||||
|
||||
public java.lang.String getAvatar() {
|
||||
return getStr("avatar");
|
||||
}
|
||||
public java.lang.Integer getSex() {
|
||||
return getInt("sex");
|
||||
}
|
||||
|
||||
public void setRealname(java.lang.String realname) {
|
||||
set("realname", realname);
|
||||
}
|
||||
|
||||
public java.lang.String getRealname() {
|
||||
return getStr("realname");
|
||||
}
|
||||
public void setPhone(java.lang.String phone) {
|
||||
set("phone", phone);
|
||||
}
|
||||
|
||||
public void setEmail(java.lang.String email) {
|
||||
set("email", email);
|
||||
}
|
||||
|
||||
public java.lang.String getEmail() {
|
||||
return getStr("email");
|
||||
}
|
||||
public java.lang.String getPhone() {
|
||||
return getStr("phone");
|
||||
}
|
||||
|
||||
public void setCreateTime(java.lang.Long createTime) {
|
||||
set("createTime", createTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getCreateTime() {
|
||||
return getLong("createTime");
|
||||
}
|
||||
public void setNickname(java.lang.String nickname) {
|
||||
set("nickname", nickname);
|
||||
}
|
||||
|
||||
public void setSign(java.lang.String sign) {
|
||||
set("sign", sign);
|
||||
}
|
||||
|
||||
public java.lang.String getSign() {
|
||||
return getStr("sign");
|
||||
}
|
||||
public java.lang.String getNickname() {
|
||||
return getStr("nickname");
|
||||
}
|
||||
|
||||
public void setCity(java.lang.String city) {
|
||||
set("city", city);
|
||||
}
|
||||
|
||||
public java.lang.String getCity() {
|
||||
return getStr("city");
|
||||
}
|
||||
public void setAvatar(java.lang.String avatar) {
|
||||
set("avatar", avatar);
|
||||
}
|
||||
|
||||
public void setStatus(java.lang.Integer status) {
|
||||
set("status", status);
|
||||
}
|
||||
|
||||
public java.lang.Integer getStatus() {
|
||||
return getInt("status");
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.lxyer.model.base;
|
||||
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
import com.jfinal.plugin.activerecord.IBean;
|
||||
import com.jfinal.plugin.activerecord.Model;
|
||||
|
||||
/**
|
||||
* Generated by JFinal, do not modify this file.
|
||||
@ -9,28 +9,28 @@ import com.jfinal.plugin.activerecord.IBean;
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BaseUserPwd<M extends BaseUserPwd<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 setUserId(java.lang.Integer userId) {
|
||||
set("userId", userId);
|
||||
}
|
||||
|
||||
public void setPwd(java.lang.String pwd) {
|
||||
set("pwd", pwd);
|
||||
}
|
||||
|
||||
public java.lang.String getPwd() {
|
||||
return getStr("pwd");
|
||||
}
|
||||
public java.lang.Integer getUserId() {
|
||||
return getInt("userId");
|
||||
}
|
||||
|
||||
public void setUpdateTime(java.lang.Long updateTime) {
|
||||
set("updateTime", updateTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getUpdateTime() {
|
||||
return getLong("updateTime");
|
||||
}
|
||||
public void setPwd(java.lang.String pwd) {
|
||||
set("pwd", pwd);
|
||||
}
|
||||
|
||||
public java.lang.String getPwd() {
|
||||
return getStr("pwd");
|
||||
}
|
||||
|
||||
public void setUpdateTime(java.lang.Long updateTime) {
|
||||
set("updateTime", updateTime);
|
||||
}
|
||||
|
||||
public java.lang.Long getUpdateTime() {
|
||||
return getLong("updateTime");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,21 +11,22 @@ import java.util.List;
|
||||
public interface IModel<M extends Model<M>> {
|
||||
|
||||
String sqlSpace();
|
||||
|
||||
M getDao();
|
||||
|
||||
default List<M> findList(Kv kv){
|
||||
SqlPara sqlPara = getDao().getSqlPara(sqlSpace()+".list", kv);
|
||||
default List<M> findList(Kv kv) {
|
||||
SqlPara sqlPara = getDao().getSqlPara(sqlSpace() + ".list", kv);
|
||||
|
||||
return getDao().find(sqlPara);
|
||||
}
|
||||
|
||||
default M findFirst(Kv kv){
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace()+".list", kv);
|
||||
default M findFirst(Kv kv) {
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace() + ".list", kv);
|
||||
return getDao().findFirst(sqlPara);
|
||||
}
|
||||
|
||||
default Page<M> findPage(int pn, int ps, Kv kv){
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace()+".list", kv);
|
||||
default Page<M> findPage(int pn, int ps, Kv kv) {
|
||||
SqlPara sqlPara = Db.getSqlPara(sqlSpace() + ".list", kv);
|
||||
|
||||
return getDao().paginate(pn, ps, sqlPara);
|
||||
}
|
||||
|
@ -1,23 +1,19 @@
|
||||
package com.lxyer.service;
|
||||
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.lxyer.model.ActLog;
|
||||
import com.lxyer.model.Comment;
|
||||
import com.lxyer.model.Content;
|
||||
import com.lxyer.model.*;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/9 11:59.
|
||||
*/
|
||||
public class CommentService {
|
||||
public static final CommentService me = new CommentService();
|
||||
|
||||
public class CommentService extends IService {
|
||||
|
||||
public void save(Comment comment, Integer userId) {
|
||||
if (comment.getCommentId() == null){
|
||||
if (comment.getCommentId() == null) {
|
||||
comment.setUserId(userId);
|
||||
comment.setCreateTime(System.currentTimeMillis());
|
||||
comment.save();
|
||||
}else {
|
||||
} else {
|
||||
comment.update();
|
||||
}
|
||||
|
||||
@ -27,6 +23,7 @@ public class CommentService {
|
||||
|
||||
/**
|
||||
* 评论点赞
|
||||
*
|
||||
* @param commentId
|
||||
* @param ok
|
||||
* @param userId
|
||||
@ -38,7 +35,7 @@ public class CommentService {
|
||||
throw new Exception("操作失败,未查询到相关信息");
|
||||
|
||||
ActLog actLog = ActLog.dao.findFirst(Kv.by("userId", userId).set("tid", commentId).set("cate", 1));
|
||||
if (actLog == null){
|
||||
if (actLog == null) {
|
||||
actLog = new ActLog();
|
||||
actLog.setTid(commentId);
|
||||
actLog.setUserId(userId);
|
||||
@ -46,7 +43,7 @@ public class CommentService {
|
||||
actLog.setStatus(1);
|
||||
actLog.setCreateTime(System.currentTimeMillis());
|
||||
actLog.save();
|
||||
}else if (actLog.getStatus() != ok){
|
||||
} else if (actLog.getStatus() != ok) {
|
||||
actLog.setStatus(ok == 1 ? 1 : -1);
|
||||
actLog.setCreateTime(System.currentTimeMillis());
|
||||
actLog.update();
|
||||
|
@ -7,12 +7,13 @@ import com.lxyer.model.Content;
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 16:49.
|
||||
*/
|
||||
public class ContentService {
|
||||
public class ContentService extends IService {
|
||||
|
||||
public static final ContentService me = new ContentService();
|
||||
|
||||
/**
|
||||
* 帖子保存
|
||||
*
|
||||
* @param content
|
||||
* @param userId
|
||||
*/
|
||||
@ -21,13 +22,14 @@ public class ContentService {
|
||||
content.setCreateTime(System.currentTimeMillis());
|
||||
content.setUserId(userId);
|
||||
content.save();
|
||||
}else {
|
||||
} else {
|
||||
content.update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除帖子
|
||||
*
|
||||
* @param contentId
|
||||
* @param userId
|
||||
* @throws Exception
|
||||
@ -47,6 +49,7 @@ public class ContentService {
|
||||
|
||||
/**
|
||||
* 帖子收藏
|
||||
*
|
||||
* @param contentId
|
||||
* @param userId
|
||||
* @param status
|
||||
@ -60,14 +63,14 @@ public class ContentService {
|
||||
Kv kv = Kv.by("tid", contentId).set("userId", userId).set("cate", 2);//cate:2收藏
|
||||
ActLog actLog = ActLog.dao.findFirst(kv);
|
||||
|
||||
if (actLog == null){
|
||||
if (actLog == null) {
|
||||
actLog = new ActLog();
|
||||
actLog.setCate(2);
|
||||
actLog.setTid(contentId);
|
||||
actLog.setUserId(userId);
|
||||
actLog.setCreateTime(System.currentTimeMillis());
|
||||
actLog.save();
|
||||
}else if (actLog.getStatus() != status){
|
||||
} else if (actLog.getStatus() != status) {
|
||||
actLog.setStatus(status == 1 ? 1 : -1);
|
||||
actLog.setCreateTime(System.currentTimeMillis());
|
||||
actLog.update();
|
||||
@ -79,6 +82,7 @@ public class ContentService {
|
||||
|
||||
/**
|
||||
* 帖子置顶/加精
|
||||
*
|
||||
* @param contentId
|
||||
* @param field
|
||||
* @param v
|
||||
|
@ -11,11 +11,11 @@ import java.util.Random;
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/7 22:59.
|
||||
*/
|
||||
public class UserService {
|
||||
public static final UserService me = new UserService();
|
||||
public class UserService extends IService {
|
||||
|
||||
/**
|
||||
* 创建用户
|
||||
*
|
||||
* @param email
|
||||
* @param pwd
|
||||
* @param nickname
|
||||
@ -33,7 +33,7 @@ public class UserService {
|
||||
user.setUsername(email);
|
||||
user.setEmail(email);
|
||||
user.setNickname(nickname);
|
||||
user.setAvatar("/res/images/avatar/"+ new Random().nextInt(21) +".jpg");//默认头像
|
||||
user.setAvatar("/res/images/avatar/" + new Random().nextInt(21) + ".jpg");//默认头像
|
||||
user.setCreateTime(System.currentTimeMillis());
|
||||
user.setStatus(1);
|
||||
user.save();
|
||||
@ -46,16 +46,16 @@ public class UserService {
|
||||
|
||||
public User login(String username, String pwd) throws Exception {
|
||||
User user = User.dao.findFirst(Kv.by("username", username));
|
||||
if (user == null){
|
||||
if (user == null) {
|
||||
throw new Exception("密码错误!");
|
||||
}
|
||||
|
||||
UserPwd userPwd = UserPwd.dao.findById(user.getUserId());
|
||||
if (userPwd == null || !LxyKit.md5IfNeed(pwd).equalsIgnoreCase(userPwd.getPwd())){
|
||||
if (userPwd == null || !LxyKit.md5IfNeed(pwd).equalsIgnoreCase(userPwd.getPwd())) {
|
||||
throw new Exception("密码错误!");
|
||||
}
|
||||
|
||||
if (user.getInt("status") == -1){
|
||||
if (user.getInt("status") == -1) {
|
||||
throw new Exception("限制登录");
|
||||
}
|
||||
|
||||
@ -68,6 +68,7 @@ public class UserService {
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param userId
|
||||
* @param pwd
|
||||
*/
|
||||
|
@ -111,7 +111,7 @@
|
||||
#(x.content)
|
||||
</div>
|
||||
<div class="jieda-reply">
|
||||
#if(x.hadSupport > 1)
|
||||
#if(x.hadSupport??0 > 1)
|
||||
<span class="jieda-zan zanok" type="zan"><i class="iconfont icon-zan"></i><em>#(x.supportNum)</em></span>
|
||||
#else
|
||||
<span class="jieda-zan" type="zan"><i class="iconfont icon-zan"></i><em>#(x.supportNum)</em></span>
|
||||
|
Loading…
Reference in New Issue
Block a user