SiteController.java 873 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.lsw.controller.admin.system.site;
  2. import com.jfinal.aop.Before;
  3. import com.jfinal.kit.JsonKit;
  4. import com.lsw.base.BaseController;
  5. import com.lsw.model.system.Role;
  6. import com.lsw.model.system.Site;
  7. import org.apache.shiro.authz.annotation.RequiresPermissions;
  8. /**
  9. * @author 李书文
  10. * @description 站点管理
  11. * @time 2017-5-29
  12. */
  13. public class SiteController extends BaseController {
  14. /**
  15. * 管理页面
  16. */
  17. @RequiresPermissions("site:index")
  18. public void index() {
  19. Site site=Site.dao.findById("1");
  20. setAttr("site", JsonKit.toJson(site));
  21. render("index.html");
  22. }
  23. /**
  24. * 编辑站点
  25. */
  26. @RequiresPermissions("site:edit")
  27. @Before(SiteValidator.class)
  28. public void edit() {
  29. Role site = getModel(Role.class, "", true);
  30. site.update();
  31. renderSuccess();
  32. }
  33. }