Ver Fonte

完成运营商管理基础功能开发

liyuntian há 10 meses atrás
pai
commit
2772a3acee

+ 7 - 0
mcp/src/main/java/com/chuanxia/mcp/controller/CdnOperatorController.java

@@ -56,4 +56,11 @@ public class CdnOperatorController {
         return operatorService.listPage(queryDto);
     }
 
+    @GetMapping("removeBind")
+    @ApiOperation("删除某一条绑定运营商记录")
+    @Login
+    public Result removeBind(@RequestParam("id") Integer id) {
+        return operatorService.removeBind(id);
+    }
+
 }

+ 2 - 0
mcp/src/main/java/com/chuanxia/mcp/service/CdnOperatorService.java

@@ -14,4 +14,6 @@ public interface CdnOperatorService extends IService<CdnOperator> {
     Result bindCdn(DomainOperatorBindDto bindDto);
 
     Result listPage(OperatorQueryDto queryDto);
+
+    Result removeBind(Integer id);
 }

+ 10 - 1
mcp/src/main/java/com/chuanxia/mcp/service/impl/CdnOperatorServiceImpl.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.chuanxia.mcp.bean.dto.DomainBindDto;
 import com.chuanxia.mcp.bean.dto.DomainOperatorBindDto;
 import com.chuanxia.mcp.bean.dto.OperatorQueryDto;
 import com.chuanxia.mcp.bean.model.CdnDomain;
@@ -29,6 +28,9 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * @author Administrator
+ */
 @Service
 @Slf4j
 @RequiredArgsConstructor
@@ -89,4 +91,11 @@ public class CdnOperatorServiceImpl extends ServiceImpl<CdnOperatorMapper, CdnOp
         page = domainOperatorService.listPage(page, queryDto);
         return Result.success(page);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Result removeBind(Integer id) {
+        domainOperatorService.removeById(id);
+        return Result.success();
+    }
 }