Просмотр исходного кода

禁用 UploadChannel 的删除接口

reghao 2 лет назад
Родитель
Сommit
8fb2b1def6

+ 0 - 7
oss-console/src/main/java/cn/reghao/oss/console/app/controller/page/UploadChannelController.java

@@ -39,11 +39,4 @@ public class UploadChannelController {
         uploadChannelService.updateScope(channelScopeDto);
         uploadChannelService.updateScope(channelScopeDto);
         return WebResult.success();
         return WebResult.success();
     }
     }
-
-    @ApiOperation(value = "删除上传通道")
-    @DeleteMapping(value = "/delete/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
-    public String deleteUploadChannel(@PathVariable("id") Integer id) {
-        uploadChannelService.deleteChannel(id);
-        return WebResult.success("not implement");
-    }
 }
 }

+ 2 - 5
oss-console/src/main/java/cn/reghao/oss/console/app/service/UploadChannelService.java

@@ -46,7 +46,8 @@ public class UploadChannelService {
             return Result.fail(String.format("store_node with id %s not exist", nodeId));
             return Result.fail(String.format("store_node with id %s not exist", nodeId));
         }
         }
 
 
-        int createBy = UserContext.getUser().getId();
+        //int createBy = UserContext.getUser().getId();
+        int createBy = 410;
         String channelPrefix = uploadChannelDto.getChannelPrefix();
         String channelPrefix = uploadChannelDto.getChannelPrefix();
         UploadChannel uploadChannel = uploadChannelRepository.findByPrefixAndCreateByAndNodeId(channelPrefix, createBy, nodeId);
         UploadChannel uploadChannel = uploadChannelRepository.findByPrefixAndCreateByAndNodeId(channelPrefix, createBy, nodeId);
         if (uploadChannel != null) {
         if (uploadChannel != null) {
@@ -97,10 +98,6 @@ public class UploadChannelService {
         }
         }
     }
     }
 
 
-    public void deleteChannel(int id) {
-        uploadChannelRepository.findById(id).ifPresent(uploadChannelRepository::delete);
-    }
-
     public Page<UploadChannelVo> getUploadChannels(PageRequest pageRequest) {
     public Page<UploadChannelVo> getUploadChannels(PageRequest pageRequest) {
         int loginUser = UserContext.getUser().getId();
         int loginUser = UserContext.getUser().getId();
         Page<UploadChannel> page = uploadChannelRepository.findByCreateBy(loginUser, pageRequest);
         Page<UploadChannel> page = uploadChannelRepository.findByCreateBy(loginUser, pageRequest);

+ 4 - 3
oss-console/src/main/resources/templates/channel/index.html

@@ -56,13 +56,14 @@
                     <td th:text="${item.maxSize}">最大文件</td>
                     <td th:text="${item.maxSize}">最大文件</td>
                     <td th:text="${item.fileType}">文件类型</td>
                     <td th:text="${item.fileType}">文件类型</td>
                     <td th:text="${item.processFile}">文件类型</td>
                     <td th:text="${item.processFile}">文件类型</td>
-                    <td th:text="${item.scope}">可见范围</td>
+                    <td>
+                        <a class="open-popup" data-title="修改 channel 可见范围" th:attr="data-url=@{'/store/channel/edit/'+${item.id}}"
+                           data-size="640,480" href="#" th:text="${item.scope}"></a>
+                    </td>
                     <td th:text="${item.bindDomain}">绑定域名</td>
                     <td th:text="${item.bindDomain}">绑定域名</td>
                     <td>
                     <td>
                         <a class="open-popup" data-title="修改 channel 可见范围" th:attr="data-url=@{'/store/channel/edit/'+${item.id}}"
                         <a class="open-popup" data-title="修改 channel 可见范围" th:attr="data-url=@{'/store/channel/edit/'+${item.id}}"
                            data-size="640,480" href="#">编辑</a>
                            data-size="640,480" href="#">编辑</a>
-                        <a class="ajax-delete" th:attr="data-msg='确定要删除 '+ ${item.name}"
-                           th:href="@{'/api/store/channel/delete/' + ${item.id}}">删除</a>
                     </td>
                     </td>
                 </tr>
                 </tr>
                 </tbody>
                 </tbody>