فهرست منبع

Merge branch 'dev-meta-dz' into dev

# Conflicts:
#	src/main/java/com/izouma/nineth/repo/AssetRepo.java
#	src/main/java/com/izouma/nineth/repo/DomainOrderRepo.java
#	src/main/java/com/izouma/nineth/security/WebSecurityConfig.java
#	src/main/java/com/izouma/nineth/service/DomainOrderService.java
#	src/main/vue/src/router.js
lidongze 3 سال پیش
والد
کامیت
d0e0a44d38
42فایلهای تغییر یافته به همراه1526 افزوده شده و 450 حذف شده
  1. 0 2
      src/main/java/com/izouma/nineth/config/MetaConstants.java
  2. 20 0
      src/main/java/com/izouma/nineth/domain/MetaBagAssetEffectConfig.java
  3. 32 0
      src/main/java/com/izouma/nineth/domain/MetaProblem.java
  4. 10 0
      src/main/java/com/izouma/nineth/domain/MetaResources.java
  5. 23 0
      src/main/java/com/izouma/nineth/domain/MetaResourcesLikeRecord.java
  6. 6 0
      src/main/java/com/izouma/nineth/domain/MetaTask.java
  7. 3 1
      src/main/java/com/izouma/nineth/domain/WithdrawApply.java
  8. 3 1
      src/main/java/com/izouma/nineth/domain/netease/NeteaseMessage.java
  9. 3 5
      src/main/java/com/izouma/nineth/dto/MetaBagAssetDTO.java
  10. 17 0
      src/main/java/com/izouma/nineth/enums/MetaResourcesType.java
  11. 22 0
      src/main/java/com/izouma/nineth/enums/MetaTaskClassification.java
  12. 7 2
      src/main/java/com/izouma/nineth/repo/AssetRepo.java
  13. 5 0
      src/main/java/com/izouma/nineth/repo/CollectionRepo.java
  14. 21 0
      src/main/java/com/izouma/nineth/repo/MetaBagAssetEffectConfigRepo.java
  15. 21 0
      src/main/java/com/izouma/nineth/repo/MetaProblemRepo.java
  16. 12 0
      src/main/java/com/izouma/nineth/repo/MetaResourcesLikeRecordRepo.java
  17. 1 2
      src/main/java/com/izouma/nineth/repo/netease/NeteaseMessageRepo.java
  18. 3 0
      src/main/java/com/izouma/nineth/security/WebSecurityConfig.java
  19. 5 0
      src/main/java/com/izouma/nineth/service/DomainOrderService.java
  20. 20 0
      src/main/java/com/izouma/nineth/service/MetaBagAssetEffectConfigService.java
  21. 20 0
      src/main/java/com/izouma/nineth/service/MetaProblemService.java
  22. 7 0
      src/main/java/com/izouma/nineth/web/AssetController.java
  23. 2 2
      src/main/java/com/izouma/nineth/web/DomainOrderController.java
  24. 65 0
      src/main/java/com/izouma/nineth/web/MetaBagAssetEffectConfigController.java
  25. 75 0
      src/main/java/com/izouma/nineth/web/MetaProblemController.java
  26. 29 0
      src/main/java/com/izouma/nineth/web/MetaResourcesController.java
  27. 18 6
      src/main/java/com/izouma/nineth/web/MetaUserBagController.java
  28. 10 6
      src/main/java/com/izouma/nineth/web/RaexSnapshotController.java
  29. 2 2
      src/main/java/com/izouma/nineth/web/UserBalanceController.java
  30. 4 4
      src/main/java/com/izouma/nineth/web/WithdrawApplyController.java
  31. 3 7
      src/main/java/com/izouma/nineth/web/netease/NeteaseMessageController.java
  32. 1 0
      src/main/resources/genjson/MetaBagAssetEffectConfig.json
  33. 33 1
      src/main/vue/src/router.js
  34. 180 169
      src/main/vue/src/views/CollectionList.vue
  35. 132 0
      src/main/vue/src/views/MetaBagAssetEffectConfigEdit.vue
  36. 149 0
      src/main/vue/src/views/MetaBagAssetEffectConfigList.vue
  37. 120 0
      src/main/vue/src/views/MetaProblemEdit.vue
  38. 185 0
      src/main/vue/src/views/MetaProblemList.vue
  39. 126 107
      src/main/vue/src/views/MetaResourcesEdit.vue
  40. 11 1
      src/main/vue/src/views/MetaResourcesList.vue
  41. 110 131
      src/main/vue/src/views/NeteaseMessageList.vue
  42. 10 1
      src/main/vue/src/views/TeamList.vue

+ 0 - 2
src/main/java/com/izouma/nineth/config/MetaConstants.java

