|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package com.foreverwin.mesnac.dispatch.controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.foreverwin.mesnac.dispatch.dto.UserResourceDto;
|
|
|
|
@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@ -137,8 +140,12 @@ public class UserResourceController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("saveAll")
|
|
|
|
|
public R saveAll(@RequestBody List<UserResourceDto> userResourceList){
|
|
|
|
|
userResourceService.saveAll(userResourceList);
|
|
|
|
|
public R saveAll(@RequestBody Map<String,Object> param){
|
|
|
|
|
String resource = (String) param.get("resource");
|
|
|
|
|
String user = (String) param.get("user");
|
|
|
|
|
String str = JSONUtil.toJsonStr(param.get("userResourceList"));
|
|
|
|
|
List<UserResourceDto> userResourceList = JSONArray.parseArray(str, UserResourceDto.class);
|
|
|
|
|
userResourceService.saveAll(userResourceList,resource,user);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|