Sfoglia il codice sorgente

Merge branch 'dev-meta' of xiongzhu/raex_back into master

sunkean 3 anni fa
parent
commit
9170333056

+ 33 - 3
src/main/java/com/izouma/nineth/domain/MetaAwardDrop.java

@@ -1,16 +1,18 @@
 package com.izouma.nineth.domain;
 package com.izouma.nineth.domain;
 
 
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.izouma.nineth.dto.MetaServiceResult;
 import com.izouma.nineth.enums.MetaAwardTypeEnum;
 import com.izouma.nineth.enums.MetaAwardTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+import jodd.util.StringUtil;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
 
 
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
+import javax.persistence.*;
+import java.time.LocalDateTime;
+import java.util.Objects;
 
 
 @Data
 @Data
 @AllArgsConstructor
 @AllArgsConstructor
@@ -19,6 +21,18 @@ import javax.persistence.Enumerated;
 @ApiModel("元宇宙奖励空投记录")
 @ApiModel("元宇宙奖励空投记录")
 public class MetaAwardDrop extends BaseEntity {
 public class MetaAwardDrop extends BaseEntity {
 
 
+    @ApiModelProperty("操作人")
+    @ExcelProperty("操作人")
+    private String operator;
+
+    @ApiModelProperty("操作时间")
+    @ExcelProperty("操作时间")
+    private LocalDateTime operatingTime;
+
+    @ApiModelProperty("备注说明")
+    @ExcelProperty("备注说明")
+    private String remark;
+
     @ApiModelProperty("奖励类型")
     @ApiModelProperty("奖励类型")
     @ExcelProperty("奖励类型")
     @ExcelProperty("奖励类型")
     @Enumerated(EnumType.STRING)
     @Enumerated(EnumType.STRING)
@@ -27,4 +41,20 @@ public class MetaAwardDrop extends BaseEntity {
     @ApiModelProperty("文件地址")
     @ApiModelProperty("文件地址")
     @ExcelProperty("文件地址")
     @ExcelProperty("文件地址")
     private String fileUrl;
     private String fileUrl;
+
+    public static MetaServiceResult checkMetaAtomTask(MetaAwardDrop metaAwardDrop) {
+        if (Objects.isNull(metaAwardDrop)) {
+            return MetaServiceResult.returnError("Illegal parameter : params can not be null");
+        }
+        if (Objects.isNull(metaAwardDrop.getAwardType())) {
+            return MetaServiceResult.returnError("Illegal parameter : awardType can not be null");
+        }
+        if (StringUtil.isBlank(metaAwardDrop.getRemark())) {
+            return MetaServiceResult.returnError("Illegal parameter : remark can not be null");
+        }
+        if (StringUtil.isBlank(metaAwardDrop.getFileUrl())) {
+            return MetaServiceResult.returnError("Illegal parameter : file can not be null");
+        }
+        return MetaServiceResult.returnSuccess();
+    }
 }
 }

+ 6 - 1
src/main/java/com/izouma/nineth/domain/MetaUserPropRecord.java

@@ -57,7 +57,11 @@ public class MetaUserPropRecord extends BaseEntity {
     @ExcelProperty("操作道具数量")
     @ExcelProperty("操作道具数量")
     private int num;
     private int num;
 
 
-    public static MetaUserPropRecord create(Long userId, MetaProp metaProp, MetaPropOperationType operationType, int num) {
+    @ApiModelProperty("备注")
+    @ExcelProperty("备注")
+    private String remark;
+
+    public static MetaUserPropRecord create(Long userId, MetaProp metaProp, MetaPropOperationType operationType, int num, String remark) {
         return MetaUserPropRecord.builder()
         return MetaUserPropRecord.builder()
                 .userId(userId)
                 .userId(userId)
                 .metaPropId(metaProp.getId())
                 .metaPropId(metaProp.getId())
@@ -67,6 +71,7 @@ public class MetaUserPropRecord extends BaseEntity {
                 .operatingTime(LocalDateTime.now())
                 .operatingTime(LocalDateTime.now())
                 .usedType(metaProp.getUsedType())
                 .usedType(metaProp.getUsedType())
                 .num(num)
                 .num(num)
+                .remark(remark)
                 .build();
                 .build();
     }
     }
 }
 }

+ 8 - 0
src/main/java/com/izouma/nineth/repo/MetaAwardDropRepo.java

@@ -0,0 +1,8 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.MetaAwardDrop;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+public interface MetaAwardDropRepo extends JpaRepository<MetaAwardDrop, Long>, JpaSpecificationExecutor<MetaAwardDrop> {
+}

+ 101 - 0
src/main/java/com/izouma/nineth/service/MetaAwardDropService.java

@@ -0,0 +1,101 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.config.AliyunProperties;
+import com.izouma.nineth.config.Constants;
+import com.izouma.nineth.domain.MetaAwardDrop;
+import com.izouma.nineth.dto.MetaAwardDropJsonDTO;
+import com.izouma.nineth.dto.MetaRestResult;
+import com.izouma.nineth.dto.MetaServiceResult;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.enums.MetaPropOperationType;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.MetaAwardDropRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import com.izouma.nineth.utils.OSSClientUtil;
+import com.izouma.nineth.utils.SecurityUtils;
+import lombok.AllArgsConstructor;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.function.BiFunction;
+
+@Service
+@AllArgsConstructor
+public class MetaAwardDropService {
+
+    private AliyunProperties    aliyunProperties;
+    private MetaAwardDropRepo   metaAwardDropRepo;
+    private MetaUserGoldService metaUserGoldService;
+    private MetaUserPropService metaUserPropService;
+
+    public Page<MetaAwardDrop> all(PageQuery pageQuery) {
+        return metaAwardDropRepo.findAll(JpaUtils.toSpecification(pageQuery, MetaAwardDrop.class), JpaUtils.toPageRequest(pageQuery));
+    }
+
+    @Transactional
+    public MetaAwardDrop save(MetaAwardDrop record) {
+        MetaServiceResult result = MetaAwardDrop.checkMetaAtomTask(record);
+        if (!result.isSuccess()) {
+            throw new BusinessException(result.getMessage());
+        }
+        String operator = SecurityUtils.getAuthenticatedUser().getNickname().concat("(").concat(SecurityUtils.getAuthenticatedUser().getId().toString()).concat(")");
+        record.setOperator(operator);
+        record.setOperatingTime(LocalDateTime.now());
+        MetaAwardDrop save = metaAwardDropRepo.save(record);
+        String s = "application";
+        String[] objectKeys = save.getFileUrl().split(s);
+        if (objectKeys.length != 2) {
+            throw new BusinessException("Illegal fileUrl");
+        }
+        List<MetaAwardDropJsonDTO> metaAwardDropJsonDTOS;
+        try {
+            metaAwardDropJsonDTOS = OSSClientUtil.getDataModel(aliyunProperties, s.concat(objectKeys[1]), MetaAwardDropJsonDTO.class);
+        } catch (IOException e) {
+            throw new BusinessException(e.getMessage());
+        }
+        if (CollectionUtils.isEmpty(metaAwardDropJsonDTOS)) {
+            throw new BusinessException("数据为空");
+        }
+        switch (record.getAwardType()) {
+            case GOLD:
+                dropGold(metaAwardDropJsonDTOS, save.getId());
+                break;
+            case META_PROP:
+                dropProp(metaAwardDropJsonDTOS, save.getId());
+                break;
+            default:
+                throw new BusinessException("不支持的奖励类型");
+        }
+        return save;
+    }
+
+    private void processDrop(List<MetaAwardDropJsonDTO> metaAwardDropJsonDTOS, Long dropId, BiFunction<MetaAwardDropJsonDTO, Long, MetaRestResult<?>> operation) {
+        metaAwardDropJsonDTOS.forEach(metaAwardDropJsonDTO -> {
+            MetaRestResult<?> restResult = operation.apply(metaAwardDropJsonDTO, dropId);
+            if (restResult.getCode() != Constants.MetaRestCode.success) {
+                throw new BusinessException(restResult.getMessage());
+            }
+        });
+    }
+
+    @Transactional
+    public void dropGold(List<MetaAwardDropJsonDTO> metaAwardDropJsonDTOS, Long dropId) {
+        processDrop(metaAwardDropJsonDTOS, dropId, (metaAwardDropJsonDTO, dId) -> {
+            String message = String.format("玩家[%S]于[%S]通过空投获得金币[%S]个,空投id[%S]", metaAwardDropJsonDTO.getUserId(), LocalDateTime.now(), metaAwardDropJsonDTO.getValue(), dId);
+            return metaUserGoldService.changeNum(metaAwardDropJsonDTO.getUserId(), metaAwardDropJsonDTO.getValue(), message);
+        });
+    }
+
+    @Transactional
+    public void dropProp(List<MetaAwardDropJsonDTO> metaAwardDropJsonDTOS, Long dropId) {
+        processDrop(metaAwardDropJsonDTOS, dropId, (metaAwardDropJsonDTO, dId) -> {
+            String message = String.format("玩家[%S]于[%S]通过空投获得道具[%S][%S]个,空投id[%S]", metaAwardDropJsonDTO.getUserId(), LocalDateTime.now(), metaAwardDropJsonDTO.getPropId(), metaAwardDropJsonDTO.getValue(), dId);
+            return metaUserPropService.operate(metaAwardDropJsonDTO.getUserId(), metaAwardDropJsonDTO.getPropId(), MetaPropOperationType.RECEIVE, metaAwardDropJsonDTO.getValue(), message);
+        });
+    }
+}

+ 4 - 2
src/main/java/com/izouma/nineth/service/MetaAwardReceiveService.java

@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.transaction.Transactional;
 import javax.transaction.Transactional;
+import java.time.LocalDateTime;
 import java.util.Objects;
 import java.util.Objects;
 
 
 @Service
 @Service
@@ -34,7 +35,7 @@ public class MetaAwardReceiveService {
                 MetaRestResult<MetaUserGold> restResult;
                 MetaRestResult<MetaUserGold> restResult;
                 try {
                 try {
                     int num = Integer.parseInt(metaAwardReceiveDTO.getConfig());
                     int num = Integer.parseInt(metaAwardReceiveDTO.getConfig());
-                    restResult = metaUserGoldService.changeNum(metaAwardReceiveDTO.getUserId(), num, String.format("玩家[%S]通过[%S]获得[%S]个金币", metaAwardReceiveDTO.getUserId(), metaAwardReceiveDTO.getRemark(), num));
+                    restResult = metaUserGoldService.changeNum(metaAwardReceiveDTO.getUserId(), num, String.format("玩家[%S]于[%S]通过[%S]获得[%S]个金币", metaAwardReceiveDTO.getUserId(), LocalDateTime.now(), metaAwardReceiveDTO.getRemark(), num));
                 } catch (Exception e) {
                 } catch (Exception e) {
                     return MetaServiceResult.returnError(String.format("金币奖励领取发生异常[%S]", e.getMessage()));
                     return MetaServiceResult.returnError(String.format("金币奖励领取发生异常[%S]", e.getMessage()));
                 }
                 }
@@ -49,7 +50,8 @@ public class MetaAwardReceiveService {
                 MetaRestResult<MetaUserProp> operate;
                 MetaRestResult<MetaUserProp> operate;
                 try {
                 try {
                     Long metaPropId = Long.parseLong(metaAwardReceiveDTO.getConfig());
                     Long metaPropId = Long.parseLong(metaAwardReceiveDTO.getConfig());
-                    operate = metaUserPropService.operate(metaAwardReceiveDTO.getUserId(), metaPropId, MetaPropOperationType.RECEIVE, 1);
+                    int num = 1;
+                    operate = metaUserPropService.operate(metaAwardReceiveDTO.getUserId(), metaPropId, MetaPropOperationType.RECEIVE, num, String.format("玩家[%S]于[%S]通过[%S]获得[%S]个道具", metaAwardReceiveDTO.getUserId(), LocalDateTime.now(), metaAwardReceiveDTO.getRemark(), num));
                 } catch (Exception e) {
                 } catch (Exception e) {
                     return MetaServiceResult.returnError(String.format("道具奖励领取发生异常[%S]", e.getMessage()));
                     return MetaServiceResult.returnError(String.format("道具奖励领取发生异常[%S]", e.getMessage()));
                 }
                 }

+ 11 - 8
src/main/java/com/izouma/nineth/service/MetaStoreService.java

@@ -69,28 +69,31 @@ public class MetaStoreService {
             return MetaRestResult.returnError("道具信息为空");
             return MetaRestResult.returnError("道具信息为空");
         }
         }
         MetaUserProp dbMetaUserProp = metaUserPropRepo.findByUserIdAndMetaPropIdAndDel(userId, metaProp.getId(), false);
         MetaUserProp dbMetaUserProp = metaUserPropRepo.findByUserIdAndMetaPropIdAndDel(userId, metaProp.getId(), false);
+        LocalDateTime now = LocalDateTime.now();
+        int num = 1;
+        String msg = String.format("玩家[%S]于[%S]使用[%S]个金币,购买[%S]个道具,道具id[%S]", userId, now, price, num, metaProp.getId());
         if (Objects.isNull(dbMetaUserProp)) {
         if (Objects.isNull(dbMetaUserProp)) {
-            dbMetaUserProp = MetaUserProp.create(userId, metaProp, 1);
-            MetaRestResult<MetaUserGold> restResult = metaUserGoldService.changeNum(userId, -price, String.format("购买道具:[%S],消耗金币[%s]", metaProp.getId(), price));
+            dbMetaUserProp = MetaUserProp.create(userId, metaProp, num);
+            MetaRestResult<MetaUserGold> restResult = metaUserGoldService.changeNum(userId, -price, msg);
             if (restResult.getCode() != Constants.MetaRestCode.success) {
             if (restResult.getCode() != Constants.MetaRestCode.success) {
                 return MetaRestResult.returnError(restResult.getMessage());
                 return MetaRestResult.returnError(restResult.getMessage());
             }
             }
             metaUserPropRepo.save(dbMetaUserProp);
             metaUserPropRepo.save(dbMetaUserProp);
-            metaUserPropRecordService.save(userId, metaProp, MetaPropOperationType.RECEIVE, 1);
-            metaStorePurchaseRecordRepo.save(new MetaStorePurchaseRecord(metaStore.getId(), userId, LocalDateTime.now()));
+            metaUserPropRecordService.save(userId, metaProp, MetaPropOperationType.RECEIVE, num, msg);
+            metaStorePurchaseRecordRepo.save(new MetaStorePurchaseRecord(metaStore.getId(), userId, now));
             return MetaRestResult.returnSuccess("购买成功!");
             return MetaRestResult.returnSuccess("购买成功!");
         }
         }
         if (MetaPropUsedType.PERMANENT.equals(metaProp.getUsedType()) && dbMetaUserProp.getNum() >= 1) {
         if (MetaPropUsedType.PERMANENT.equals(metaProp.getUsedType()) && dbMetaUserProp.getNum() >= 1) {
             return MetaRestResult.returnError("已拥有永久道具,不可购买");
             return MetaRestResult.returnError("已拥有永久道具,不可购买");
         }
         }
-        MetaRestResult<MetaUserGold> restResult = metaUserGoldService.changeNum(userId, -price, String.format("购买道具:[%S],消耗金币[%s]", metaProp.getId(), price));
+        MetaRestResult<MetaUserGold> restResult = metaUserGoldService.changeNum(userId, -price, msg);
         if (restResult.getCode() != Constants.MetaRestCode.success) {
         if (restResult.getCode() != Constants.MetaRestCode.success) {
             return MetaRestResult.returnError(restResult.getMessage());
             return MetaRestResult.returnError(restResult.getMessage());
         }
         }
-        dbMetaUserProp.setNum(dbMetaUserProp.getNum() + 1);
+        dbMetaUserProp.setNum(dbMetaUserProp.getNum() + num);
         metaUserPropRepo.save(dbMetaUserProp);
         metaUserPropRepo.save(dbMetaUserProp);
-        metaUserPropRecordService.save(userId, metaProp, MetaPropOperationType.RECEIVE, 1);
-        metaStorePurchaseRecordRepo.save(new MetaStorePurchaseRecord(metaStore.getId(), userId, LocalDateTime.now()));
+        metaUserPropRecordService.save(userId, metaProp, MetaPropOperationType.RECEIVE, num, msg);
+        metaStorePurchaseRecordRepo.save(new MetaStorePurchaseRecord(metaStore.getId(), userId, now));
         return MetaRestResult.returnSuccess("购买成功!");
         return MetaRestResult.returnSuccess("购买成功!");
 
 
     }
     }