@@ -10,8 +10,6 @@ public interface MetaConstants {
 
     String META_BAG_COLLECTION_NAME = "META_BAG_COLLECTION_NAME";
 
-    String META_CAN_USE_COLLECTION_ID = "META_CAN_USE_COLLECTION_ID";
-
     String META_LUCKY_DRAW_ID = "META_LUCKY_DRAW_ID";
 
     String COMMA = ",";

+ 20 - 0
src/main/java/com/izouma/nineth/domain/MetaBagAssetEffectConfig.java

@@ -0,0 +1,20 @@
+package com.izouma.nineth.domain;
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("元宇宙背包NFT效果配置")
+public class MetaBagAssetEffectConfig extends BaseEntity {
+
+    private String name;
+
+    private int effectId;
+}

+ 32 - 0
src/main/java/com/izouma/nineth/domain/MetaProblem.java

@@ -0,0 +1,32 @@
+package com.izouma.nineth.domain;
+
+
+import com.izouma.nineth.annotations.Searchable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+@Entity
+@ApiModel("元宇宙问答")
+public class MetaProblem extends BaseEntity {
+
+    @ApiModelProperty("标题")
+    @Searchable
+    private String title;
+
+    @ApiModelProperty("答案")
+    private String answer;
+
+    @ApiModelProperty("文件")
+    @Column(columnDefinition = "TEXT")
+    private String value;
+
+}

+ 10 - 0
src/main/java/com/izouma/nineth/domain/MetaResources.java

@@ -1,6 +1,7 @@
 package com.izouma.nineth.domain;
 
 import com.izouma.nineth.annotations.Searchable;
+import com.izouma.nineth.enums.MetaResourcesType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
@@ -9,6 +10,8 @@ import lombok.NoArgsConstructor;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 
 @Data
 @AllArgsConstructor
@@ -21,7 +24,14 @@ public class MetaResources extends BaseEntity {
     @Searchable
     private String name;
 
+    @Enumerated(EnumType.STRING)
+    @ApiModelProperty("类型")
+    private MetaResourcesType type;
+
     @ApiModelProperty("文件")
     @Column(columnDefinition = "TEXT")
     private String value;
+
+    @ApiModelProperty("点赞数量")
+    private int likeNum;
 }

+ 23 - 0
src/main/java/com/izouma/nineth/domain/MetaResourcesLikeRecord.java

@@ -0,0 +1,23 @@
+package com.izouma.nineth.domain;
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+import java.time.LocalDate;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("元宇宙资源点赞记录")
+public class MetaResourcesLikeRecord extends BaseEntity {
+
+    private Long metaResourcesId;
+
+    private Long userId;
+
+    private LocalDate likeTime;
+}

+ 6 - 0
src/main/java/com/izouma/nineth/domain/MetaTask.java

@@ -4,6 +4,7 @@ package com.izouma.nineth.domain;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.izouma.nineth.annotations.Searchable;
 import com.izouma.nineth.enums.MetaAwardTypeEnum;
+import com.izouma.nineth.enums.MetaTaskClassification;
 import com.izouma.nineth.enums.MetaTaskType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -38,6 +39,11 @@ public class MetaTask extends BaseEntity {
     @ExcelProperty("任务类型")
     private MetaTaskType type;
 
+    @ApiModelProperty("任务分类")
+    @Enumerated(EnumType.STRING)
+    @ExcelProperty("任务分类")
+    private MetaTaskClassification classification;
+
     @ApiModelProperty("参数配置")
     @ExcelProperty("参数")
     private String value;

+ 3 - 1
src/main/java/com/izouma/nineth/domain/WithdrawApply.java

@@ -1,6 +1,6 @@
 package com.izouma.nineth.domain;
 
-import com.izouma.nineth.enums.PayMethod;
+import com.izouma.nineth.annotations.Searchable;
 import com.izouma.nineth.enums.WithdrawStatus;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -20,6 +20,8 @@ import java.time.LocalDateTime;
 @NoArgsConstructor
 @Builder
 public class WithdrawApply extends BaseEntity {
+
+    @Searchable
     private Long userId;
 
     private BigDecimal amount;

+ 3 - 1
src/main/java/com/izouma/nineth/domain/netease/NeteaseMessage.java

@@ -1,5 +1,6 @@
 package com.izouma.nineth.domain.netease;
 
+import com.izouma.nineth.annotations.Searchable;
 import com.izouma.nineth.domain.BaseEntity;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -7,7 +8,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import javax.persistence.Entity;
-import java.sql.Timestamp;
 
 @Entity
 @Data
@@ -16,6 +16,7 @@ import java.sql.Timestamp;
 @Builder
 public class NeteaseMessage extends BaseEntity {
     private Long    msgId;
+    @Searchable
     private String  fromId;
     private String  fromAvatar;
     private String  fromNickName;
@@ -26,6 +27,7 @@ public class NeteaseMessage extends BaseEntity {
     private Integer ope;
     //type: 0 文本消息, 1 图片消息,3 视频消息
     private Integer type;
+    @Searchable
     private String  body;
     private String  msgInfo;
     private Long    timetag;

+ 3 - 5
src/main/java/com/izouma/nineth/dto/MetaBagAssetDTO.java

@@ -28,17 +28,15 @@ public class MetaBagAssetDTO {
     @Convert(converter = FileObjectListConverter.class)
     private List<FileObject> pic;
 
-    @ApiModelProperty("是否可以直接使用")
-    private boolean canUse;
-
-    private Long collectionId;
+    @ApiModelProperty("效果id")
+    private int effectId;
 
     public static MetaBagAssetDTO create(Asset asset) {
         return MetaBagAssetDTO.builder()
                 .id(asset.getId())
                 .name(asset.getName())
                 .pic(asset.getPic())
-                .collectionId(asset.getCollectionId())
+                .effectId(-1)
                 .build();
     }
 }

+ 17 - 0
src/main/java/com/izouma/nineth/enums/MetaResourcesType.java

@@ -0,0 +1,17 @@
+package com.izouma.nineth.enums;
+
+public enum MetaResourcesType {
+    PARTY_ONE("党建一楼"),
+    PARTY_TWO("党建二楼"),
+    PARTY_THREE("党建三楼");
+
+    private final String description;
+
+    MetaResourcesType(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 22 - 0
src/main/java/com/izouma/nineth/enums/MetaTaskClassification.java

@@ -0,0 +1,22 @@
+package com.izouma.nineth.enums;
+
+public enum MetaTaskClassification {
+
+    MAIN_LINE("主线任务"),
+
+    BRANCH_LINE("支线任务"),
+
+    NODE("节点任务"),
+
+    DAILY("日常任务");
+
+    private final String description;
+
+    MetaTaskClassification(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 7 - 2
src/main/java/com/izouma/nineth/repo/AssetRepo.java

@@ -32,7 +32,7 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
 
     List<Asset> findAllByCollectionIdInAndStatusIn(List<Long> collectionId, Iterable<AssetStatus> statuses);
 
-    List<Asset> findAllByCollectionIdAndStatusInAndUserId(Long collectionId, Iterable<AssetStatus> statuses, Long userId);
+    List<Asset> findAllByCollectionIdAndStatusInAndUserId(Long collectionId, Iterable<AssetStatus> statuses,Long userId);
 
     List<Asset> findByCreatedAtBefore(LocalDateTime localDateTime);
 
@@ -165,8 +165,13 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
 
     Long countAllByCollectionIdAndUserIdAndSource(Long collectionId, Long userId, AssetSource source);
 
-    @Query(nativeQuery = true, value = "select count(a.id) countNum,a.owner_id userId,a.owner_avatar avatar,a.`owner` nickname from asset a inner join `user` u on u.id = a.user_id where a.status = 'NORMAL' and a.type = 'DOMAIN' GROUP BY a.owner_id ORDER BY count(a.id) desc limit 60")
+    @Query(nativeQuery = true, value = "select count(a.id) countNum,a.user_Id userId,a.owner_avatar avatar,a.`owner` nickname from asset a inner join `user` u on u.id = a.user_id where a.status = 'NORMAL' and a.type = 'DOMAIN' GROUP BY a.user_id ORDER BY count(a.id) desc limit 60")
     List<Map<String, Object>> domainTop20();
 
+    @Query(nativeQuery = true, value = "update asset a set a.hold_days = null,a.old_hold_days = null where a.name like ?1")
+    @Modifying
+    @Transactional
+    void openTrade(String name);
+
     Asset findFirstByNameAndStatus(String name, AssetStatus status);
 }

+ 5 - 0
src/main/java/com/izouma/nineth/repo/CollectionRepo.java

@@ -218,4 +218,9 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
     BigDecimal findMinPriceByNameAndPrefixName(String prefixName, String nameLike, String nameNotLike);
 
     List<Collection> findAllByNameLikeAndSalableAndOnShelf(String name, boolean salable, boolean onshelf);
+
+    @Query(nativeQuery = true, value = "update collection_info c set c.hold_days = null where c.name like ?1")
+    @Modifying
+    @Transactional
+    void openTrade(String name);
 }

+ 21 - 0
src/main/java/com/izouma/nineth/repo/MetaBagAssetEffectConfigRepo.java

@@ -0,0 +1,21 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.MetaBagAssetEffectConfig;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+import javax.transaction.Transactional;
+import java.util.List;
+
+public interface MetaBagAssetEffectConfigRepo extends JpaRepository<MetaBagAssetEffectConfig, Long>, JpaSpecificationExecutor<MetaBagAssetEffectConfig> {
+    @Query("update MetaBagAssetEffectConfig t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+
+    List<MetaBagAssetEffectConfig> findAllByDel(boolean del);
+
+    MetaBagAssetEffectConfig findByNameAndDel(String name, boolean del);
+}

+ 21 - 0
src/main/java/com/izouma/nineth/repo/MetaProblemRepo.java

@@ -0,0 +1,21 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.MetaProblem;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+import javax.transaction.Transactional;
+import java.util.List;
+
+public interface MetaProblemRepo extends JpaRepository<MetaProblem, Long>, JpaSpecificationExecutor<MetaProblem> {
+    @Query("update MetaProblem t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+
+    List<MetaProblem> findAllByDel(Boolean del);
+
+    MetaProblem findAllByIdAndDel(Long id , boolean del);
+}

+ 12 - 0
src/main/java/com/izouma/nineth/repo/MetaResourcesLikeRecordRepo.java

@@ -0,0 +1,12 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.MetaResourcesLikeRecord;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.time.LocalDate;
+
+public interface MetaResourcesLikeRecordRepo extends JpaRepository<MetaResourcesLikeRecord, Long>, JpaSpecificationExecutor<MetaResourcesLikeRecord> {
+
+    MetaResourcesLikeRecord findByMetaResourcesIdAndUserIdAndLikeTime(Long metaResourcesId, Long userId, LocalDate likeTime);
+}

+ 1 - 2
src/main/java/com/izouma/nineth/repo/netease/NeteaseMessageRepo.java

@@ -10,7 +10,6 @@ import org.springframework.data.jpa.repository.Query;
 
 import javax.transaction.Transactional;
 import java.time.LocalDateTime;
-import java.util.List;
 
 public interface NeteaseMessageRepo extends JpaRepository<NeteaseMessage, Long>, JpaSpecificationExecutor<NeteaseMessage> {
     @Query("update NeteaseMessage t set t.del = true where t.id = ?1")
@@ -18,7 +17,7 @@ public interface NeteaseMessageRepo extends JpaRepository<NeteaseMessage, Long>,
     @Transactional
     void softDelete(Long id);
 
-    Page<NeteaseMessage> findAllByToIdAndOpeOrderByCreatedAtDesc(String toId, Integer ope, Pageable pageable);
+    Page<NeteaseMessage> findAllByToIdAndOpeAndDelOrderByCreatedAtDesc(String toId, Integer ope, Pageable pageable,Boolean del);
 
     Long countAllByToIdAndOpeAndCreatedAtAfter(String toId, Integer ope, LocalDateTime createdAt);
 

+ 3 - 0
src/main/java/com/izouma/nineth/security/WebSecurityConfig.java

@@ -179,6 +179,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/gpt3/**").permitAll()
                 .antMatchers("/metaSwitch/*/findSwitch").permitAll()
                 .antMatchers("/news/newsInfo").permitAll()
+                .antMatchers("/metaResources/getUrl").permitAll()
+                .antMatchers("/news/newsInfo").permitAll()
+                .antMatchers("/metaResources/like").permitAll()
                 // all other requests need to be authenticated
                 .anyRequest().authenticated().and()
                 // make sure we use stateless session; session won't be used to

+ 5 - 0
src/main/java/com/izouma/nineth/service/DomainOrderService.java

@@ -224,6 +224,11 @@ public class DomainOrderService {
         Map<String, Object> result = new HashMap<>();
         Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
         String visibleDomain = domain;
+        if (isContainChinese(domain)) {
+            result.put("result", false);
+            result.put("reason", "禁止使用中文");
+            return result;
+        }
         if (domain.contains(".uni")) {
             result.put("result", false);
             result.put("reason", "禁止使用.uni");

+ 20 - 0
src/main/java/com/izouma/nineth/service/MetaBagAssetEffectConfigService.java

@@ -0,0 +1,20 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.MetaBagAssetEffectConfig;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.repo.MetaBagAssetEffectConfigRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class MetaBagAssetEffectConfigService {
+
+    private MetaBagAssetEffectConfigRepo metaBagAssetEffectConfigRepo;
+
+    public Page<MetaBagAssetEffectConfig> all(PageQuery pageQuery) {
+        return metaBagAssetEffectConfigRepo.findAll(JpaUtils.toSpecification(pageQuery, MetaBagAssetEffectConfig.class), JpaUtils.toPageRequest(pageQuery));
+    }
+}

+ 20 - 0
src/main/java/com/izouma/nineth/service/MetaProblemService.java

@@ -0,0 +1,20 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.MetaProblem;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.repo.MetaProblemRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class MetaProblemService {
+
+    private MetaProblemRepo metaProblemRepo;
+
+    public Page<MetaProblem> all(PageQuery pageQuery) {
+        return metaProblemRepo.findAll(JpaUtils.toSpecification(pageQuery, MetaProblem.class), JpaUtils.toPageRequest(pageQuery));
+    }
+}

+ 7 - 0
src/main/java/com/izouma/nineth/web/AssetController.java

@@ -300,6 +300,13 @@ public class AssetController extends BaseController {
     public void cancelConsignment(@RequestParam String search) {
         assetService.batchCancelConsignment(search);
     }
+
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/openTrade")
+    public void openTrade(@RequestParam String name) {
+        assetRepo.openTrade(name);
+        collectionRepo.openTrade(name);
+    }
 }
 
 

+ 2 - 2
src/main/java/com/izouma/nineth/web/DomainOrderController.java

@@ -46,7 +46,7 @@ public class DomainOrderController extends BaseController {
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/all")
     public Page<DomainOrder> all(@RequestBody PageQuery pageQuery) {
-        if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN)) {
+        if (!SecurityUtils.hasRole(AuthorityName.ROLE_ADMIN) & !SecurityUtils.hasRole(AuthorityName.ROLE_ORDERINFO)) {
             pageQuery.getQuery().put("userId", SecurityUtils.getAuthenticatedUser().getId());
         }
         if (pageQuery.getSize() == 50) {
@@ -76,7 +76,7 @@ public class DomainOrderController extends BaseController {
         return domainOrderRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     @GetMapping("/excel")
     @ResponseBody
     public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {

+ 65 - 0
src/main/java/com/izouma/nineth/web/MetaBagAssetEffectConfigController.java

@@ -0,0 +1,65 @@
+package com.izouma.nineth.web;
+
+import com.izouma.nineth.domain.MetaBagAssetEffectConfig;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.MetaBagAssetEffectConfigRepo;
+import com.izouma.nineth.service.MetaBagAssetEffectConfigService;
+import com.izouma.nineth.utils.ObjUtils;
+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;
+import java.util.Objects;
+
+@RestController
+@RequestMapping("/metaBagAssetEffectConfig")
+@AllArgsConstructor
+public class MetaBagAssetEffectConfigController extends BaseController {
+    private MetaBagAssetEffectConfigService metaBagAssetEffectConfigService;
+    private MetaBagAssetEffectConfigRepo metaBagAssetEffectConfigRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public MetaBagAssetEffectConfig save(@RequestBody MetaBagAssetEffectConfig record) {
+        MetaBagAssetEffectConfig config = metaBagAssetEffectConfigRepo.findByNameAndDel(record.getName(), false);
+        if (Objects.nonNull(config) && !Objects.equals(config.getId(), record.getId())) {
+            throw new BusinessException("该名称特效已经配置!");
+        }
+        if (record.getId() != null) {
+            MetaBagAssetEffectConfig orig = metaBagAssetEffectConfigRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return metaBagAssetEffectConfigRepo.save(orig);
+        }
+        return metaBagAssetEffectConfigRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<MetaBagAssetEffectConfig> all(@RequestBody PageQuery pageQuery) {
+        return metaBagAssetEffectConfigService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public MetaBagAssetEffectConfig get(@PathVariable Long id) {
+        return metaBagAssetEffectConfigRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        metaBagAssetEffectConfigRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<MetaBagAssetEffectConfig> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

+ 75 - 0
src/main/java/com/izouma/nineth/web/MetaProblemController.java

@@ -0,0 +1,75 @@
+package com.izouma.nineth.web;
+import com.izouma.nineth.domain.MetaProblem;
+import com.izouma.nineth.dto.MetaRestResult;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.MetaProblemRepo;
+import com.izouma.nineth.service.MetaProblemService;
+import com.izouma.nineth.utils.ObjUtils;
+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;
+import java.util.Objects;
+
+@RestController
+@RequestMapping("/metaProblem")
+@AllArgsConstructor
+public class MetaProblemController extends BaseController {
+    private MetaProblemService metaProblemService;
+    private MetaProblemRepo metaProblemRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public MetaProblem save(@RequestBody MetaProblem record) {
+        if (record.getId() != null) {
+            MetaProblem orig = metaProblemRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return metaProblemRepo.save(orig);
+        }
+        return metaProblemRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<MetaProblem> all(@RequestBody PageQuery pageQuery) {
+        return metaProblemService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public MetaProblem get(@PathVariable Long id) {
+        return metaProblemRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        metaProblemRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<MetaProblem> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    @GetMapping("/findAll")
+    public List<MetaProblem> findAll(){
+        return metaProblemRepo.findAllByDel(false);
+    }
+
+    @GetMapping("/getAnswer/{id}")
+    public MetaRestResult<MetaProblem> getAnswer(@PathVariable Long id) {
+        MetaProblem metaProblem = metaProblemRepo.findAllByIdAndDel(id, false);
+        if (Objects.isNull(metaProblem)) {
+            return MetaRestResult.returnError("不存在该id的题目");
+        }
+        return MetaRestResult.returnSuccess("查询成功",metaProblem);
+    }
+}
+

+ 29 - 0
src/main/java/com/izouma/nineth/web/MetaResourcesController.java

@@ -1,11 +1,14 @@
 package com.izouma.nineth.web;
 
 import com.izouma.nineth.domain.MetaResources;
+import com.izouma.nineth.domain.MetaResourcesLikeRecord;
 import com.izouma.nineth.dto.MetaRestResult;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.MetaResourcesLikeRecordRepo;
 import com.izouma.nineth.repo.MetaResourcesRepo;
 import com.izouma.nineth.service.MetaResourcesService;
+import com.izouma.nineth.utils.DateTimeUtils;
 import com.izouma.nineth.utils.ObjUtils;
 import com.izouma.nineth.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
@@ -15,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.List;
 import java.util.Objects;
 
@@ -25,6 +30,8 @@ public class MetaResourcesController extends BaseController {
     private MetaResourcesService metaResourcesService;
     private MetaResourcesRepo metaResourcesRepo;
 
+    private MetaResourcesLikeRecordRepo metaResourcesLikeRecordRepo;
+
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public MetaResources save(@RequestBody MetaResources record) {
@@ -75,5 +82,27 @@ public class MetaResourcesController extends BaseController {
         }
         return MetaRestResult.returnSuccess("查询成功", metaResources.getValue());
     }
+
+    @PostMapping("/like")
+    public MetaRestResult<Integer> like(Long id, Long userId) {
+        MetaResources metaResources = metaResourcesRepo.findById(id).orElse(null);
+        if (Objects.isNull(metaResources)) {
+            return MetaRestResult.returnError("当前资源不存在!");
+        }
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DateTimeUtils.DATE_FORMAT);
+        LocalDate likeTime = LocalDate.parse(LocalDate.now().format(formatter), formatter);
+        MetaResourcesLikeRecord metaResourcesLikeRecord = metaResourcesLikeRecordRepo.findByMetaResourcesIdAndUserIdAndLikeTime(id, userId, likeTime);
+        if (Objects.nonNull(metaResourcesLikeRecord)) {
+            return MetaRestResult.returnError("该资源今天已经点过赞,不可重复点赞");
+        }
+        metaResourcesLikeRecord = new MetaResourcesLikeRecord();
+        metaResourcesLikeRecord.setMetaResourcesId(id);
+        metaResourcesLikeRecord.setUserId(userId);
+        metaResourcesLikeRecord.setLikeTime(likeTime);
+        metaResourcesLikeRecordRepo.save(metaResourcesLikeRecord);
+        metaResources.setLikeNum(metaResources.getLikeNum() + 1);
+        metaResourcesRepo.save(metaResources);
+        return MetaRestResult.returnSuccess(metaResources.getLikeNum());
+    }
 }
 

+ 18 - 6
src/main/java/com/izouma/nineth/web/MetaUserBagController.java

@@ -3,15 +3,18 @@ package com.izouma.nineth.web;
 import com.izouma.nineth.config.Constants;
 import com.izouma.nineth.config.MetaConstants;
 import com.izouma.nineth.domain.Asset;
+import com.izouma.nineth.domain.MetaBagAssetEffectConfig;
 import com.izouma.nineth.domain.MetaUserProp;
 import com.izouma.nineth.dto.MetaBagAssetDTO;
 import com.izouma.nineth.dto.MetaRestResult;
 import com.izouma.nineth.dto.MetaUserBagDTO;
 import com.izouma.nineth.repo.AssetRepo;
+import com.izouma.nineth.repo.MetaBagAssetEffectConfigRepo;
 import com.izouma.nineth.repo.MetaUserPropRepo;
 import com.izouma.nineth.service.MetaParamsConfigService;
 import com.izouma.nineth.utils.SecurityUtils;
 import lombok.AllArgsConstructor;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -37,18 +40,27 @@ public class MetaUserBagController {
 
     private AssetRepo assetRepo;
 
+    private MetaBagAssetEffectConfigRepo metaBagAssetEffectConfigRepo;
+
     @GetMapping("/query")
     public MetaRestResult<MetaUserBagDTO> queryMetaBag() {
         Long userId = SecurityUtils.getAuthenticatedUser().getId();
         List<MetaUserProp> metaUserProps = metaUserPropRepo.findByUserIdAndDel(userId, false);
         String names = metaParamsConfigService.getString(MetaConstants.META_BAG_COLLECTION_NAME);
         List<MetaBagAssetDTO> metaBagAssetDTOS = queryAsset(names, userId);
-        String id = metaParamsConfigService.getString(MetaConstants.META_CAN_USE_COLLECTION_ID);
-        if (StringUtils.isNotBlank(id)) {
-            List<String> ids = Arrays.asList(id.split(MetaConstants.COMMA));
-            metaBagAssetDTOS.forEach(metaBagAssetDTO -> {
-                metaBagAssetDTO.setCanUse(ids.contains(String.valueOf(metaBagAssetDTO.getCollectionId())));
-            });
+        List<MetaBagAssetEffectConfig> configs = metaBagAssetEffectConfigRepo.findAllByDel(false);
+        if (CollectionUtils.isEmpty(configs)) {
+            return MetaRestResult.returnSuccess(new MetaUserBagDTO(metaBagAssetDTOS, metaUserProps));
+        }
+        for (MetaBagAssetDTO metaBagAssetDTO :
+                metaBagAssetDTOS) {
+            for (MetaBagAssetEffectConfig config :
+                    configs) {
+                if (metaBagAssetDTO.getName().contains(config.getName())) {
+                    metaBagAssetDTO.setEffectId(config.getEffectId());
+                    break;
+                }
+            }
         }
         return MetaRestResult.returnSuccess(new MetaUserBagDTO(metaBagAssetDTOS, metaUserProps));
     }

+ 10 - 6
src/main/java/com/izouma/nineth/web/RaexSnapshotController.java

@@ -13,6 +13,7 @@ import com.izouma.nineth.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
@@ -27,7 +28,7 @@ public class RaexSnapshotController extends BaseController {
     private RaexSnapshotService raexSnapshotService;
     private RaexSnapshotRepo raexSnapshotRepo;
 
-    //@PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public RaexSnapshot save(@RequestBody RaexSnapshot record) {
         if (record.getId() != null) {
@@ -39,24 +40,26 @@ public class RaexSnapshotController extends BaseController {
     }
 
 
-    //@PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/all")
     public Page<RaexSnapshot> all(@RequestBody PageQuery pageQuery) {
         return raexSnapshotService.all(pageQuery);
     }
 
+    @PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/get/{id}")
     public RaexSnapshot get(@PathVariable Long id) {
         return raexSnapshotRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
 
-    @PostMapping("/del/{id}")
-    public void del(@PathVariable Long id) {
-        raexSnapshotRepo.softDelete(id);
-    }
+//    @PostMapping("/del/{id}")
+//    public void del(@PathVariable Long id) {
+//        raexSnapshotRepo.softDelete(id);
+//    }
 
     @GetMapping("/excel")
     @ResponseBody
+    @PreAuthorize("hasRole('ADMIN')")
     public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
         List<RaexSnapshot> data = all(pageQuery).getContent();
         ExcelUtils.export(response, data);
@@ -64,6 +67,7 @@ public class RaexSnapshotController extends BaseController {
 
     @GetMapping("/shot")
     @ResponseBody
+    @PreAuthorize("hasRole('ADMIN')")
     public void shot(HttpServletResponse response, String name, String time) throws IOException {
         List<Map<String, Object>> map = raexSnapshotRepo.shot(MetaConstants.LIKE.concat(name).concat(MetaConstants.LIKE), time);
         List<SnapshotDTO> snapshotDTOS = mapToList(map);

+ 2 - 2
src/main/java/com/izouma/nineth/web/UserBalanceController.java

@@ -57,14 +57,14 @@ public class UserBalanceController extends BaseController {
     private final SnowflakeIdWorker             snowflakeIdWorker;
 
     @PostMapping("/all")
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     public Page<UserBalance> all(@RequestBody PageQuery pageQuery) {
         return userBalanceRepo
                 .findAll(JpaUtils.toSpecification(pageQuery, UserBalance.class), JpaUtils.toPageRequest(pageQuery));
     }
 
     @PostMapping("/records")
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     public Page<BalanceRecord> records(@RequestBody PageQuery pageQuery) {
         return balanceRecordRepo
                 .findAll(JpaUtils.toSpecification(pageQuery, BalanceRecord.class), JpaUtils.toPageRequest(pageQuery));

+ 4 - 4
src/main/java/com/izouma/nineth/web/WithdrawApplyController.java

@@ -27,7 +27,7 @@ public class WithdrawApplyController extends BaseController {
     private WithdrawApplyService withdrawApplyService;
     private WithdrawApplyRepo    withdrawApplyRepo;
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     @PostMapping("/all")
     public Page<WithdrawApply> all(@RequestBody PageQuery pageQuery) {
         return withdrawApplyService.all(pageQuery);
@@ -51,19 +51,19 @@ public class WithdrawApplyController extends BaseController {
         return withdrawApplyService.apply(SecurityUtils.getAuthenticatedUser().getId(), amount);
     }
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     @PostMapping("/finish")
     public WithdrawApply finish(@RequestParam Long id, @RequestParam boolean approve, String reason) {
         return withdrawApplyService.finishWithdrawApply(id, approve, reason);
     }
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     @PostMapping("/approveAll")
     public void approveAll() throws ExecutionException, InterruptedException {
         withdrawApplyService.approveAllAsync();
     }
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
     @PostMapping("/applyAll")
     public void applyAll() throws ExecutionException, InterruptedException {
         withdrawApplyService.applyAll();

+ 3 - 7
src/main/java/com/izouma/nineth/web/netease/NeteaseMessageController.java

@@ -1,20 +1,16 @@
 package com.izouma.nineth.web.netease;
 
-import com.izouma.nineth.domain.netease.NeteaseUser;
-import com.izouma.nineth.web.BaseController;
 import com.izouma.nineth.domain.netease.NeteaseMessage;
-import com.izouma.nineth.service.netease.NeteaseMessageService;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.netease.NeteaseMessageRepo;
+import com.izouma.nineth.service.netease.NeteaseMessageService;
 import com.izouma.nineth.utils.ObjUtils;
 import com.izouma.nineth.utils.excel.ExcelUtils;
-
+import com.izouma.nineth.web.BaseController;
 import lombok.AllArgsConstructor;
-import org.apache.commons.validator.Msg;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
@@ -53,7 +49,7 @@ public class NeteaseMessageController extends BaseController {
 
     @PostMapping("/record")
     public Page<NeteaseMessage> record(String toId, Integer ope, Pageable pageable) {
-        return neteaseMessageRepo.findAllByToIdAndOpeOrderByCreatedAtDesc(toId, ope, pageable);
+        return neteaseMessageRepo.findAllByToIdAndOpeAndDelOrderByCreatedAtDesc(toId, ope, pageable,false);
     }
 
     @PostMapping("/del/{id}")

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

@@ -0,0 +1 @@
+{"tableName":"MetaBagAssetEffectConfig","className":"MetaBagAssetEffectConfig","remark":"NFT特效配置","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":"name","modelName":"name","remark":"NFT名称","showInList":true,"showInForm":true,"formType":"singleLineText","required":true},{"name":"effectId","modelName":"effectId","remark":"特效","showInList":true,"showInForm":true,"formType":"singleLineText","required":true}],"readTable":false,"dataSourceCode":"dataSource","genJson":"","subtables":[],"update":false,"basePackage":"com.izouma.nineth","tablePackage":"com.izouma.nineth.domain.MetaBagAssetEffectConfig"}

+ 33 - 1
src/main/vue/src/router.js

@@ -1829,6 +1829,38 @@ const router = new Router({
                     meta: {
                        title: '频道管理',
                     },
+               },
+                {
+                    path: '/metaBagAssetEffectConfigEdit',
+                    name: 'MetaBagAssetEffectConfigEdit',
+                    component: () => import(/* webpackChunkName: "metaBagAssetEffectConfigEdit" */ '@/views/MetaBagAssetEffectConfigEdit.vue'),
+                    meta: {
+                       title: 'NFT特效配置编辑',
+                    },
+                },
+                {
+                    path: '/metaBagAssetEffectConfigList',
+                    name: 'MetaBagAssetEffectConfigList',
+                    component: () => import(/* webpackChunkName: "metaBagAssetEffectConfigList" */ '@/views/MetaBagAssetEffectConfigList.vue'),
+                    meta: {
+                       title: 'NFT特效配置',
+                    },
+               },
+                {
+                    path: '/metaProblemEdit',
+                    name: 'MetaProblemEdit',
+                    component: () => import(/* webpackChunkName: "metaChannelEdit" */ '@/views/MetaProblemEdit.vue'),
+                    meta: {
+                        title: '元宇宙问答编辑',
+                    },
+                },
+                {
+                    path: '/metaProblemList',
+                    name: 'MetaProblemList',
+                    component: () => import(/* webpackChunkName: "metaChannelList" */ '@/views/MetaProblemList.vue'),
+                    meta: {
+                        title: '元宇宙问答管理',
+                    },
                },
                 {
                     path: '/riceUserWaterDropRecordEdit',
@@ -1969,4 +2001,4 @@ router.beforeEach((to, from, next) => {
     }
 });
 
-export default router;
+export default router;

+ 180 - 169
src/main/vue/src/views/CollectionList.vue

@@ -1,15 +1,11 @@
 <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 @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading"
+                class="filter-item">
                 新增
             </el-button>
+            <el-button @click="addParams()" type="primary" size="mini" plain> 开放交易 </el-button>
             <!-- <el-button
                 @click="download"
                 icon="el-icon-upload2"
@@ -23,27 +19,14 @@
         <div class="filters-container">
             <created-at-picker v-model="createdAt" @change="getData" class="filter-item"></created-at-picker>
             <minter-filter v-model="minterId" @input="getData" class="filter-item"></minter-filter>
-            <el-input
-                placeholder="搜索..."
-                v-model="search"
-                clearable
-                class="filter-item search"
-                @keyup.enter.native="getData"
-            >
+            <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 :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="id" label="ID" width="100"> </el-table-column>
             <el-table-column prop="name" label="名称" show-overflow-tooltip> </el-table-column>
@@ -54,12 +37,8 @@
             </el-table-column>
             <el-table-column prop="pic" label="作品内容" width="90" align="center">
                 <template slot-scope="{ row }">
-                    <el-image
-                        style="width: 30px; height: 30px"
-                        :src="row.pic[0].thumb || row.pic[0].url"
-                        fit="cover"
-                        :preview-src-list="row.pic.map(i => i.thumb || i.url)"
-                    ></el-image>
+                    <el-image style="width: 30px; height: 30px" :src="row.pic[0].thumb || row.pic[0].url" fit="cover"
+                        :preview-src-list="row.pic.map(i => i.thumb || i.url)"></el-image>
                 </template>
             </el-table-column>
             <el-table-column prop="minter" label="铸造者"> </el-table-column>
@@ -107,6 +86,18 @@
                 </template>
             </el-table-column>
         </el-table>
+        <el-dialog :visible.sync="showParamsDialog" title="添加参数" width="600px" :close-on-click-modal="false">
+            <el-form ref="paramsForm">
+                <el-form-item :rules="[{ required: true, message: '请输入名称' }]" width="300px">
+                    <el-input v-model="name" placeholder="请输入名称">
+                    </el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer">
+                <el-button @click="showParamsDialog = false" size="mini"> 取消 </el-button>
+                <el-button @click="openTrade" size="mini" :loading="loading" type="primary"> 开放交易 </el-button>
+            </div>
+        </el-dialog>
         <div class="pagination-wrapper">
             <!-- <div class="multiple-mode-wrapper">
                 <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
@@ -116,16 +107,9 @@
                     <el-button @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div> -->
-            <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 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>
@@ -138,134 +122,161 @@ import MinterSelect from '../components/MinterSelect.vue';
 import { format, addDays } from 'date-fns';
 
 export default {
-    components: { SortableHeader, MinterSelect },
-    name: 'CollectionList',
-    mixins: [pageableTable],
-    data() {
-        return {
-            multipleMode: false,
-            search: '',
-            url: '/collection/all',
-            downloading: false,
-            typeOptions: [
-                { label: '默认', value: 'DEFAULT' },
-                { label: '展厅', value: 'SHOWROOM' },
-                { label: '盲盒', value: 'BLIND_BOX' },
-                { label: '拍卖', value: 'AUCTION' }
-            ],
-            sourceOptions: [
-                { label: '官方', value: 'OFFICIAL' },
-                { label: '用户铸造', value: 'USER' },
-                { label: '转让', value: 'TRANSFER' }
-            ],
-            sort: { sort: 'desc' },
-            sortStr: 'sort,desc',
-            createdAt: '',
-            minterId: ''
-        };
-    },
-    computed: {
-        selection() {
-            return this.$refs.table.selection.map(i => i.id);
-        }
-    },
-    methods: {
-        typeFormatter(row, column, cellValue, index) {
-            let selectedOption = this.typeOptions.find(i => i.value === cellValue);
-            if (selectedOption) {
-                return selectedOption.label;
-            }
-            return '';
-        },
-        sourceFormatter(row, column, cellValue, index) {
-            let selectedOption = this.sourceOptions.find(i => i.value === cellValue);
-            if (selectedOption) {
-                return selectedOption.label;
-            }
-            return '';
-        },
-        beforeGetData() {
-            return {
-                search: this.search,
-                query: {
-                    del: false,
-                    source: 'OFFICIAL',
-                    createdAt: this.createdAt || ['1970-01-01 00:00:00', format(new Date(), 'yyyy-MM-dd HH:mm:ss')],
-                    minterId: this.minterId
-                }
-            };
-        },
-        toggleMultipleMode(multipleMode) {
-            this.multipleMode = multipleMode;
-            if (!multipleMode) {
-                this.$refs.table.clearSelection();
-            }
-        },
-        addRow() {
-            this.$router.push({
-                path: '/collectionEdit',
-                query: {
-                    ...this.$route.query
-                }
-            });
-        },
-        editRow(row) {
-            this.$router.push({
-                path: '/collectionEdit',
-                query: {
-                    id: row.id
-                }
-            });
-        },
-        download() {
-            this.downloading = true;
-            this.$axios
-                .get('/collection/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);
-                });
-        },
-        operation1() {
-            this.$notify({
-                title: '提示',
-                message: this.selection
-            });
-        },
-        operation2() {
-            this.$message('操作2');
-        },
-        deleteRow(row) {
-            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
-                .then(() => {
-                    return this.$http.post(`/collection/del/${row.id}`);
-                })
-                .then(() => {
-                    this.$message.success('删除成功');
-                    this.getData();
-                })
-                .catch(e => {
-                    if (e !== 'cancel') {
-                        this.$message.error(e.error);
-                    }
-                });
-        }
-    }
+	components: { SortableHeader, MinterSelect },
+	name: 'CollectionList',
+	mixins: [pageableTable],
+	data() {
+		return {
+			multipleMode: false,
+			search: '',
+			url: '/collection/all',
+			showParamsDialog: false,
+			loading: false,
+			name: '',
+			downloading: false,
+			typeOptions: [
+				{ label: '默认', value: 'DEFAULT' },
+				{ label: '展厅', value: 'SHOWROOM' },
+				{ label: '盲盒', value: 'BLIND_BOX' },
+				{ label: '拍卖', value: 'AUCTION' }
+			],
+			sourceOptions: [
+				{ label: '官方', value: 'OFFICIAL' },
+				{ label: '用户铸造', value: 'USER' },
+				{ label: '转让', value: 'TRANSFER' }
+			],
+			sort: { sort: 'desc' },
+			sortStr: 'sort,desc',
+			createdAt: '',
+			minterId: ''
+		};
+	},
+	computed: {
+		selection() {
+			return this.$refs.table.selection.map(i => i.id);
+		}
+	},
+	methods: {
+		typeFormatter(row, column, cellValue, index) {
+			let selectedOption = this.typeOptions.find(i => i.value === cellValue);
+			if (selectedOption) {
+				return selectedOption.label;
+			}
+			return '';
+		},
+		addParams() {
+			this.name = '';
+			this.showParamsDialog = true;
+			if (this.$refs.paramsForm) {
+				this.$nextTick(() => {
+					this.$refs.paramsForm.clearValidate();
+				});
+			}
+		},
+		sourceFormatter(row, column, cellValue, index) {
+			let selectedOption = this.sourceOptions.find(i => i.value === cellValue);
+			if (selectedOption) {
+				return selectedOption.label;
+			}
+			return '';
+		},
+		beforeGetData() {
+			return {
+				search: this.search,
+				query: {
+					del: false,
+					source: 'OFFICIAL',
+					createdAt: this.createdAt || ['1970-01-01 00:00:00', format(new Date(), 'yyyy-MM-dd HH:mm:ss')],
+					minterId: this.minterId
+				}
+			};
+		},
+		toggleMultipleMode(multipleMode) {
+			this.multipleMode = multipleMode;
+			if (!multipleMode) {
+				this.$refs.table.clearSelection();
+			}
+		},
+		addRow() {
+			this.$router.push({
+				path: '/collectionEdit',
+				query: {
+					...this.$route.query
+				}
+			});
+		},
+		editRow(row) {
+			this.$router.push({
+				path: '/collectionEdit',
+				query: {
+					id: row.id
+				}
+			});
+		},
+		download() {
+			this.downloading = true;
+			this.$axios
+				.get('/collection/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);
+				});
+		},
+		operation1() {
+			this.$notify({
+				title: '提示',
+				message: this.selection
+			});
+		},
+		operation2() {
+			this.$message('操作2');
+		},
+		deleteRow(row) {
+			this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+				.then(() => {
+					return this.$http.post(`/collection/del/${row.id}`);
+				})
+				.then(() => {
+					this.$message.success('删除成功');
+					this.getData();
+				})
+				.catch(e => {
+					if (e !== 'cancel') {
+						this.$message.error(e.error);
+					}
+				});
+		},
+		openTrade() {
+			this.loading = true;
+			this.$axios
+				.post('/asset/openTrade?name=' + this.name)
+				.then(res => {
+					console.log(res);
+					this.loading = false;
+					this.showParamsDialog = false;
+				})
+				.catch(e => {
+					console.log(e);
+					this.loading = false;
+					this.$message.error(e.error);
+				});
+		}
+	}
 };
 </script>
 <style lang="less" scoped></style>

+ 132 - 0
src/main/vue/src/views/MetaBagAssetEffectConfigEdit.vue

@@ -0,0 +1,132 @@
+<template>
+    <div class="edit-view">
+        <page-title>
+            <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+            <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                删除
+            </el-button>
+            <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
+        </page-title>
+        <div class="edit-view__content-wrapper">
+            <div class="edit-view__content-section">
+                <el-form :model="formData" :rules="rules" ref="form" label-width="79px" label-position="right" size="small"
+                    style="max-width: 500px;">
+                    <el-form-item prop="name" label="NFT名称">
+                        <el-input v-model="formData.name"></el-input>
+                    </el-form-item>
+                    <el-form-item prop="effectId" label="特效">
+						<el-input-number type="effectId" v-model="formData.effectId" :step="1" :min="1">
+						</el-input-number>
+						<div class="tip">输入规则:正整数,最小为1</div>
+					</el-form-item>
+                    <el-form-item class="form-submit">
+                        <el-button @click="onSave" :loading="saving" type="primary">
+                            保存
+                        </el-button>
+                        <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                            删除
+                        </el-button>
+                        <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+import { reg } from '../util/regRules';
+export default {
+	name: 'MetaBagAssetEffectConfigEdit',
+	created() {
+		if (this.$route.query.id) {
+			this.$http
+				.get('metaBagAssetEffectConfig/get/' + this.$route.query.id)
+				.then(res => {
+					this.formData = res;
+				})
+				.catch(e => {
+					console.log(e);
+					this.$message.error(e.error);
+				});
+		}
+	},
+	data() {
+		return {
+            reg,
+			saving: false,
+			formData: {},
+			rules: {
+				name: [
+					{
+						required: true,
+						message: '请输入NFT名称',
+						trigger: 'blur'
+					}
+				],
+				effectId: [
+					{
+						required: true,
+						message: '请输入特效',
+						trigger: 'blur'
+					},
+                    {
+						validator: (rule, value, callback) => {
+							if (!this.reg.test(value)) {
+								callback(new Error('特效必须为大于1的整数'));
+								return;
+							} else {
+								callback();
+							}
+						}
+					}
+				]
+			}
+		};
+	},
+	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('/metaBagAssetEffectConfig/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(`/metaBagAssetEffectConfig/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>

+ 149 - 0
src/main/vue/src/views/MetaBagAssetEffectConfigList.vue

@@ -0,0 +1,149 @@
+<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="name" align="center" label="NFT名称">
+            </el-table-column>
+            <el-table-column prop="effectId" align="center" label="特效">
+            </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>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <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: 'MetaBagAssetEffectConfigList',
+	mixins: [pageableTable],
+	data() {
+		return {
+			multipleMode: false,
+			search: '',
+			url: '/metaBagAssetEffectConfig/all',
+			downloading: false
+		};
+	},
+	computed: {
+		selection() {
+			return this.$refs.table.selection.map(i => i.id);
+		}
+	},
+	methods: {
+		beforeGetData() {
+			return { search: this.search, query: { del: false } };
+		},
+		toggleMultipleMode(multipleMode) {
+			this.multipleMode = multipleMode;
+			if (!multipleMode) {
+				this.$refs.table.clearSelection();
+			}
+		},
+		addRow() {
+			this.$router.push({
+				path: '/metaBagAssetEffectConfigEdit',
+				query: {
+					...this.$route.query
+				}
+			});
+		},
+		editRow(row) {
+			this.$router.push({
+				path: '/metaBagAssetEffectConfigEdit',
+				query: {
+					id: row.id
+				}
+			});
+		},
+		download() {
+			this.downloading = true;
+			this.$axios
+				.get('/metaBagAssetEffectConfig/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);
+				});
+		},
+		operation1() {
+			this.$notify({
+				title: '提示',
+				message: this.selection
+			});
+		},
+		operation2() {
+			this.$message('操作2');
+		},
+		deleteRow(row) {
+			this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+				.then(() => {
+					return this.$http.post(`/metaBagAssetEffectConfig/del/${row.id}`);
+				})
+				.then(() => {
+					this.$message.success('删除成功');
+					this.getData();
+				})
+				.catch(e => {
+					if (e !== 'cancel') {
+						this.$message.error(e.error);
+					}
+				});
+		}
+	}
+};
+</script>
+<style lang="less" scoped></style>

+ 120 - 0
src/main/vue/src/views/MetaProblemEdit.vue

@@ -0,0 +1,120 @@
+<template>
+    <div class="edit-view">
+        <page-title>
+            <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+            <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                删除
+            </el-button>
+            <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
+        </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="title" label="标题">
+                                    <el-input v-model="formData.title"></el-input>
+                        </el-form-item>
+                        <el-form-item prop="answer" label="答案">
+                                    <el-input v-model="formData.answer"></el-input>
+                        </el-form-item>
+                        <el-form-item prop="value" label="文件">
+                        <file-upload v-model="formData.value" :limit="1"></file-upload>
+                    </el-form-item>
+                    <el-form-item class="form-submit">
+                        <el-button @click="onSave" :loading="saving" type="primary">
+                            保存
+                        </el-button>
+                        <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                            删除
+                        </el-button>
+                        <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+    export default {
+        name: 'MetaProblemEdit',
+        created() {
+            if (this.$route.query.id) {
+                this.$http
+                    .get('metaProblem/get/' + this.$route.query.id)
+                    .then(res => {
+                        this.formData = res;
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.$message.error(e.error);
+                    });
+            }
+        },
+        data() {
+            return {
+                saving: false,
+                formData: {
+                },
+                rules: {
+                    title: [
+                    {
+                        required: true,
+                        message: '请输入标题',
+                        trigger: 'blur'
+                    }
+                ],
+                answer: [
+                    {
+                        required: true,
+                        message: '请输入答案',
+                        trigger: 'blur'
+                    }
+                ]
+                }
+            }
+        },
+        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('/metaProblem/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(`/metaProblem/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>

+ 185 - 0
src/main/vue/src/views/MetaProblemList.vue

@@ -0,0 +1,185 @@
+<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="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="title" label="标题"> </el-table-column>
+            <el-table-column prop="answer" label="答案"> </el-table-column>
+            <el-table-column prop="value" label="文件"> </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>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <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: 'MetaProblemList',
+    mixins: [pageableTable],
+    data() {
+        return {
+            multipleMode: false,
+            search: '',
+            url: '/metaProblem/all',
+            downloading: false
+        };
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        typeFormatter(row, column, cellValue, index) {
+            let selectedOption = this.typeOptions.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: '/metaProblemEdit',
+                query: {
+                    ...this.$route.query
+                }
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/metaProblemEdit',
+                query: {
+                    id: row.id
+                }
+            });
+        },
+        download() {
+            this.downloading = true;
+            this.$axios
+                .get('/metaProblem/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);
+                });
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/metaProblem/del/${row.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        this.$message.error(e.error);
+                    }
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+</style>

+ 126 - 107
src/main/vue/src/views/MetaResourcesEdit.vue

@@ -1,118 +1,137 @@
 <template>
-	<div class="edit-view">
-		<page-title>
-			<el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
-			<el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
-				删除
-			</el-button>
-			<el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
-		</page-title>
-		<div class="edit-view__content-wrapper">
-			<div class="edit-view__content-section">
-				<el-form :model="formData" :rules="rules" ref="form" label-width="82px" label-position="right" size="small"
-					style="max-width: 500px;">
-					<el-form-item prop="name" label="文件名称">
-						<el-input v-model="formData.name"></el-input>
-					</el-form-item>
-					<el-form-item prop="value" label="文件">
+    <div class="edit-view">
+        <page-title>
+            <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+            <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                删除
+            </el-button>
+            <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
+        </page-title>
+        <div class="edit-view__content-wrapper">
+            <div class="edit-view__content-section">
+                <el-form :model="formData" :rules="rules" ref="form" label-width="82px" label-position="right" size="small"
+                    style="max-width: 500px;">
+                    <el-form-item prop="name" label="文件名称">
+                        <el-input v-model="formData.name"></el-input>
+                    </el-form-item>
+                    <el-form-item prop="type" label="类型">
+                        <el-select v-model="formData.type" clearable filterable placeholder="请选择">
+                            <el-option v-for="item in typeOptions" :key="item.value" :label="item.label"
+                                :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item prop="value" label="文件">
                         <file-upload v-model="formData.value" :limit="1"></file-upload>
-					</el-form-item>
-					<el-form-item class="form-submit">
-						<el-button @click="onSave" :loading="saving" type="primary">
-							保存
-						</el-button>
-						<el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
-							删除
-						</el-button>
-						<el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
-					</el-form-item>
-				</el-form>
-			</div>
-		</div>
-	</div>
+                    </el-form-item>
+                    <el-form-item class="form-submit">
+                        <el-button @click="onSave" :loading="saving" type="primary">
+                            保存
+                        </el-button>
+                        <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                            删除
+                        </el-button>
+                        <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+        </div>
+    </div>
 </template>
 <script>
 export default {
-    name: 'MetaResourcesEdit',
-    created() {
-        if (this.$route.query.id) {
-            this.$http
-                .get('metaResources/get/' + this.$route.query.id)
-                .then(res => {
-                    this.formData = res;
-                })
-                .catch(e => {
-                    console.log(e);
-                    this.$message.error(e.error);
-                });
-        }
-    },
-    data() {
-        return {
-            saving: false,
-            formData: {},
-            rules: {
-                name: [
-                    {
-                        required: true,
-                        message: '请输入名称',
+	name: 'MetaResourcesEdit',
+	created() {
+		if (this.$route.query.id) {
+			this.$http
+				.get('metaResources/get/' + this.$route.query.id)
+				.then(res => {
+					this.formData = res;
+				})
+				.catch(e => {
+					console.log(e);
+					this.$message.error(e.error);
+				});
+		}
+	},
+	data() {
+		return {
+			saving: false,
+            type: '',
+			typeOptions: [{ label: '党建一楼', value: 'PARTY_ONE' },
+			{ label: '党建二楼', value: 'PARTY_TWO' },
+			{ label: '党建三楼', value: 'PARTY_THREE' }
+		],
+			formData: {},
+			rules: {
+				name: [
+					{
+						required: true,
+						message: '请输入名称',
+						trigger: 'blur'
+					}
+				],
+				type: [
+                    { 
+                        required: true, 
+                        message: '请选择类型',
                         trigger: 'blur'
-                    }
+                     }
                 ],
-                value: [
-                    {
-                        required: true,
-                        message: '请上传文件',
-                        trigger: 'blur'
-                    }
-                ]
-            }
-        };
-    },
-    methods: {
-        onSave() {
-            this.$refs.form.validate(valid => {
-                if (valid) {
-                    this.submit();
-                } else {
-                    return false;
-                }
-            });
-        },
-        submit() {
-            let data = { ...this.formData };
+				value: [
+					{
+						required: true,
+						message: '请上传文件',
+						trigger: 'blur'
+					}
+				]
+			}
+		};
+	},
+	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('/metaResources/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(`/metaResources/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 || '删除失败');
-                    }
-                });
-        }
-    }
+			this.saving = true;
+			this.$http
+				.post('/metaResources/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(`/metaResources/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>

+ 11 - 1
src/main/vue/src/views/MetaResourcesList.vue

@@ -11,6 +11,9 @@
 			</el-button>
 		</page-title>
 		<div class="filters-container">
+            <el-select v-model="type" clearable placeholder="请选择类型" @change="getData">
+                <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
+            </el-select>
 			<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>
@@ -23,6 +26,7 @@
 			</el-table-column>
 			<el-table-column prop="name" label="文件名称" width="300" align="center">
 			</el-table-column>
+            <el-table-column prop="type" align="center" label="类型" :formatter="typeFormatter"> </el-table-column>
             <el-table-column prop="value" label="文件地址" align="center">
 			</el-table-column>
 			<el-table-column label="操作" align="center" fixed="right" width="150">
@@ -50,8 +54,14 @@ export default {
     mixins: [pageableTable],
     data() {
         return {
+            type: '',
             multipleMode: false,
             search: '',
+            typeOptions: [
+                { label: '党建一楼', value: 'PARTY_ONE' },
+                { label: '党建二楼', value: 'PARTY_TWO' },
+                { label: '党建三楼', value: 'PARTY_THREE' }
+            ],
             url: '/metaResources/all',
             downloading: false
         };
@@ -70,7 +80,7 @@ export default {
             return '';
         },
         beforeGetData() {
-            return { search: this.search, query: { del: false } };
+            return { search: this.search, query: { del: false ,type: this.type} };
         },
         toggleMultipleMode(multipleMode) {
             this.multipleMode = multipleMode;

+ 110 - 131
src/main/vue/src/views/NeteaseMessageList.vue

@@ -1,56 +1,46 @@
 <template>
-    <div  class="list-view">
+    <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
+                @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"
+                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="id" label="ID" width="100">
-            </el-table-column>
-                                <el-table-column prop="from" label="发送用户"
->
-                    </el-table-column>
-                    <el-table-column prop="to" label="收信用户"
->
-                    </el-table-column>
-                    <el-table-column prop="ope" label="发信类型"
->
-                    </el-table-column>
-                    <el-table-column prop="type" label="信息类型"
->
-                    </el-table-column>
-                    <el-table-column prop="body" label="信息主题"
->
-                    </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>
+        <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="id" label="ID" width="100"> </el-table-column>
+            <el-table-column prop="fromId" label="发送用户"> </el-table-column>
+            <el-table-column prop="ope" label="发信类型"> </el-table-column>
+            <el-table-column prop="type" label="信息类型"> </el-table-column>
+            <el-table-column prop="body" label="信息主题"> </el-table-column>
+            <el-table-column label="操作" align="center" fixed="right" width="150">
+                <template slot-scope="{ row }">
                     <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
                 </template>
             </el-table-column>
@@ -64,112 +54,101 @@
                     <el-button @click="toggleMultipleMode(false)">取消</el-button>
                 </el-button-group>
             </div> -->
-            <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
+                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";
+import { mapState } from 'vuex';
+import pageableTable from '@/mixins/pageableTable';
 
-    export default {
-        name: 'NeteaseMessageList',
-        mixins: [pageableTable],
-        data() {
-            return {
-                multipleMode: false,
-                search: "",
-                url: "/neteaseMessage/all",
-                downloading: false,
-            }
+export default {
+    name: 'NeteaseMessageList',
+    mixins: [pageableTable],
+    data() {
+        return {
+            multipleMode: false,
+            body: '',
+            search: '',
+            url: '/neteaseMessage/all',
+            downloading: false
+        };
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        beforeGetData() {
+            return { search: this.search, query: { del: false, toId: this.$route.query.toId } };
         },
-        computed: {
-            selection() {
-                return this.$refs.table.selection.map(i => i.id);
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
             }
         },
-        methods: {
-            beforeGetData() {
-                return { search: this.search, query: { del: false } };
-            },
-            toggleMultipleMode(multipleMode) {
-                this.multipleMode = multipleMode;
-                if (!multipleMode) {
-                    this.$refs.table.clearSelection();
-                }
-            },
-            addRow() {
-                this.$router.push({
-                    path: "/neteaseMessageEdit",
-                    query: {
-                        ...this.$route.query
-                    }
-                });
-            },
-            editRow(row) {
-                this.$router.push({
-                    path: "/neteaseMessageEdit",
-                    query: {
-                    id: row.id
-                    }
-                });
-            },
-            download() {
-                this.downloading = true;
-                this.$axios
-                    .get("/neteaseMessage/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);
-                    });
-            },
-            operation1() {
-                this.$notify({
-                    title: '提示',
-                    message: this.selection
+        download() {
+            this.downloading = true;
+            this.$axios
+                .get('/neteaseMessage/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);
                 });
-            },
-            operation2() {
-                this.$message('操作2');
-            },
-            deleteRow(row) {
-                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
-                    return this.$http.post(`/neteaseMessage/del/${row.id}`)
-                }).then(() => {
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/neteaseMessage/del/${row.id}`);
+                })
+                .then(() => {
                     this.$message.success('删除成功');
                     this.getData();
-                }).catch(e => {
+                })
+                .catch(e => {
                     if (e !== 'cancel') {
                         this.$message.error(e.error);
                     }
-                })
-            },
+                });
         }
     }
+};
 </script>
 <style lang="less" scoped>
 </style>

+ 10 - 1
src/main/vue/src/views/TeamList.vue

@@ -68,8 +68,9 @@
                 label="操作"
                 align="center"
                 fixed="right"
-                width="300">
+                width="350">
                 <template slot-scope="{row}">
+                    <el-button @click="NeteaseMessageList(row)" type="primary" size="mini" plain>聊天记录</el-button>
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
                     <el-button @click="mute(row)" v-if="row.mute === false" type="danger" size="mini" plain>群禁言
                     </el-button>
@@ -328,6 +329,14 @@ export default {
                 }
             });
         },
+        NeteaseMessageList(row) {
+            this.$router.push({
+                path: "/NeteaseMessageList",
+                query: {
+                    toId: row.tid
+                }
+            });
+        },
         download() {
             this.downloading = true;
             this.$axios