帖子功能加入[发布/更新/评论/置顶/加精/删除]

This commit is contained in:
2018-01-09 23:16:16 +08:00
parent f2cc75b5bd
commit cb3a29991e
20 changed files with 376 additions and 67 deletions

View File

@@ -0,0 +1,58 @@
package com.lxyer.controller;
import com.jfinal.aop.Before;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;
import com.lxyer.config.JBean;
import com.lxyer.config.interceptor.LoginInterceptor;
import com.lxyer.model.Comment;
import com.lxyer.service.CommentService;
/**
* Created by JUECHENG at 2018/1/8 23:07.
*/
public class CommentController extends IController {
CommentService service = CommentService.me;
/**
* 评论列表
*/
public void list(){
Kv kv = getParams("contentId");
Page<Comment> page = Comment.dao.findPage(getPn(), getPs(), kv);
renderJBean(page);
}
/**
* 评论详情
*/
public void info(){
}
/**
* 评论保存
*/
@Before(LoginInterceptor.class)
public void save(){
Comment comment = getModel(Comment.class);
service.save(comment, getUserId());
renderJBean(JBean.success);
}
/**
* todo:更新状态
*/
public void update_status(){
}
/**
* todo:评论点赞
*/
public void support(){
}
}