+ 2 - 2
src/main/java/com/izouma/nineth/service/MetaUserPropRecordService.java

@@ -20,8 +20,8 @@ public class MetaUserPropRecordService {
         return metaUserPropRecordRepo.findAll(JpaUtils.toSpecification(pageQuery, MetaUserPropRecord.class), JpaUtils.toPageRequest(pageQuery));
         return metaUserPropRecordRepo.findAll(JpaUtils.toSpecification(pageQuery, MetaUserPropRecord.class), JpaUtils.toPageRequest(pageQuery));
     }
     }
 
 
-    public MetaUserPropRecord save(Long userId, MetaProp metaProp, MetaPropOperationType operationType, int num) {
-        MetaUserPropRecord metaUserPropRecord = MetaUserPropRecord.create(userId, metaProp, operationType, num);
+    public MetaUserPropRecord save(Long userId, MetaProp metaProp, MetaPropOperationType operationType, int num, String remark) {
+        MetaUserPropRecord metaUserPropRecord = MetaUserPropRecord.create(userId, metaProp, operationType, num, remark);
         return metaUserPropRecordRepo.save(metaUserPropRecord);
         return metaUserPropRecordRepo.save(metaUserPropRecord);
     }
     }
 }
 }

+ 17 - 13
src/main/java/com/izouma/nineth/service/MetaUserPropService.java

