diff --git a/src/main/java/com/jfinalbbs/common/BaseController.java b/src/main/java/com/jfinalbbs/common/BaseController.java index 76bfcf86f..e941733fc 100644 --- a/src/main/java/com/jfinalbbs/common/BaseController.java +++ b/src/main/java/com/jfinalbbs/common/BaseController.java @@ -49,6 +49,7 @@ public void clearCache(String cacheName, Object cacheKey) { /** * 根据用户令牌获取用户信息 + * * @param token * @return */ @@ -58,6 +59,7 @@ public User getUser(String token) { /** * 根据用户名查询后台用户 + * * @return */ public AdminUser getAdminUser() { diff --git a/src/main/java/com/jfinalbbs/common/BaseModel.java b/src/main/java/com/jfinalbbs/common/BaseModel.java index 9a6c59940..557ce2f6e 100644 --- a/src/main/java/com/jfinalbbs/common/BaseModel.java +++ b/src/main/java/com/jfinalbbs/common/BaseModel.java @@ -15,7 +15,7 @@ public class BaseModel extends Model { public String formatDate(Date date) { String dateStr = ""; - if(date != null) { + if (date != null) { PrettyTime prettyTime = new PrettyTime(Locale.CHINA); dateStr = prettyTime.format(date); } diff --git a/src/main/java/com/jfinalbbs/common/JFinalbbsConfig.java b/src/main/java/com/jfinalbbs/common/JFinalbbsConfig.java index dd6e46155..b216263b6 100644 --- a/src/main/java/com/jfinalbbs/common/JFinalbbsConfig.java +++ b/src/main/java/com/jfinalbbs/common/JFinalbbsConfig.java @@ -9,7 +9,6 @@ import com.jfinal.kit.HashKit; import com.jfinal.kit.PathKit; import com.jfinal.kit.PropKit; -import com.jfinal.plugin.activerecord.ActiveRecordPlugin; import com.jfinal.plugin.druid.DruidPlugin; import com.jfinal.plugin.ehcache.EhCachePlugin; import com.jfinal.render.FreeMarkerRender; diff --git a/src/main/java/com/jfinalbbs/interceptor/ClientInterceptor.java b/src/main/java/com/jfinalbbs/interceptor/ClientInterceptor.java index 8aff74e02..c8a947301 100644 --- a/src/main/java/com/jfinalbbs/interceptor/ClientInterceptor.java +++ b/src/main/java/com/jfinalbbs/interceptor/ClientInterceptor.java @@ -17,14 +17,14 @@ public class ClientInterceptor implements Interceptor { public void intercept(Invocation inv) { String token = inv.getController().getPara("token"); Result result = new Result(Constants.CODE_SUCCESS, Constants.DESC_SUCCESS, null); - if(StrUtil.isBlank(token)) { + if (StrUtil.isBlank(token)) { result.setCode(Constants.CODE_FAILURE); result.setDescription("用户令牌不能为空"); inv.getController().renderJson(result); } else { //验证token 的合法性 User user = User.me.findByToken(token); - if(user == null) { + if (user == null) { result.setCode(Constants.CODE_FAILURE); result.setDescription("用户令牌无效"); inv.getController().renderJson(result); diff --git a/src/main/java/com/jfinalbbs/module/collect/CollectClientController.java b/src/main/java/com/jfinalbbs/module/collect/CollectClientController.java index 1c9b77afb..9595e2175 100644 --- a/src/main/java/com/jfinalbbs/module/collect/CollectClientController.java +++ b/src/main/java/com/jfinalbbs/module/collect/CollectClientController.java @@ -22,9 +22,9 @@ public class CollectClientController extends BaseController { public void index() { String tid = getPara("tid"); - if(StrUtil.isBlank(tid)) { + if (StrUtil.isBlank(tid)) { error("话题id不能为空"); - } else if(Topic.me.findById(tid) == null) { + } else if (Topic.me.findById(tid) == null) { error("无效话题"); } else { String token = getPara("token"); @@ -48,9 +48,9 @@ public void index() { public void delete() { String tid = getPara("tid"); - if(StrUtil.isBlank(tid)) { + if (StrUtil.isBlank(tid)) { error("话题id不能为空"); - } else if(Topic.me.findById(tid) == null) { + } else if (Topic.me.findById(tid) == null) { error("无效话题"); } else { String token = getPara("token"); diff --git a/src/main/java/com/jfinalbbs/module/index/IndexClientController.java b/src/main/java/com/jfinalbbs/module/index/IndexClientController.java index 49641eba1..9c468922c 100644 --- a/src/main/java/com/jfinalbbs/module/index/IndexClientController.java +++ b/src/main/java/com/jfinalbbs/module/index/IndexClientController.java @@ -22,7 +22,7 @@ public void index() { } Page page = Topic.me.paginate(getParaToInt("p", 1), getParaToInt("size", defaultPageSize()), tab, q, 1, l); - for(Topic t : page.getList()) { + for (Topic t : page.getList()) { // t.set("content", ) } success(page); diff --git a/src/main/java/com/jfinalbbs/module/index/IndexController.java b/src/main/java/com/jfinalbbs/module/index/IndexController.java index cab8b0919..f6003a261 100644 --- a/src/main/java/com/jfinalbbs/module/index/IndexController.java +++ b/src/main/java/com/jfinalbbs/module/index/IndexController.java @@ -15,7 +15,6 @@ import com.jfinalbbs.utils.DateUtil; import com.jfinalbbs.utils.EmailSender; import com.jfinalbbs.utils.StrUtil; -import com.jfinalbbs.utils.ext.plugin.shiro.ShiroKit; import com.jfinalbbs.utils.ext.route.ControllerBind; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.AuthenticationException; @@ -46,11 +45,11 @@ public void index() { tab = "all"; setAttr("_label", Label.me.findById(l)); } - if(tab.equals("all") || tab.equals("good")) { + if (tab.equals("all") || tab.equals("good")) { setAttr("sectionName", "板块"); } else { Section section = Section.me.findByTab(tab); - setAttr("sectionName", section!=null?section.get("name"):"板块"); + setAttr("sectionName", section != null ? section.get("name") : "板块"); } Page page = Topic.me.paginate(getParaToInt("p", 1), getParaToInt("size", defaultPageSize()), tab, q, 1, l); diff --git a/src/main/java/com/jfinalbbs/module/label/Label.java b/src/main/java/com/jfinalbbs/module/label/Label.java index 4924841fc..96c3646c3 100644 --- a/src/main/java/com/jfinalbbs/module/label/Label.java +++ b/src/main/java/com/jfinalbbs/module/label/Label.java @@ -49,10 +49,10 @@ public List findByLabels(String id, List