¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.validation.constraints.*; |
| | | import org.dromara.workflow.domain.bo.WfDefinitionConfigBo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | | import org.dromara.common.log.annotation.Log; |
| | | import org.dromara.common.web.core.BaseController; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.workflow.domain.vo.WfDefinitionConfigVo; |
| | | import org.dromara.workflow.service.IWfDefinitionConfigService; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹é
ç½® |
| | | * |
| | | * @author may |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/workflow/definitionConfig") |
| | | public class WfDefinitionConfigController extends BaseController { |
| | | |
| | | private final IWfDefinitionConfigService wfDefinitionConfigService; |
| | | |
| | | |
| | | /** |
| | | * è·åæµç¨å®ä¹é
置详ç»ä¿¡æ¯ |
| | | * |
| | | * @param definitionId ä¸»é® |
| | | */ |
| | | @GetMapping("/getByDefId/{definitionId}") |
| | | public R<WfDefinitionConfigVo> getByDefId(@NotBlank(message = "æµç¨å®ä¹IDä¸è½ä¸ºç©º") |
| | | @PathVariable String definitionId) { |
| | | return R.ok(wfDefinitionConfigService.getByDefId(definitionId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æµç¨å®ä¹é
ç½® |
| | | */ |
| | | @Log(title = "æµç¨å®ä¹é
ç½®", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping("/saveOrUpdate") |
| | | public R<Void> saveOrUpdate(@Validated(AddGroup.class) @RequestBody WfDefinitionConfigBo bo) { |
| | | return toAjax(wfDefinitionConfigService.saveOrUpdate(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿µç¨å®ä¹é
ç½® |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @Log(title = "æµç¨å®ä¹é
ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(wfDefinitionConfigService.deleteByIds(List.of(ids))); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æµç¨å®ä¹é
ç½®æé¤å½åæ¥è¯¢çæµç¨å®ä¹ |
| | | * |
| | | * @param tableName 表å |
| | | * @param definitionId æµç¨å®ä¹id |
| | | */ |
| | | @GetMapping("/getByTableNameNotDefId/{tableName}/{definitionId}") |
| | | public R<List<WfDefinitionConfigVo>> getByTableNameNotDefId(@NotBlank(message = "表åä¸è½ä¸ºç©º") @PathVariable String tableName, |
| | | @NotBlank(message = "æµç¨å®ä¹IDä¸è½ä¸ºç©º") @PathVariable String definitionId) { |
| | | return R.ok(wfDefinitionConfigService.getByTableNameNotDefId(tableName, definitionId)); |
| | | } |
| | | |
| | | } |