@@ -14,6 +14,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.transaction.Transactional;
 import javax.transaction.Transactional;
+import java.time.LocalDateTime;
 import java.util.Objects;
 import java.util.Objects;
 
 
 @Service
 @Service
@@ -30,7 +31,7 @@ public class MetaUserPropService {
     }
     }
 
 
     @Transactional
     @Transactional
-    public MetaRestResult<MetaUserProp> operate(Long userId, Long metaPropId, MetaPropOperationType operationType, int num) {
+    public MetaRestResult<MetaUserProp> operate(Long userId, Long metaPropId, MetaPropOperationType operationType, int num, String remark) {
         if (Objects.isNull(metaPropId)) {
         if (Objects.isNull(metaPropId)) {
             return MetaRestResult.returnError("Illegal parameter : metaPropId can not be null");
             return MetaRestResult.returnError("Illegal parameter : metaPropId can not be null");
         }
         }
@@ -43,12 +44,12 @@ public class MetaUserPropService {
             if (num < 1) {
             if (num < 1) {
                 return MetaRestResult.returnError("道具数量最少为1");
                 return MetaRestResult.returnError("道具数量最少为1");
             }
             }
-            return receive(userId, dbMetaUserProp, metaProp, num);
+            return receive(userId, dbMetaUserProp, metaProp, num, remark);
         }
         }
         if (MetaPropOperationType.CANCEL_USE.equals(operationType)) {
         if (MetaPropOperationType.CANCEL_USE.equals(operationType)) {
-            return cancelUse(dbMetaUserProp, metaProp);
+            return cancelUse(dbMetaUserProp, metaProp, remark);
         }
         }
-        return use(dbMetaUserProp, metaProp);
+        return use(dbMetaUserProp, metaProp, remark);
     }
     }
 
 
     /**
     /**
@@ -59,7 +60,7 @@ public class MetaUserPropService {
      * @return
      * @return
      */
      */
     @Transactional
     @Transactional
