|
|
@ -1,8 +1,13 @@ |
|
|
|
package com.zc.business.controller; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.util.List; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import com.ruoyi.common.config.RuoYiConfig; |
|
|
|
import com.ruoyi.common.exception.file.InvalidExtensionException; |
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils; |
|
|
|
import com.ruoyi.common.utils.file.MimeTypeUtils; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
@ -85,8 +90,12 @@ public class DcEventProcessController extends BaseController |
|
|
|
@PreAuthorize("@ss.hasPermi('system:process:add')") |
|
|
|
@Log(title = "事件处理流程", businessType = BusinessType.INSERT) |
|
|
|
@PostMapping |
|
|
|
public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) |
|
|
|
{ |
|
|
|
public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) throws IOException, InvalidExtensionException { |
|
|
|
//如果有文件传入
|
|
|
|
if(!dcEventProcess.getFile().isEmpty()){ |
|
|
|
String address =FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), dcEventProcess.getFile(), MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); |
|
|
|
dcEventProcess.setContext(address); |
|
|
|
} |
|
|
|
return toAjax(dcEventProcessService.insertDcEventProcess(dcEventProcess)); |
|
|
|
} |
|
|
|
|
|
|
|