|
@@ -1,8 +1,5 @@
|
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.chelvc.cloud.vehicle.api.constant.CategoryType;
|
|
@@ -10,11 +7,7 @@ import com.chelvc.cloud.vehicle.api.constant.MerchantStatus;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.GoodsDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantDetailDTO;
|
|
|
-import com.chelvc.cloud.vehicle.api.param.GoodsQueryParam;
|
|
|
-import com.chelvc.cloud.vehicle.api.param.LocationQueryParam;
|
|
|
-import com.chelvc.cloud.vehicle.api.param.MerchantModifyParam;
|
|
|
-import com.chelvc.cloud.vehicle.api.param.MerchantPagingParam;
|
|
|
-import com.chelvc.cloud.vehicle.api.param.MerchantQueryParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.*;
|
|
|
import com.chelvc.cloud.vehicle.server.copier.MerchantCopier;
|
|
|
import com.chelvc.cloud.vehicle.server.dao.MerchantMapper;
|
|
|
import com.chelvc.cloud.vehicle.server.entity.Merchant;
|
|
@@ -29,6 +22,9 @@ import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
/**
|
|
|
* 商家业务操作实现
|
|
|
*
|
|
@@ -128,4 +124,20 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|
|
.orderByDesc(Merchant::getCreateTime).page(PagingUtils.convert(param.getPaging()));
|
|
|
return PagingUtils.convert(page, MerchantCopier.INSTANCE::copying);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public MerchantDTO getMerchant(@NonNull Long id) {
|
|
|
+ Merchant merchant = ResourceUtils.required(this.getById(id), "商家不存在");
|
|
|
+ return this.convert(merchant);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 转换商家信息
|
|
|
+ *
|
|
|
+ * @param merchant 商家实例
|
|
|
+ * @return 商家信息
|
|
|
+ */
|
|
|
+ private MerchantDTO convert(Merchant merchant) {
|
|
|
+ return MerchantCopier.INSTANCE.copying(merchant);
|
|
|
+ }
|
|
|
}
|