-    public MetaRestResult<MetaUserProp> cancelUse(MetaUserProp metaUserProp, MetaProp metaProp) {
+    public MetaRestResult<MetaUserProp> cancelUse(MetaUserProp metaUserProp, MetaProp metaProp, String remark) {
         if (Objects.isNull(metaUserProp)) {
         if (Objects.isNull(metaUserProp)) {
             return MetaRestResult.returnError("玩家未拥有该道具!");
             return MetaRestResult.returnError("玩家未拥有该道具!");
         }
         }
@@ -67,7 +68,8 @@ public class MetaUserPropService {
             return MetaRestResult.returnError("仅限永久道具才能取消使用!");
             return MetaRestResult.returnError("仅限永久道具才能取消使用!");
         }
         }
         metaUserProp.setUsed(false);
         metaUserProp.setUsed(false);
-        metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.CANCEL_USE, 1);
+        int num = 1;
+        metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.CANCEL_USE, num, remark);
         return MetaRestResult.returnSuccess("取消使用成功", metaUserPropRepo.save(metaUserProp));
         return MetaRestResult.returnSuccess("取消使用成功", metaUserPropRepo.save(metaUserProp));
     }
     }
 
 
@@ -81,7 +83,7 @@ public class MetaUserPropService {
      * @return
      * @return
      */
      */
     @Transactional
     @Transactional
-    public MetaRestResult<MetaUserProp> receive(Long userId, MetaUserProp metaUserProp, MetaProp metaProp, int num) {
+    public MetaRestResult<MetaUserProp> receive(Long userId, MetaUserProp metaUserProp, MetaProp metaProp, int num, String remark) {
         boolean init = false;
         boolean init = false;
         if (Objects.isNull(metaUserProp)) {
         if (Objects.isNull(metaUserProp)) {
             metaUserProp = MetaUserProp.create(userId, metaProp, num);
             metaUserProp = MetaUserProp.create(userId, metaProp, num);
@@ -101,14 +103,14 @@ public class MetaUserPropService {
             // 未拥有该道具,领取一个,多余转化为金币
             // 未拥有该道具,领取一个,多余转化为金币
             if (init) {
             if (init) {
                 MetaUserProp save = metaUserPropRepo.save(metaUserProp);
                 MetaUserProp save = metaUserPropRepo.save(metaUserProp);
-                metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.RECEIVE, 1);
+                metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.RECEIVE, 1, remark);
                 return MetaRestResult.returnSuccess(String.format("永久道具仅限持有一个,多余道具将转化为[%S]个金币!", goldNum), save);
                 return MetaRestResult.returnSuccess(String.format("永久道具仅限持有一个,多余道具将转化为[%S]个金币!", goldNum), save);
             }
             }
             // 已拥有该道具,全部转为道具后返回
             // 已拥有该道具,全部转为道具后返回
             return MetaRestResult.returnSuccess(String.format("玩家已拥有该道具,所领取的道具将转化为[%S]个金币!", goldNum));
             return MetaRestResult.returnSuccess(String.format("玩家已拥有该道具,所领取的道具将转化为[%S]个金币!", goldNum));
         }
         }
         MetaUserProp save = metaUserPropRepo.save(metaUserProp);
         MetaUserProp save = metaUserPropRepo.save(metaUserProp);
-        metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.RECEIVE, num);
+        metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.RECEIVE, num, remark);
         return MetaRestResult.returnSuccess("道具领取成功!", save);
         return MetaRestResult.returnSuccess("道具领取成功!", save);
 
 
     }
     }
