|
@@ -0,0 +1,52 @@
|
|
|
|
+package com.fdkankan.manage.service.impl;
|
|
|
|
+
|
|
|
|
+import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
|
+import com.fdkankan.common.exception.BusinessException;
|
|
|
|
+import com.fdkankan.common.response.PageInfo;
|
|
|
|
+import com.fdkankan.manage.entity.BuryPoint;
|
|
|
|
+import com.fdkankan.manage.mapper.IBuryPointMapper;
|
|
|
|
+import com.fdkankan.manage.service.IBuryPointService;
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.fdkankan.manage.vo.request.BuryPointListParam;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.util.UUID;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * <p>
|
|
|
|
+ * 服务实现类
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @author
|
|
|
|
+ * @since 2022-09-23
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class BuryPointServiceImpl extends ServiceImpl<IBuryPointMapper, BuryPoint> implements IBuryPointService {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public PageInfo pageList(BuryPointListParam param) {
|
|
|
|
+ LambdaQueryWrapper<BuryPoint> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ if(StringUtils.isNotBlank(param.getApplicationName())){
|
|
|
|
+ wrapper.like(BuryPoint::getApplicationName,param.getApplicationName());
|
|
|
|
+ }
|
|
|
|
+ wrapper.orderByDesc(BuryPoint::getCreateTime);
|
|
|
|
+ Page<BuryPoint> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
|
|
|
|
+
|
|
|
|
+ return PageInfo.PageInfo(page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void add(BuryPoint buryPoint) {
|
|
|
|
+ if(StringUtils.isNotBlank(buryPoint.getApplicationName())){
|
|
|
|
+ throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
|
|
+ BuryPoint newBuryPoint = new BuryPoint();
|
|
|
|
+ newBuryPoint.setApplicationName(buryPoint.getApplicationName());
|
|
|
|
+ newBuryPoint.setApplicationKey(UUID.randomUUID().toString().replace("_",""));
|
|
|
|
+ this.save(newBuryPoint);
|
|
|
|
+ }
|
|
|
|
+}
|