spring boot 框架设计步骤

时间:2022-01-25 13:21:37
spring boot 框架设计步骤:
1.poem.xml配置
2.application.yml配置
3.entiry实体
4.realm.Myrealm extends AuthorizingRealm权限认证:授权、判断权限
5.config.ShiroConfig权限认证Bean
6.登录页面
1.webapp添加static(css ,js)包
2.登录页面webapp下login.html
3.controller.IndexController类
4.验证码controller存放在session中 7.repository.UserRepository extends JpaRepository<User,Integer>类
8.controller.UserController类 @Controller,@requestMapping("/user")
1.login()类@responseBody,@requestMapping("/login") 9.util.StringUtil工具类static 10.repository.RoleRepository extends JpaRepository<Role,Integer>类@query,nativeQuery=true
1.interfece RoleService接口
2.RoleServiceImpl implement RoleService实现类@Service("RoleService")
3.controller.UserController类 @Controller,@requestMapping("/user") 11.main.html搭建采用easyui
1.webapp添加static(images ,easyui)包
2.登录页面webapp下main.html
3.定义一些icon 12.$("#tree").tree()
1.UserController.loadMenuInfo(HttpSession session)方法
2.repository.MenuRepository extends JpaRepository<Menu,Integer>类@query
3.interfece MenuService接口
4.MenuServiceImpl implement MenuService实现类@Service("MenuService") 13.var context="<iframe ></iframe>";
$("#tabs").tabs("add",{});
if($("#tabs").tabs("exist",node.text)){("#tabs").tabs("select",node.text)} 14.用户管理@Transient不映射
repository.UserRepository extends JpaRepository<User,Integer>,JpaSpecificationExecutor<User,Integer>类
Pageable pageable=new PageRequest();
Predicate predicate=cb.conjunction();
predicate.getExpressions().add();
controller.admin.UserAdminController类 @Controller,@requestMapping("/admin/user")
<table title="" class="easyui-datagrid" fitColumns="true" pagination="true" rownumbers="true" singleSelect="true" url="" fit="true"></table>
<thead><th field="" width="" align=""></th><th></th>..</thead> 15.<form id="fm" method="post">
<table id="" class="easyui-datagrid"><tr><td></td><td></td>..</tr><tr></tr>..</table>
</form> 16.var selectedRows=$("#dg").datagrid("getSelections");
$("#dg").dialog("open").dialog("setTitle",""); 17.显示所有角色
<div id="dlg" class="easyui-dialog" style="width: 450px;height: 300px;padding: 10px 20px"
closed="true" buttons="#dlg-buttons" data-options="onClose:function(){resetValue()}"> 18.shiro认证SimpleAuthorizationInfo info=new SimpleAuthorizationInfo();
info.addStringPermission(menu.getName());info.setRoles();
@RequiresPermissions(value="")
@RequiresPermissions(value={"",""},logical=Logical.OR)
AuthenticationInfo authcInfo=new SimpleAuthenticationInfo(user.getUserName(),user.getPassword(),"xxx"); 19.cascadeCheck:false 不级联