@@ -121,26 +123,28 @@ public class MetaUserPropService {
      * @return
      * @return
      */
      */
     @Transactional
     @Transactional
-    public MetaRestResult<MetaUserProp> use(MetaUserProp metaUserProp, MetaProp metaProp) {
+    public MetaRestResult<MetaUserProp> use(MetaUserProp metaUserProp, MetaProp metaProp, String remark) {
         if (Objects.isNull(metaUserProp)) {
         if (Objects.isNull(metaUserProp)) {
             return MetaRestResult.returnError("玩家未拥有该道具!");
             return MetaRestResult.returnError("玩家未拥有该道具!");
         }
         }
+        int num = 1;
+        String msg = String.format("玩家[%S]于[%S]使用道具[%S],数量[%S]", metaUserProp.getUserId(), LocalDateTime.now(), metaProp.getId(), num);
         // 永久道具 不对背包做操作,增加一条操作记录
         // 永久道具 不对背包做操作,增加一条操作记录
         if (MetaPropUsedType.PERMANENT.equals(metaProp.getUsedType())) {
         if (MetaPropUsedType.PERMANENT.equals(metaProp.getUsedType())) {
             metaUserProp.setUsed(true);
             metaUserProp.setUsed(true);
-            metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.USE, 1);
+            metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.USE, num, msg);
             return MetaRestResult.returnSuccess(metaUserPropRepo.save(metaUserProp));
             return MetaRestResult.returnSuccess(metaUserPropRepo.save(metaUserProp));
         }
         }
         // 数量为1的非永久道具,成功使用后直接删除背包中该道具数据,增加一条操作记录
         // 数量为1的非永久道具,成功使用后直接删除背包中该道具数据,增加一条操作记录
         if (1 == metaUserProp.getNum()) {
         if (1 == metaUserProp.getNum()) {
             metaUserProp.setNum(0);
             metaUserProp.setNum(0);
-            metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.USE, 1);
+            metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.USE, num, msg);
             metaUserPropRepo.deleteByUserIdAndMetaPropId(metaUserProp.getUserId(), metaProp.getId());
             metaUserPropRepo.deleteByUserIdAndMetaPropId(metaUserProp.getUserId(), metaProp.getId());
             return MetaRestResult.returnSuccess(metaUserProp);
             return MetaRestResult.returnSuccess(metaUserProp);
         }
         }
         // 数量大于1的非永久道具,背包中该道具数量减1,增加一条操作记录
         // 数量大于1的非永久道具,背包中该道具数量减1,增加一条操作记录
         metaUserProp.setNum(metaUserProp.getNum() - 1);
         metaUserProp.setNum(metaUserProp.getNum() - 1);
-        metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.USE, 1);
+        metaUserPropRecordService.save(metaUserProp.getUserId(), metaProp, MetaPropOperationType.USE, num, msg);
         return MetaRestResult.returnSuccess(metaUserPropRepo.save(metaUserProp));
         return MetaRestResult.returnSuccess(metaUserPropRepo.save(metaUserProp));
     }
     }
 
 

+ 14 - 7
src/main/java/com/izouma/nineth/service/UserService.java

@@ -141,21 +141,28 @@ public class UserService {
         return userRepo.save(user);
         return userRepo.save(user);
     }
     }
 
 
