Forráskód Böngészése

完成运营商-域名绑定基础功能开发

liyuntian 10 hónapja
szülő
commit
da55c63058

+ 2 - 0
mcp/src/main/java/com/chuanxia/mcp/bean/dto/OperatorQueryDto.java

@@ -6,4 +6,6 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = true)
 @Data
 public class OperatorQueryDto extends PageQueryBaseDto {
+    private String operatorName;
+    private String domain;
 }

+ 27 - 0
mcp/src/main/java/com/chuanxia/mcp/bean/vo/CdnOperatorVo.java

@@ -0,0 +1,27 @@
+package com.chuanxia.mcp.bean.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel("运营商-域名实体")
+public class CdnOperatorVo {
+    @ApiModelProperty("主键")
+    private Integer id;
+    @ApiModelProperty("运营商id")
+    private Integer operatorId;
+
+    @ApiModelProperty("运营商名称")
+    private String operatorName;
+    @ApiModelProperty("域名")
+    private String domain;
+    @ApiModelProperty("域名id")
+    private Integer domainId;
+    @ApiModelProperty("创建人id")
+    private Integer createBy;
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+}

+ 5 - 0
mcp/src/main/java/com/chuanxia/mcp/mapper/CdnDomainOperatorMapper.java

@@ -1,9 +1,14 @@
 package com.chuanxia.mcp.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.chuanxia.mcp.bean.dto.OperatorQueryDto;
 import com.chuanxia.mcp.bean.model.CdnDomainOperator;
+import com.chuanxia.mcp.bean.vo.CdnOperatorVo;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 @Repository
 public interface CdnDomainOperatorMapper extends BaseMapper<CdnDomainOperator> {
+    IPage<CdnOperatorVo> listPage(IPage<CdnOperatorVo> page, @Param("queryDto") OperatorQueryDto queryDto);
 }

+ 4 - 0
mcp/src/main/java/com/chuanxia/mcp/service/CdnDomainOperatorService.java

@@ -1,7 +1,11 @@
 package com.chuanxia.mcp.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.chuanxia.mcp.bean.dto.OperatorQueryDto;
 import com.chuanxia.mcp.bean.model.CdnDomainOperator;
+import com.chuanxia.mcp.bean.vo.CdnOperatorVo;
 
 public interface CdnDomainOperatorService extends IService<CdnDomainOperator> {
+    IPage<CdnOperatorVo> listPage(IPage<CdnOperatorVo> page, OperatorQueryDto queryDto);
 }

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

@@ -10,7 +10,7 @@ import com.chuanxia.mcp.bean.vo.Result;
 import com.chuanxia.mcp.mapper.CdnDomainCityMapper;
 import com.chuanxia.mcp.service.CdnDomainCityService;
 import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
+import lombok.extern. slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 @Service

+ 9 - 0
mcp/src/main/java/com/chuanxia/mcp/service/impl/CdnDomainOperatorServiceImpl.java

@@ -1,7 +1,10 @@
 package com.chuanxia.mcp.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chuanxia.mcp.bean.dto.OperatorQueryDto;
 import com.chuanxia.mcp.bean.model.CdnDomainOperator;
+import com.chuanxia.mcp.bean.vo.CdnOperatorVo;
 import com.chuanxia.mcp.mapper.CdnDomainOperatorMapper;
 import com.chuanxia.mcp.service.CdnDomainOperatorService;
 import lombok.RequiredArgsConstructor;
@@ -12,4 +15,10 @@ import org.springframework.stereotype.Service;
 @RequiredArgsConstructor
 @Slf4j
 public class CdnDomainOperatorServiceImpl extends ServiceImpl<CdnDomainOperatorMapper, CdnDomainOperator> implements CdnDomainOperatorService {
+    private final CdnDomainOperatorMapper domainOperatorMapper;
+
+    @Override
+    public IPage<CdnOperatorVo> listPage(IPage<CdnOperatorVo> page, OperatorQueryDto queryDto) {
+        return domainOperatorMapper.listPage(page,queryDto);
+    }
 }

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

@@ -2,7 +2,9 @@ package com.chuanxia.mcp.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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;
@@ -11,6 +13,7 @@ import com.chuanxia.mcp.bean.model.CdnDomain;
 import com.chuanxia.mcp.bean.model.CdnDomainOperator;
 import com.chuanxia.mcp.bean.model.CdnOperator;
 import com.chuanxia.mcp.bean.model.SystemUser;
+import com.chuanxia.mcp.bean.vo.CdnOperatorVo;
 import com.chuanxia.mcp.bean.vo.Result;
 import com.chuanxia.mcp.exception.ResultException;
 import com.chuanxia.mcp.mapper.CdnDomainMapper;
@@ -82,6 +85,8 @@ public class CdnOperatorServiceImpl extends ServiceImpl<CdnOperatorMapper, CdnOp
 
     @Override
     public Result listPage(OperatorQueryDto queryDto) {
-        return null;
+        IPage<CdnOperatorVo> page = new Page<>(queryDto.getPageSize(), queryDto.getPageNum());
+        page = domainOperatorService.listPage(page, queryDto);
+        return Result.success(page);
     }
 }

+ 28 - 0
mcp/src/main/resources/com/chuanxia/mcp/mapper/CdnDomainOperatorMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC
+        "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.chuanxia.mcp.mapper.CdnDomainOperatorMapper">
+    <select id="listPage" resultType="com.chuanxia.mcp.bean.vo.CdnOperatorVo">
+        SELECT
+        cdo.`id`,
+        cdo.`domain_id` AS domainId,
+        cdo.`operator_id` AS operatorId,
+        co.`operator_name` AS operatorName,
+        cd.`domain`,
+        cdo.`create_by` AS createBy,
+        cdo.`create_time` AS createTime
+        FROM
+        `cdn_domain_operator` cdo
+        LEFT JOIN `cdn_operator` co
+        ON cdo.`operator_id` = co.`id`
+        LEFT JOIN `cdn_domain` cd
+        ON cdo.`domain_id` = cd.`id`
+        <if test="queryDto.operatorName != null and queryDto.operatorName!='' ">
+        and co.operator_name = #{queryDto.operatorName}
+        </if>
+        <if test="queryDto.domain != null and queryDto.domain!='' ">
+            and cd.domain = #{queryDto.domain}
+        </if>
+    </select>
+</mapper>