Преглед изворни кода

feat : 用户和订单的同步逻辑

bilingfeng пре 1 година
родитељ
комит
0213b8deb7

+ 5 - 0
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/pojo/dto/PlatformDeYangOrderDTO.java

@@ -81,4 +81,9 @@ public class PlatformDeYangOrderDTO {
      * 游戏名称
      */
     private String gameName;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
 }

+ 5 - 0
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/pojo/dto/PlatformDeYangUserDTO.java

@@ -96,4 +96,9 @@ public class PlatformDeYangUserDTO {
      * 趣程标识
      */
     private String quChengSign;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
 }

+ 0 - 6
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/pojo/entity/PlatformDeYangOrder.java

@@ -10,7 +10,6 @@ import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
 import java.time.LocalDateTime;
-import java.util.Date;
 
 /**
  * @author : lingfeng
@@ -97,11 +96,6 @@ public class PlatformDeYangOrder implements Serializable {
      */
     private String gameName;
 
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
-
     /**
      * 更新时间
      */

+ 0 - 5
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/pojo/entity/PlatformDeYangUser.java

@@ -111,11 +111,6 @@ public class PlatformDeYangUser implements Serializable {
      */
     private String quChengSign;
 
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
-
     /**
      * 更新时间
      */

+ 9 - 0
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/service/IPlatformDeYangOrderService.java

@@ -1,6 +1,7 @@
 package com.zanxiang.game.platform.serve.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.platform.serve.pojo.dto.PlatformDeYangOrderDTO;
 import com.zanxiang.game.platform.serve.pojo.entity.PlatformDeYangOrder;
 
 /**
@@ -9,4 +10,12 @@ import com.zanxiang.game.platform.serve.pojo.entity.PlatformDeYangOrder;
  * @description :
  */
 public interface IPlatformDeYangOrderService extends IService<PlatformDeYangOrder> {
+
+    /**
+     * 添加或更新
+     *
+     * @param orderDTO 订单dto
+     * @return {@link Boolean}
+     */
+    Boolean addOrUpdate(PlatformDeYangOrderDTO orderDTO);
 }

+ 9 - 0
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/service/IPlatformDeYangUserService.java

@@ -1,6 +1,7 @@
 package com.zanxiang.game.platform.serve.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.platform.serve.pojo.dto.PlatformDeYangUserDTO;
 import com.zanxiang.game.platform.serve.pojo.entity.PlatformDeYangUser;
 
 /**
@@ -9,4 +10,12 @@ import com.zanxiang.game.platform.serve.pojo.entity.PlatformDeYangUser;
  * @description : 德阳用户
  */
 public interface IPlatformDeYangUserService extends IService<PlatformDeYangUser> {
+
+    /**
+     * 添加或更新
+     *
+     * @param userDTO 用户dto
+     * @return {@link Boolean}
+     */
+    Boolean addOrUpdate(PlatformDeYangUserDTO userDTO);
 }

+ 7 - 0
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/service/impl/PlatformDeYangOrderServiceImpl.java

@@ -2,8 +2,10 @@ package com.zanxiang.game.platform.serve.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.platform.serve.dao.mapper.PlatformDeYangOrderMapper;
+import com.zanxiang.game.platform.serve.pojo.dto.PlatformDeYangOrderDTO;
 import com.zanxiang.game.platform.serve.pojo.entity.PlatformDeYangOrder;
 import com.zanxiang.game.platform.serve.service.IPlatformDeYangOrderService;
+import com.zanxiang.module.util.bean.BeanUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -15,4 +17,9 @@ import org.springframework.stereotype.Service;
 @Slf4j
 @Service
 public class PlatformDeYangOrderServiceImpl extends ServiceImpl<PlatformDeYangOrderMapper, PlatformDeYangOrder> implements IPlatformDeYangOrderService {
+
+    @Override
+    public Boolean addOrUpdate(PlatformDeYangOrderDTO orderDTO) {
+        return super.saveOrUpdate(BeanUtil.copy(orderDTO, PlatformDeYangOrder.class));
+    }
 }

+ 7 - 0
game-platform/game-platform-serve/src/main/java/com/zanxiang/game/platform/serve/service/impl/PlatformDeYangUserServiceImpl.java

@@ -2,8 +2,10 @@ package com.zanxiang.game.platform.serve.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.platform.serve.dao.mapper.PlatformDeYangUserMapper;
+import com.zanxiang.game.platform.serve.pojo.dto.PlatformDeYangUserDTO;
 import com.zanxiang.game.platform.serve.pojo.entity.PlatformDeYangUser;
 import com.zanxiang.game.platform.serve.service.IPlatformDeYangUserService;
+import com.zanxiang.module.util.bean.BeanUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -15,4 +17,9 @@ import org.springframework.stereotype.Service;
 @Slf4j
 @Service
 public class PlatformDeYangUserServiceImpl extends ServiceImpl<PlatformDeYangUserMapper, PlatformDeYangUser> implements IPlatformDeYangUserService {
+
+    @Override
+    public Boolean addOrUpdate(PlatformDeYangUserDTO userDTO) {
+        return super.saveOrUpdate(BeanUtil.copy(userDTO, PlatformDeYangUser.class));
+    }
 }