-    public User metaUpdate(Long userId, String nickname) {
-        if (StringUtils.isBlank(nickname)) {
-            throw new BusinessException("用户昵称为空");
+    public MetaRestResult<User> metaUpdate(User record) {
+        if (Objects.isNull(record)) {
+            return MetaRestResult.returnError("Illegal parameter : params can not be null");
         }
         }
-        User user = userRepo.findById(userId).orElse(null);
+        if (Objects.isNull(record.getId())) {
+            return MetaRestResult.returnError("Illegal parameter : userId can not be null");
+        }
+        if (StringUtils.isBlank(record.getNickname())) {
+            return MetaRestResult.returnError("Illegal parameter : nickname can not be null");
+        }
+        String nickname = record.getNickname();
+        User user = userRepo.findById(record.getId()).orElse(null);
         if (Objects.isNull(user)) {
         if (Objects.isNull(user)) {
-            throw new BusinessException("用户信息为空");
+            return MetaRestResult.returnError("用户信息为空");
         }
         }
         if (!nickname.equals(user.getNickname())) {
         if (!nickname.equals(user.getNickname())) {
             if (!contentAuditService.auditText(nickname)) {
             if (!contentAuditService.auditText(nickname)) {
-                throw new BusinessException("昵称包含非法内容");
+                return MetaRestResult.returnError("昵称包含非法内容");
             }
             }
         }
         }
         user.setNickname(nickname);
         user.setNickname(nickname);
-        return save(user);
+        return MetaRestResult.returnSuccess(save(user));
     }
     }
 
 
     public User update(Long userId, String nickname, String avatar, String sex, String bg, String intro,
     public User update(Long userId, String nickname, String avatar, String sex, String bg, String intro,

+ 48 - 0
src/main/java/com/izouma/nineth/utils/OSSClientUtil.java

@@ -0,0 +1,48 @@
+package com.izouma.nineth.utils;
+
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.OSSObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+import com.izouma.nineth.config.AliyunProperties;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+
+public class OSSClientUtil {
+
+    /**
+     * 通过阿里云OSSClient客户端读取指定objectKey的文件流,利用Jackson将文件流反序列化成List<T>类型的数据模型并返回。
+     *
+     * @param properties 用于配置阿里云OSS客户端的属性对象。
+     * @param objectKey  阿里云OSS存储桶中的文件对象的唯一标识符。
+     * @param clazz      要反序列化的目标类型。
+     * @return 返回反序列化后的List<T>类型数据模型。
+     * @throws IOException 当出现IO异常时,抛出IOException。
+     */
+    public static <T> List<T> getDataModel(AliyunProperties properties, String objectKey, Class<T> clazz) throws IOException {
+        // 从阿里云OSS客户端配置对象中获取必要的参数
+        String endpoint = properties.getOssEndPoint();
+        String accessKeyId = properties.getAccessKeyId();
+        String accessKeySecret = properties.getAccessKeySecret();
+        String bucketName = properties.getOssBucketName();
+        // 创建OSS客户端
+        OSSClient client = new OSSClient(endpoint, accessKeyId, accessKeySecret);
+        List<T> list;
+        // 获取指定文件对象的OSSObject对象
+        OSSObject ossObject = client.getObject(bucketName, objectKey);
+        // 创建Jackson的ObjectMapper对象用于反序列化操作
+        ObjectMapper objectMapper = new ObjectMapper();
+        // 将OSSObject对象中的文件流反序列化成List<T>类型的数据模型
+        try (InputStream inputStream = ossObject.getObjectContent()) {
+            list = objectMapper.readValue(inputStream, TypeFactory.defaultInstance().constructCollectionType(List.class, clazz));
+        } finally {
+            // 关闭OSS客户端
+            client.shutdown();
+        }
+        return list;
+    }
+
+}

+ 48 - 0
src/main/java/com/izouma/nineth/web/MetaAwardDropController.java

@@ -0,0 +1,48 @@
+package com.izouma.nineth.web;
+
+import com.izouma.nineth.domain.MetaAwardDrop;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.MetaAwardDropRepo;
+import com.izouma.nineth.service.MetaAwardDropService;
+import com.izouma.nineth.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/metaAwardDrop")
+@AllArgsConstructor
+public class MetaAwardDropController extends BaseController {
+    private MetaAwardDropService metaAwardDropService;
+    private MetaAwardDropRepo    metaAwardDropRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public MetaAwardDrop save(@RequestBody MetaAwardDrop record) {
+        return metaAwardDropService.save(record);
+    }
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<MetaAwardDrop> all(@RequestBody PageQuery pageQuery) {
+        return metaAwardDropService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public MetaAwardDrop get(@PathVariable Long id) {
+        return metaAwardDropRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<MetaAwardDrop> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

+ 12 - 3
src/main/java/com/izouma/nineth/web/MetaUserPropController.java

@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.List;
 import java.util.Objects;
 import java.util.Objects;
 
 
@@ -27,17 +28,25 @@ public class MetaUserPropController extends BaseController {
 
 
     @PostMapping("/receive")
     @PostMapping("/receive")
     public MetaRestResult<MetaUserProp> receive(Long metaPropId, int num) {
     public MetaRestResult<MetaUserProp> receive(Long metaPropId, int num) {
-        return metaUserPropService.operate(SecurityUtils.getAuthenticatedUser().getId(), metaPropId, MetaPropOperationType.RECEIVE, num);
+        Long userId = SecurityUtils.getAuthenticatedUser().getId();
+        String remark = String.format("玩家[%S]于[%S]通过协议/metaUserProp/receive获得[%S]个道具", userId, LocalDateTime.now(), num);
+        return metaUserPropService.operate(userId, metaPropId, MetaPropOperationType.RECEIVE, num, remark);
     }
     }
 
 
     @PostMapping("/cancelUser")
     @PostMapping("/cancelUser")
     public MetaRestResult<MetaUserProp> cancelUser(Long metaPropId) {
     public MetaRestResult<MetaUserProp> cancelUser(Long metaPropId) {
-        return metaUserPropService.operate(SecurityUtils.getAuthenticatedUser().getId(), metaPropId, MetaPropOperationType.CANCEL_USE, 1);
+        int num = 1;
+        Long userId = SecurityUtils.getAuthenticatedUser().getId();
+        String remark = String.format("玩家[%S]于[%S]通过协议/metaUserProp/cancelUser取消使用道具[%S],数量[%S]", userId, LocalDateTime.now(), metaPropId, num);
+        return metaUserPropService.operate(userId, metaPropId, MetaPropOperationType.CANCEL_USE, num, remark);
     }
     }
 
 
     @PostMapping("/use")
     @PostMapping("/use")
     public MetaRestResult<MetaUserProp> use(Long metaPropId) {
     public MetaRestResult<MetaUserProp> use(Long metaPropId) {
-        return metaUserPropService.operate(SecurityUtils.getAuthenticatedUser().getId(), metaPropId, MetaPropOperationType.USE, 1);
+        int num = 1;
+        Long userId = SecurityUtils.getAuthenticatedUser().getId();
+        String remark = String.format("玩家[%S]于[%S]通过协议/metaUserProp/use使用道具[%S],数量[%S]", userId, LocalDateTime.now(), metaPropId, num);
+        return metaUserPropService.operate(userId, metaPropId, MetaPropOperationType.USE, num, remark);
     }
     }
 
 
     //@PreAuthorize("hasRole('ADMIN')")
     //@PreAuthorize("hasRole('ADMIN')")

+ 15 - 13
src/main/java/com/izouma/nineth/web/UserController.java

@@ -48,22 +48,19 @@ public class UserController extends BaseController {
     private UserBankCardRepo              userBankCardRepo;
     private UserBankCardRepo              userBankCardRepo;
     private RedisTemplate<String, Object> redisTemplate;
     private RedisTemplate<String, Object> redisTemplate;
     private IdentityAuthRepo              identityAuthRepo;
     private IdentityAuthRepo              identityAuthRepo;
-
-    private TokenHistoryRepo tokenHistoryRepo;
-
-    private FollowRepo followRepo;
-
-    private CompanyRepo companyRepo;
+    private TokenHistoryRepo              tokenHistoryRepo;
+    private FollowRepo                    followRepo;
+    private CompanyRepo                   companyRepo;
 
 
     @PostMapping("/register")
     @PostMapping("/register")
     public User register(@RequestParam String username,
     public User register(@RequestParam String username,
                          @RequestParam String password) {
                          @RequestParam String password) {
         UserRegister user = UserRegister.builder()
         UserRegister user = UserRegister.builder()
-                .username(username)
-                .nickname(username)
-                .password(password)
-                .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
-                .build();
+                                        .username(username)
+                                        .nickname(username)
+                                        .password(password)
+                                        .authorities(Collections.singleton(Authority.get(AuthorityName.ROLE_USER)))
+                                        .build();
         return userService.create(user);
         return userService.create(user);
     }
     }
 
 
@@ -89,6 +86,11 @@ public class UserController extends BaseController {
                 nickname, avatar, sex, bg, intro, useCollectionPic, riskWarning, level, isPublicShow);
                 nickname, avatar, sex, bg, intro, useCollectionPic, riskWarning, level, isPublicShow);
     }
     }
 
 
+    @PostMapping("/metaUpdate")
+    public MetaRestResult<User> metaUpdate(@RequestBody User user) {
+        return userService.metaUpdate(user);
+    }
+
     @GetMapping("/my")
     @GetMapping("/my")
     public User my(@RequestParam(defaultValue = "false") boolean refresh) {
     public User my(@RequestParam(defaultValue = "false") boolean refresh) {
         if (refresh) {
         if (refresh) {
@@ -108,7 +110,7 @@ public class UserController extends BaseController {
     @PreAuthorize("hasRole('ADMIN')")
     @PreAuthorize("hasRole('ADMIN')")
     public User myAdmin() {
     public User myAdmin() {
         return userRepo.findById(SecurityUtils.getAuthenticatedUser().getId())
         return userRepo.findById(SecurityUtils.getAuthenticatedUser().getId())
-                .orElseThrow(new BusinessException("用户不存在"));
+                       .orElseThrow(new BusinessException("用户不存在"));
     }
     }
 
 
     @GetMapping("/myTrading")
     @GetMapping("/myTrading")
@@ -204,7 +206,7 @@ public class UserController extends BaseController {
     @GetMapping("/getToken/{userId}")
     @GetMapping("/getToken/{userId}")
     public String getToken(@PathVariable Long userId) {
     public String getToken(@PathVariable Long userId) {
         return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
         return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
-                .orElseThrow(new BusinessException("用户不存在"))));
+                                                                        .orElseThrow(new BusinessException("用户不存在"))));
     }
     }
 
 
     @PostMapping("/bindPhone")
     @PostMapping("/bindPhone")

+ 1 - 0
src/main/resources/genjson/MetaAwardDrop.json

@@ -0,0 +1 @@
+{"tableName":"MetaAwardDrop","className":"MetaAwardDrop","remark":"元宇宙奖励空投","genTable":true,"genClass":true,"genList":true,"genForm":true,"genRouter":true,"javaPath":"/Users/xiaohuoban/IdeaProjects/raex_back/src/main/java/com/izouma/nineth","viewPath":"/Users/xiaohuoban/IdeaProjects/raex_back/src/main/vue/src/views","routerPath":"/Users/xiaohuoban/IdeaProjects/raex_back/src/main/vue/src","resourcesPath":"/Users/xiaohuoban/IdeaProjects/raex_back/src/main/resources","dataBaseType":"Mysql","fields":[{"name":"awardType","modelName":"awardType","remark":"奖励类型","showInList":true,"showInForm":true,"formType":"select","apiFlag":"1","optionsValue":"[{\"label\":\"空\",\"value\":\"NULL\"},{\"label\":\"NFT\",\"value\":\"NFT\"},{\"label\":\"金币\",\"value\":\"GOLD\"},{\"label\":\"元宇宙道具\",\"value\":\"META_PROP\"}]"},{"name":"remark","modelName":"remark","remark":"备注说明","showInList":true,"showInForm":true,"formType":"textarea"},{"name":"fileUrl","modelName":"fileUrl","remark":"文件上传","showInList":true,"showInForm":true,"formType":"singleLineText"}],"readTable":false,"dataSourceCode":"dataSource","genJson":"","subtables":[],"update":false,"basePackage":"com.izouma.nineth","tablePackage":"com.izouma.nineth.domain.MetaAwardDrop"}

+ 16 - 0
src/main/vue/src/router.js

@@ -2077,6 +2077,22 @@ const router = new Router({
                     meta: {
                     meta: {
                        title: '物体移动配置',
                        title: '物体移动配置',
                     },
                     },
+               },
+                {
+                    path: '/metaAwardDropEdit',
+                    name: 'MetaAwardDropEdit',
+                    component: () => import(/* webpackChunkName: "metaAwardDropEdit" */ '@/views/MetaAwardDropEdit.vue'),
+                    meta: {
+                       title: '元宇宙奖励空投编辑',
+                    },
+                },
+                {
+                    path: '/metaAwardDropList',
+                    name: 'MetaAwardDropList',
+                    component: () => import(/* webpackChunkName: "metaAwardDropList" */ '@/views/MetaAwardDropList.vue'),
+                    meta: {
+                       title: '元宇宙奖励空投',
+                    },
                }
                }
                 /**INSERT_LOCATION**/
                 /**INSERT_LOCATION**/
             ]
             ]

+ 148 - 0
src/main/vue/src/views/MetaAwardDropEdit.vue

@@ -0,0 +1,148 @@
+<template>
+    <div class="edit-view">
+        <page-title>
+            <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+            <template v-if="canEdit">
+                <el-button @click="onSave" :loading="saving" type="primary">
+                    保存
+                </el-button>
+            </template>
+        </page-title>
+        <div class="edit-view__content-wrapper">
+            <div class="edit-view__content-section">
+                <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                    style="max-width: 500px;">
+                    <el-form-item prop="awardType" label="奖励类型">
+                        <el-select v-model="formData.awardType" clearable filterable placeholder="请选择" :disabled="!canEdit">
+                            <el-option v-for="item in awardTypeOptions" :key="item.value" :label="item.label"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item prop="remark" label="备注说明">
+                        <el-input type="textarea" v-model="formData.remark" :disabled="!canEdit"></el-input>
+                    </el-form-item>
+                    <el-form-item prop="fileUrl" label="文件上传" v-if="formData && formData.awardType === 'GOLD'">
+                        <file-upload v-model="formData.fileUrl" :limit="1"></file-upload>
+                        <div class="tip">金币奖励附件模板为:</div>
+                        <img width="50%" src="http://cdn.raex.vip/meta/gold.png" alt />
+                    </el-form-item>
+                    <el-form-item prop="fileUrl" label="文件上传" v-if="formData && formData.awardType === 'META_PROP'">
+                        <file-upload v-model="formData.fileUrl" :limit="1"></file-upload>
+                        <div class="tip">道具奖励附件模板为:</div>
+                        <img width="50%" src="http://cdn.raex.vip/meta/prop.png" alt />
+                    </el-form-item>
+                    <el-form-item class="form-submit">
+                        <template v-if="canEdit">
+                            <el-button @click="onSave" :loading="saving" type="primary">
+                                保存
+                            </el-button>
+                        </template>
+                        <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+	name: 'MetaAwardDropEdit',
+	created() {
+		if (this.$route.query.id) {
+			this.$http
+				.get('metaAwardDrop/get/' + this.$route.query.id)
+				.then(res => {
+					this.formData = res;
+				})
+				.catch(e => {
+					console.log(e);
+					this.$message.error(e.error);
+				});
+		}
+	},
+	computed: {
+		canEdit() {
+			return !!!this.$route.query.id;
+		}
+	},
+	data() {
+		return {
+			saving: false,
+			formData: {},
+			rules: {
+				awardType: [
+					{
+						required: true,
+						message: '请选择奖励类型',
+						trigger: 'blur'
+					}
+				],
+				remark: [
+					{
+						required: true,
+						message: '请输入备注',
+						trigger: 'blur'
+					}
+				],
+				fileUrl: [
+					{
+						required: true,
+						message: '请上传附件',
+						trigger: 'blur'
+					}
+				]
+			},
+			awardTypeOptions: [
+				{ label: '金币', value: 'GOLD' },
+				{ label: '道具', value: 'META_PROP' }
+			]
+		};
+	},
+	methods: {
+		onSave() {
+			this.$refs.form.validate(valid => {
+				if (valid) {
+					this.submit();
+				} else {
+					return false;
+				}
+			});
+		},
+		submit() {
+			let data = { ...this.formData };
+
+			this.saving = true;
+			this.$http
+				.post('/metaAwardDrop/save', data, { body: 'json' })
+				.then(res => {
+					this.saving = false;
+					this.$message.success('成功');
+					this.$router.go(-1);
+				})
+				.catch(e => {
+					console.log(e);
+					this.saving = false;
+					this.$message.error(e.error);
+				});
+		},
+		onDelete() {
+			this.$confirm('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+				.then(() => {
+					return this.$http.post(`/metaAwardDrop/del/${this.formData.id}`);
+				})
+				.then(() => {
+					this.$message.success('删除成功');
+					this.$router.go(-1);
+				})
+				.catch(e => {
+					if (e !== 'cancel') {
+						console.log(e);
+						this.$message.error((e || {}).error || '删除失败');
+					}
+				});
+		}
+	}
+};
+</script>
+<style lang="less" scoped></style>

+ 133 - 0
src/main/vue/src/views/MetaAwardDropList.vue

@@ -0,0 +1,133 @@
+<template>
+    <div class="list-view">
+        <page-title>
+            <el-button @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading"
+                class="filter-item">
+                新增
+            </el-button>
+            <el-button @click="download" icon="el-icon-upload2" :loading="downloading" :disabled="fetchingData"
+                class="filter-item">
+                导出
+            </el-button>
+        </page-title>
+        <div class="filters-container">
+            <el-input placeholder="搜索..." v-model="search" clearable class="filter-item search"
+                @keyup.enter.native="getData">
+                <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
+            </el-input>
+        </div>
+        <el-table :data="tableData" row-key="id" ref="table" header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell" row-class-name="table-row" cell-class-name="table-cell"
+            :height="tableHeight" v-loading="fetchingData">
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50">
+            </el-table-column>
+            <el-table-column prop="operator" align="center" label="操作人">
+            </el-table-column>
+            <el-table-column prop="operatingTime" align="center" label="空投时间">
+            </el-table-column>
+            <el-table-column prop="awardType" align="center" label="奖励类型" :formatter="awardTypeFormatter">
+            </el-table-column>
+            <el-table-column prop="remark" align="center" label="备注说明" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="fileUrl" align="center" label="附件地址" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column label="操作" align="center" fixed="right" width="150">
+                <template slot-scope="{row}">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>查看</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <el-pagination background @size-change="onSizeChange" @current-change="onCurrentChange" :current-page="page"
+                :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+                :total="totalElements">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+import pageableTable from '@/mixins/pageableTable';
+
+export default {
+	name: 'MetaAwardDropList',
+	mixins: [pageableTable],
+	data() {
+		return {
+			multipleMode: false,
+			search: '',
+			url: '/metaAwardDrop/all',
+			downloading: false,
+			awardTypeOptions: [
+				{ label: '金币', value: 'GOLD' },
+				{ label: '道具', value: 'META_PROP' }
+			]
+		};
+	},
+	computed: {
+		selection() {
+			return this.$refs.table.selection.map(i => i.id);
+		}
+	},
+	methods: {
+		awardTypeFormatter(row, column, cellValue, index) {
+			let selectedOption = this.awardTypeOptions.find(i => i.value === cellValue);
+			if (selectedOption) {
+				return selectedOption.label;
+			}
+			return '';
+		},
+		beforeGetData() {
+			return { search: this.search, query: { del: false } };
+		},
+		toggleMultipleMode(multipleMode) {
+			this.multipleMode = multipleMode;
+			if (!multipleMode) {
+				this.$refs.table.clearSelection();
+			}
+		},
+		addRow() {
+			this.$router.push({
+				path: '/metaAwardDropEdit',
+				query: {
+					...this.$route.query
+				}
+			});
+		},
+        editRow(row) {
+			this.$router.push({
+				path: '/metaAwardDropEdit',
+				query: {
+					id: row.id
+				}
+			});
+		},
+		download() {
+			this.downloading = true;
+			this.$axios
+				.get('/metaAwardDrop/excel', {
+					responseType: 'blob',
+					params: { size: 10000 }
+				})
+				.then(res => {
+					console.log(res);
+					this.downloading = false;
+					const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+					const link = document.createElement('a');
+					link.href = downloadUrl;
+					link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
+					document.body.appendChild(link);
+					link.click();
+					link.remove();
+				})
+				.catch(e => {
+					console.log(e);
+					this.downloading = false;
+					this.$message.error(e.error);
+				});
+		}
+	}
+};
+</script>
+<style lang="less" scoped></style>

+ 2 - 2
src/test/java/com/izouma/nineth/service/MetaTest.java

@@ -24,12 +24,12 @@ class MetaTest extends ApplicationTests {
     private AliyunProperties aliyunProperties;
     private AliyunProperties aliyunProperties;
 
 
     @Test
     @Test
-    void createAsset() {
+    void test() {
         String endpoint = aliyunProperties.getOssEndPoint();
         String endpoint = aliyunProperties.getOssEndPoint();
         String accessKeyId = aliyunProperties.getAccessKeyId();
         String accessKeyId = aliyunProperties.getAccessKeyId();
         String accessKeySecret = aliyunProperties.getAccessKeySecret();
         String accessKeySecret = aliyunProperties.getAccessKeySecret();
         String bucketName = aliyunProperties.getOssBucketName();
         String bucketName = aliyunProperties.getOssBucketName();
-        String objectKey = "application/2023-04-18-17-37-58RpoTXHMq.json";
+        String objectKey = "application/2023-04-19-11-23-30MnpIUYmK.json";
         OSSClient client = new OSSClient(endpoint, accessKeyId,
         OSSClient client = new OSSClient(endpoint, accessKeyId,
                 accessKeySecret);
                 accessKeySecret);
         List<MetaAwardDropJsonDTO> objects = new ArrayList<>();
         List<MetaAwardDropJsonDTO> objects = new ArrayList<>();