|
@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.material;
|
|
|
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -90,7 +92,16 @@ public class BomanMaterialController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody BomanMaterial bomanMaterial)
|
|
|
{
|
|
|
- return toAjax(bomanMaterialService.insertBomanMaterial(bomanMaterial));
|
|
|
+ List<BomanMaterial> bomanMaterialList = bomanMaterial.getBomanMaterialList();
|
|
|
+ if (bomanMaterialList != null && bomanMaterialList.size() > 0){
|
|
|
+ for (BomanMaterial material : bomanMaterialList) {
|
|
|
+ material.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
|
|
+ material.setKeywords(bomanMaterial.getKeywords());
|
|
|
+ material.setReleaseTime(bomanMaterial.getReleaseTime());
|
|
|
+ material.setType(bomanMaterial.getType());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return toAjax(bomanMaterialService.insertBomanMaterial(bomanMaterialList));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -98,7 +109,7 @@ public class BomanMaterialController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:material:edit')")
|
|
|
@Log(title = "素材库", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping
|
|
|
+ @PostMapping("/put")
|
|
|
public AjaxResult edit(@RequestBody BomanMaterial bomanMaterial)
|
|
|
{
|
|
|
return toAjax(bomanMaterialService.updateBomanMaterial(bomanMaterial));
|
|
@@ -109,7 +120,7 @@ public class BomanMaterialController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:material:remove')")
|
|
|
@Log(title = "素材库", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{materialIds}")
|
|
|
+ @GetMapping("/delete/{materialIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] materialIds)
|
|
|
{
|
|
|
return toAjax(bomanMaterialService.deleteBomanMaterialByMaterialIds(materialIds));
|