|
|
@@ -6,6 +6,7 @@ import cn.hutool.db.Db; |
|
|
|
import cn.hutool.db.Entity; |
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.ningdatech.pmapi.AppTests; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.Menu; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
@@ -71,11 +72,12 @@ class IMenuServiceTest extends AppTests { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void initMenu() { |
|
|
|
menuService.remove(null); |
|
|
|
roleMenuService.remove(null); |
|
|
|
String str = FileUtil.readString("/Users/wendy/Desktop/long_text_2023-02-13-15-28-42.txt", "UTF-8"); |
|
|
|
List<JSONObject> obj = JSONUtil.toList(str, JSONObject.class); |
|
|
|
save(obj, 0); |
|
|
|
// menuService.remove(null); |
|
|
|
roleMenuService.remove(Wrappers.lambdaQuery(RoleMenu.class) |
|
|
|
.eq(RoleMenu::getRoleId,1)); |
|
|
|
// String str = FileUtil.readString("/Users/wendy/Desktop/long_text_2023-02-13-15-28-42.txt", "UTF-8"); |
|
|
|
// List<JSONObject> obj = JSONUtil.toList(str, JSONObject.class); |
|
|
|
// save(obj, 0); |
|
|
|
menuService.list().forEach(w -> { |
|
|
|
roleMenuService.save(new RoleMenu() {{ |
|
|
|
setRoleId(1L); |
|
|
|