|
@@ -4,6 +4,7 @@ import com.flow.common.core.model.Result;
|
|
|
import com.flow.entity.FlowGroup;
|
|
|
import com.flow.service.FlowGroupService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -20,22 +21,26 @@ public class FlowGroupController {
|
|
|
return Result.success(flowGroupService.list(flowGroup));
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("hasAnyAuthority('flow:group:add')")
|
|
|
@PostMapping
|
|
|
public Result<FlowGroup> create(@RequestBody FlowGroup flowGroup) {
|
|
|
return Result.success(flowGroupService.create(flowGroup));
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("hasAnyAuthority('flow:group:edit')")
|
|
|
@PutMapping
|
|
|
public Result<FlowGroup> update(@RequestBody FlowGroup flowGroup) {
|
|
|
return Result.success(flowGroupService.update(flowGroup));
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("hasAnyAuthority('flow:group:del')")
|
|
|
@DeleteMapping
|
|
|
public Result<?> delete(@RequestBody Set<Long> ids) {
|
|
|
flowGroupService.delete(ids);
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("hasAnyAuthority('flow:group:edit')")
|
|
|
@PutMapping("/sort/{newId}/{oldId}")
|
|
|
public Result<?> sort(@PathVariable String newId, @PathVariable String oldId) {
|
|
|
flowGroupService.sort(newId,oldId);
|