disconf.sql 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. use `disconf`;
  2. CREATE TABLE `role` (
  3. `role_id` INT(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  4. `role_name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '角色名',
  5. `create_time` VARCHAR(14) NOT NULL DEFAULT '99991231235959' COMMENT '创建时间',
  6. `create_by` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '创建人',
  7. `update_time` VARCHAR(14) NOT NULL DEFAULT '99991231235959' COMMENT '更新时间',
  8. `update_by` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '更新人',
  9. PRIMARY KEY (`role_id`)
  10. )
  11. COLLATE='utf8_general_ci'
  12. ENGINE=InnoDB;
  13. CREATE TABLE `role_resource` (
  14. `role_res_id` INT(10) NOT NULL AUTO_INCREMENT COMMENT 'role-resource id',
  15. `role_id` INT(10) NOT NULL DEFAULT '0' COMMENT '用户角色id',
  16. `url_pattern` VARCHAR(200) NOT NULL DEFAULT '' COMMENT 'controller_requestMapping_value + method_requestMapping_value',
  17. `url_description` VARCHAR(200) NOT NULL DEFAULT '' COMMENT 'url功能描述',
  18. `method_mask` VARCHAR(4) NOT NULL DEFAULT '' COMMENT 'GET, PUT, POST, DELETE, 1: accessible',
  19. `update_time` VARCHAR(14) NOT NULL DEFAULT '99991231235959' COMMENT '更新时间',
  20. PRIMARY KEY (`role_res_id`)
  21. )
  22. COMMENT='用户角色_url访问权限表'
  23. COLLATE='utf8_general_ci'
  24. ENGINE=InnoDB;
  25. INSERT INTO `role` (`role_id`, `role_name`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES (1, '普通人',
  26. '99991231235959', 2, '99991231235959', 2);
  27. INSERT INTO `role` (`role_id`, `role_name`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES (2, '管理员',
  28. '99991231235959', 2, '99991231235959', 2);
  29. INSERT INTO `role` (`role_id`, `role_name`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES (3,'测试管理员',
  30. '99991231235959', 2, '99991231235959', 2);
  31. ALTER TABLE `user`
  32. ADD COLUMN `role_id` BIGINT(20) NOT NULL DEFAULT '1' COMMENT '角色ID' AFTER `ownapps`;
  33. update `user` set role_id=2,ownapps='' where name='admin';
  34. /* admin_read admin_read*/
  35. INSERT INTO `user` (`user_id`, `name`, `password`, `token`, `ownapps`,`role_id`) VALUES (null, 'admin_read', 'b76f3e20d1c8d0bc17d40158e44097d5eeee8640', '2022ab9c2754d62f9ddba5fded91e4238247ebaf','2', '3');
  36. use disconf;
  37. delete from role_resource;
  38. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  39. (1,'/api/app/list' , 'app列表' , '1000'),
  40. (2,'/api/app/list' , 'app列表' , '1000'),
  41. (3,'/api/app/list' , 'app列表' , '1000');
  42. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  43. (1,'/api/app' , '生成一个app' , '0000'),
  44. (2,'/api/app' , '生成一个app' , '0010'),
  45. (3,'/api/app' , '生成一个app' , '0000');
  46. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  47. (1,'/api/env/list' , 'env-list' , '1000'),
  48. (2,'/api/env/list' , 'env-list' , '1000'),
  49. (3,'/api/env/list' , 'env-list' , '1000');
  50. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  51. (1,'/api/account/session' , '会话' , '1000'),
  52. (2,'/api/account/session' , '会话' , '1000'),
  53. (3,'/api/account/session' , '会话' , '1000');
  54. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  55. (1,'/api/account/signin' , '登录' , '1000'),
  56. (2,'/api/account/signin' , '登录' , '1000'),
  57. (3,'/api/account/signin' , '登录' , '1000');
  58. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  59. (1,'/api/account/signout' , '登出' , '1000'),
  60. (2,'/api/account/signout' , '登出' , '1000'),
  61. (3,'/api/account/signout' , '登出' , '1000');
  62. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  63. (1,'/api/config/item' , '获取配置项' , '1000'),
  64. (2,'/api/config/item' , '获取配置项' , '1000'),
  65. (3,'/api/config/item' , '获取配置项' , '1000');
  66. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  67. (1,'/api/config/file' , '获取配置文件' , '1000'),
  68. (2,'/api/config/file' , '获取配置文件' , '1000'),
  69. (3,'/api/config/file' , '获取配置文件' , '1000');
  70. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  71. (1,'/api/zoo/hosts' , 'zoo' , '1000'),
  72. (2,'/api/zoo/hosts' , 'zoo' , '1000'),
  73. (3,'/api/zoo/hosts' , 'zoo' , '1000');
  74. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  75. (1,'/api/zoo/prefix' , 'zoo' , '1000'),
  76. (2,'/api/zoo/prefix' , 'zoo' , '1000'),
  77. (3,'/api/zoo/prefix' , 'zoo' , '1000');
  78. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  79. (1,'/api/zoo/zkdeploy' , 'zoo' , '1000'),
  80. (2,'/api/zoo/zkdeploy' , 'zoo' , '1000'),
  81. (3,'/api/zoo/zkdeploy' , 'zoo' , '1000');
  82. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  83. (1,'/api/web/config/item' , '创建item-config' , '0010'),
  84. (2,'/api/web/config/item' , '创建item-config' , '0010'),
  85. (3,'/api/web/config/item' , '创建item-config' , '0000');
  86. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  87. (1,'/api/web/config/file' , '创建file-config' , '0010'),
  88. (2,'/api/web/config/file' , '创建file-config' , '0010'),
  89. (3,'/api/web/config/file' , '创建file-config' , '0000');
  90. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  91. (1,'/api/web/config/filetext' , '创建file-config' , '0010'),
  92. (2,'/api/web/config/filetext' , '创建file-config' , '0010'),
  93. (3,'/api/web/config/filetext' , '创建file-config' , '0000');
  94. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  95. (1,'/api/web/config/versionlist' , '版本list' , '1000'),
  96. (2,'/api/web/config/versionlist' , '版本list' , '1000'),
  97. (3,'/api/web/config/versionlist' , '版本list' , '1000');
  98. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  99. (1,'/api/web/config/list' , 'config-list' , '1000'),
  100. (2,'/api/web/config/list' , 'config-list' , '1000'),
  101. (3,'/api/web/config/list' , 'config-list' , '1000');
  102. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  103. (1,'/api/web/config/simple/list' , 'config-list' , '1000'),
  104. (2,'/api/web/config/simple/list' , 'config-list' , '1000'),
  105. (3,'/api/web/config/simple/list' , 'config-list' , '1000');
  106. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  107. (1,'/api/web/config/{configId}' , 'get/post' , '1001'),
  108. (2,'/api/web/config/{configId}' , 'get/post' , '1001'),
  109. (3,'/api/web/config/{configId}' , 'get/post' , '1000');
  110. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  111. (1,'/api/web/config/zk/{configId}' , 'get-zk' , '1000'),
  112. (2,'/api/web/config/zk/{configId}' , 'get-zk' , '1000'),
  113. (3,'/api/web/config/zk/{configId}' , 'get-zk' , '1000');
  114. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  115. (1,'/api/web/config/download/{configId}' , 'download' , '1000'),
  116. (2,'/api/web/config/download/{configId}' , 'download' , '1000'),
  117. (3,'/api/web/config/download/{configId}' , 'download' , '1000');
  118. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  119. (1,'/api/web/config/downloadfilebatch' , 'download' , '1000'),
  120. (2,'/api/web/config/downloadfilebatch' , 'download' , '1000'),
  121. (3,'/api/web/config/downloadfilebatch' , 'download' , '1000');
  122. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  123. (1,'/api/web/config/item/{configId}' , 'update' , '0100'),
  124. (2,'/api/web/config/item/{configId}' , 'update' , '0100'),
  125. (3,'/api/web/config/item/{configId}' , 'update' , '0000');
  126. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  127. (1,'/api/web/config/file/{configId}' , 'update/post' , '0010'),
  128. (2,'/api/web/config/file/{configId}' , 'update/post' , '0010'),
  129. (3,'/api/web/config/file/{configId}' , 'update/post' , '0000');
  130. INSERT INTO `role_resource` (`role_id`, `url_pattern`, `url_description`, `method_mask`) VALUES
  131. (1,'/api/web/config/filetext/{configId}' , 'update' , '0100'),
  132. (2,'/api/web/config/filetext/{configId}' , 'update' , '0100'),
  133. (3,'/api/web/config/filetext/{configId}' , 'update' , '0000');
  134. INSERT INTO `config` (`config_id`, `type`, `name`, `value`, `app_id`, `version`, `env_id`, `create_time`, `update_time`)
  135. VALUES
  136. (146, 0, 'code.properties', 'syserror.paramtype=\\u8bf7\\u6c42\\u53c2\\u6570\\u89e3\\u6790\\u9519\" + \"\\u8bef', 2, '1_0_0_0', 1, '20150107115835', '20150107115835');