Przeglądaj źródła

Merge branch 'master' of http://git.izouma.com/xiongzhu/raex_back into dev-mata-ldz

lidongze 3 lat temu
rodzic
commit
916959e335
100 zmienionych plików z 1654 dodań i 116 usunięć
  1. 12 0
      pom.xml
  2. 41 0
      src/main/java/com/izouma/nineth/config/RiceScheduledTasksConfig.java
  3. 9 0
      src/main/java/com/izouma/nineth/domain/Asset.java
  4. 7 2
      src/main/java/com/izouma/nineth/domain/Collection.java
  5. 64 0
      src/main/java/com/izouma/nineth/domain/Rice.java
  6. 32 0
      src/main/java/com/izouma/nineth/domain/RiceInvite.java
  7. 38 0
      src/main/java/com/izouma/nineth/domain/RiceOperationRecord.java
  8. 46 0
      src/main/java/com/izouma/nineth/domain/RiceTask.java
  9. 32 0
      src/main/java/com/izouma/nineth/domain/RiceUserWaterDropRecord.java
  10. 33 0
      src/main/java/com/izouma/nineth/dto/R.java
  11. 25 0
      src/main/java/com/izouma/nineth/dto/RiceDTO.java
  12. 24 0
      src/main/java/com/izouma/nineth/dto/RiceGameListDTO.java
  13. 17 0
      src/main/java/com/izouma/nineth/dto/TouristDTO.java
  14. 20 0
      src/main/java/com/izouma/nineth/enums/MetaSize.java
  15. 21 0
      src/main/java/com/izouma/nineth/enums/RiceOperationType.java
  16. 5 1
      src/main/java/com/izouma/nineth/repo/AssetRepo.java
  17. 2 0
      src/main/java/com/izouma/nineth/repo/CollectionRepo.java
  18. 1 1
      src/main/java/com/izouma/nineth/repo/DomainOrderRepo.java
  19. 24 0
      src/main/java/com/izouma/nineth/repo/RiceInviteRepo.java
  20. 16 0
      src/main/java/com/izouma/nineth/repo/RiceOperationRecordRepo.java
  21. 36 0
      src/main/java/com/izouma/nineth/repo/RiceRepo.java
  22. 19 0
      src/main/java/com/izouma/nineth/repo/RiceUserWaterDropRecordRepo.java
  23. 1 2
      src/main/java/com/izouma/nineth/repo/netease/NeteaseMessageRepo.java
  24. 1 0
      src/main/java/com/izouma/nineth/security/WebSecurityConfig.java
  25. 53 17
      src/main/java/com/izouma/nineth/service/AssetService.java
  26. 115 73
      src/main/java/com/izouma/nineth/service/DomainOrderService.java
  27. 1 1
      src/main/java/com/izouma/nineth/service/OrderCancelService.java
  28. 1 1
      src/main/java/com/izouma/nineth/service/OrderService.java
  29. 20 0
      src/main/java/com/izouma/nineth/service/RiceInviteService.java
  30. 20 0
      src/main/java/com/izouma/nineth/service/RiceOperationRecordService.java
  31. 403 0
      src/main/java/com/izouma/nineth/service/RiceService.java
  32. 20 0
      src/main/java/com/izouma/nineth/service/RiceUserWaterDropRecordService.java
  33. 29 3
      src/main/java/com/izouma/nineth/web/AssetController.java
  34. 3 4
      src/main/java/com/izouma/nineth/web/CompanyController.java
  35. 181 0
      src/main/java/com/izouma/nineth/web/RiceController.java
  36. 115 0
      src/main/java/com/izouma/nineth/web/RiceInviteController.java
  37. 41 0
      src/main/java/com/izouma/nineth/web/RiceMonkeyTextController.java
  38. 60 0
      src/main/java/com/izouma/nineth/web/RiceOperationRecordController.java
  39. 60 0
      src/main/java/com/izouma/nineth/web/RiceUserWaterDropRecordController.java
  40. 3 7
      src/main/java/com/izouma/nineth/web/netease/NeteaseMessageController.java
  41. BIN
      src/main/resources/font/尔雅荣耀手书.ttf
  42. BIN
      src/main/resources/static/img/png_baijiaxing.png
  43. 0 0
      src/main/resources/static/web-mobile/assets/main/config.json
  44. 0 1
      src/main/resources/static/web-mobile/assets/main/import/03/0344b9548.json
  45. 1 0
      src/main/resources/static/web-mobile/assets/main/import/05/0540da930.json
  46. 1 1
      src/main/resources/static/web-mobile/assets/main/import/05/05ec77bf4.json
  47. 0 0
      src/main/resources/static/web-mobile/assets/main/import/06/06c153673.json
  48. 0 0
      src/main/resources/static/web-mobile/assets/main/import/0b/0bc88cdd2.json
  49. BIN
      src/main/resources/static/web-mobile/assets/main/import/1e/1e604f29-bddb-4bb8-8f9e-0f3065b1358a.cconb
  50. BIN
      src/main/resources/static/web-mobile/assets/main/import/2a/2ac81863-7f8a-4be6-b06c-96d5b519afc2.cconb
  51. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@02016.cconb
  52. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@07a3e.cconb
  53. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@17666.cconb
  54. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@1af55.cconb
  55. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@21875.cconb
  56. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@36c80.cconb
  57. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@3d5e2.cconb
  58. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@3e5d4.cconb
  59. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@3f405.cconb
  60. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@404b8.cconb
  61. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@44e7a.cconb
  62. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@4ae73.cconb
  63. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@4f967.cconb
  64. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@5413d.cconb
  65. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@5ef9c.cconb
  66. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@5f48d.cconb
  67. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@613ad.cconb
  68. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@62bb3.cconb
  69. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@6c96e.cconb
  70. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@73130.cconb
  71. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@78636.cconb
  72. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@817c6.cconb
  73. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@8e375.cconb
  74. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@8e9b3.cconb
  75. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@93caa.cconb
  76. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@982bc.cconb
  77. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@9e3a0.cconb
  78. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@9e898.cconb
  79. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@a9caa.cconb
  80. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@af7c0.cconb
  81. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@b9a95.cconb
  82. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@bec08.cconb
  83. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@c4533.cconb
  84. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@c6ca8.cconb
  85. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@d2bce.cconb
  86. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@da32c.cconb
  87. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e06cb.cconb
  88. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e1bfd.cconb
  89. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e4755.cconb
  90. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e5c73.cconb
  91. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e6997.cconb
  92. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e73b9.cconb
  93. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@ef784.cconb
  94. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@f3d06.cconb
  95. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@fd535.cconb
  96. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@ffbb9.cconb
  97. BIN
      src/main/resources/static/web-mobile/assets/main/import/58/5837fe81-a1e1-4794-9f8d-13ff782cae61.cconb
  98. 1 2
      src/main/resources/static/web-mobile/assets/main/index.js
  99. BIN
      src/main/resources/static/web-mobile/assets/main/native/12/1263d74c-8167-4928-91a6-4e2672411f47@2e76e.bin
  100. BIN
      src/main/resources/static/web-mobile/assets/main/native/17/171041e0-05a7-4607-ba5c-cde3e1fe7141.jpg

+ 12 - 0
pom.xml

@@ -579,6 +579,18 @@
             <artifactId>javase</artifactId>
             <version>3.3.0</version>
         </dependency>
+
+        <dependency>
+            <groupId>javax.json</groupId>
+            <artifactId>javax.json-api</artifactId>
+            <version>1.1.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.glassfish</groupId>
+            <artifactId>javax.json</artifactId>
+            <version>1.1.4</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 41 - 0
src/main/java/com/izouma/nineth/config/RiceScheduledTasksConfig.java

@@ -0,0 +1,41 @@
+package com.izouma.nineth.config;
+
+
+import com.izouma.nineth.domain.Rice;
+import com.izouma.nineth.domain.RiceInvite;
+import com.izouma.nineth.repo.RiceInviteRepo;
+import com.izouma.nineth.repo.RiceRepo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import java.util.List;
+
+@Configuration
+@EnableScheduling
+public class RiceScheduledTasksConfig {
+    @Autowired
+    private RiceRepo riceRepo;
+
+    @Autowired
+    private RiceInviteRepo riceInviteRepo;
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void InviteExchangeCount() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setInviteCount(0);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetExchangeCount() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setExchangeCount(0);
+        }
+        riceRepo.saveAll(riceList);
+    }
+}

+ 9 - 0
src/main/java/com/izouma/nineth/domain/Asset.java

@@ -10,6 +10,7 @@ import com.izouma.nineth.converter.PropertyListConverter;
 import com.izouma.nineth.enums.AssetSource;
 import com.izouma.nineth.enums.AssetStatus;
 import com.izouma.nineth.enums.CollectionType;
+import com.izouma.nineth.enums.MetaSize;
 import com.izouma.nineth.utils.CollectionTagSerializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -240,10 +241,17 @@ public class Asset extends CollectionBaseEntity {
     @Column(columnDefinition = "int default 3 not null")
     private int chainFlag;
 
+    @Transient
+    private LocalDateTime endTime;
+
     @Transient
     @ApiModelProperty("元宇宙展厅是否上架")
     private boolean metaPutOn;
 
+    @ApiModelProperty("元宇宙尺寸")
+    @Enumerated(EnumType.STRING)
+    private MetaSize metaSize;
+
     public static Asset create(Collection collection, User user) {
         Set<Tag> tags;
         if (collection.getTags() != null) {
@@ -285,6 +293,7 @@ public class Asset extends CollectionBaseEntity {
                 .empower(collection.getEmpower())
                 .companyId(collection.getCompanyId())
                 .chainFlag(collection.getChainFlag())
+                .metaSize(collection.getMetaSize())
                 .build();
     }
 

+ 7 - 2
src/main/java/com/izouma/nineth/domain/Collection.java

@@ -10,6 +10,7 @@ import com.izouma.nineth.converter.PrivilegeListConverter;
 import com.izouma.nineth.converter.PropertyListConverter;
 import com.izouma.nineth.enums.CollectionSource;
 import com.izouma.nineth.enums.CollectionType;
+import com.izouma.nineth.enums.MetaSize;
 import com.izouma.nineth.utils.CollectionTagSerializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -271,10 +272,10 @@ public class Collection extends CollectionBaseEntity {
     @Column(columnDefinition = "TEXT")
     private String rule;
 
-    private String     hcTxHash;
+    private String hcTxHash;
     private BigInteger hcBlockNumber;
     private BigInteger hcGasUsed;
-    private String     hcTokenId;
+    private String hcTokenId;
 
     @ApiModelProperty("系列名称")
     @Column(length = 100)
@@ -304,4 +305,8 @@ public class Collection extends CollectionBaseEntity {
     private LocalDateTime newsCreatedTime;
 
     private boolean messNumber;
+
+    @ApiModelProperty("元宇宙尺寸")
+    @Enumerated(EnumType.STRING)
+    private MetaSize metaSize;
 }

+ 64 - 0
src/main/java/com/izouma/nineth/domain/Rice.java

@@ -0,0 +1,64 @@
+package com.izouma.nineth.domain;
+
+
+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;
+import javax.persistence.Transient;
+
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("水稻")
+public class Rice extends BaseEntity {
+
+    @ApiModelProperty("用户ID")
+    @Column(name = "user_id")
+    private Long userId;
+
+    @ApiModelProperty("头像")
+    private String avatar;
+
+    @ApiModelProperty("昵称")
+    private String nickname;
+
+    @ApiModelProperty("等级")
+    private Long level;
+
+    @ApiModelProperty("水滴次数")
+    private Long waterDropCount;
+
+    @ApiModelProperty("签到次数")
+    private Long signCount;
+
+    @ApiModelProperty("上次签到时间")
+    private Long lastSignInTime;
+
+
+    @ApiModelProperty("当前用户积分")
+    private Long selfScore;
+
+    @ApiModelProperty("当前用户活动积分")
+    private Long selfActivityScore;
+
+
+
+    @ApiModelProperty("经验值")
+    private Long EmpiricalValue;
+
+    @Column(name = "exchange_count", columnDefinition = "int(11) DEFAULT 0 COMMENT '今日已兑换次数'")
+    private Integer exchangeCount;
+
+    @Column(name = "Invite_count", columnDefinition = "int(11) DEFAULT 0 COMMENT '今日已邀请次数'")
+    private Integer InviteCount = 0;
+
+
+
+}

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

@@ -0,0 +1,32 @@
+package com.izouma.nineth.domain;
+
+
+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;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("邀请")
+public class RiceInvite  extends BaseEntity {
+
+
+    @ApiModelProperty("邀请人id")
+    private Long inviterId;
+
+    @ApiModelProperty("被邀请人id")
+    private Long inviteeId;
+
+    @ApiModelProperty("时间")
+    private Long createTime;
+
+
+
+}

+ 38 - 0
src/main/java/com/izouma/nineth/domain/RiceOperationRecord.java

@@ -0,0 +1,38 @@
+package com.izouma.nineth.domain;
+
+
+import com.izouma.nineth.enums.OperationType;
+import com.izouma.nineth.enums.RiceOperationType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("操作记录表")
+public class RiceOperationRecord extends BaseEntity {
+
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    @ApiModelProperty("类型:水滴,活动积分,积分,经验值")
+    @Enumerated(EnumType.STRING)
+    private RiceOperationType type;
+
+    @ApiModelProperty("数量")
+    private Long amount;
+
+    @ApiModelProperty("操作前的数量")
+    private Long beforeAmount;
+
+    @ApiModelProperty("操作后的数量")
+    private Long afterAmount;
+}

+ 46 - 0
src/main/java/com/izouma/nineth/domain/RiceTask.java

@@ -0,0 +1,46 @@
+package com.izouma.nineth.domain;
+
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+
+/**
+ * id:任务的唯一标识,使用自增长主键。
+ * name:任务的名称。
+ * description:任务的描述。
+ * type:任务的类型,例如签到任务、邀请任务、积分兑换任务等。
+ * score:任务完成后可以获得的积分数。
+ * maxTimesPerDay:每天最多可以完成的次数。
+ * lastResetTime:最近一次重置任务的时间戳,用于判断是否需要重置任务进度。
+ * 这个实体类还可以根据实际情况进行扩展,例如可以增加任务的开始时间、结束时间等字段。
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("水稻定时任务")
+public class RiceTask extends BaseEntity {
+
+    @Column(name = "name")
+    private String name;
+
+    @Column(name = "description")
+    private String description;
+
+    @Column(name = "type")
+    private String type;
+
+    @Column(name = "score")
+    private Integer score;
+
+    @Column(name = "max_times_per_day")
+    private Integer maxTimesPerDay;
+
+    @Column(name = "last_reset_time")
+    private Long lastResetTime;
+}

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

@@ -0,0 +1,32 @@
+package com.izouma.nineth.domain;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+@Entity
+@Table(name = "rice_user_water_drop_record")
+@Data
+public class RiceUserWaterDropRecord extends BaseEntity {
+
+
+    @Column(name = "user_id")
+    private Long userId;
+
+    @Column(name = "watering_time")
+    private LocalDateTime wateringTime;
+
+    public boolean isToday() {
+        return wateringTime.toLocalDate().equals(LocalDate.now());
+    }
+}
+
+
+
+
+
+
+
+

+ 33 - 0
src/main/java/com/izouma/nineth/dto/R.java

@@ -0,0 +1,33 @@
+package com.izouma.nineth.dto;
+
+import lombok.Data;
+import java.util.HashMap;
+import java.util.Map;
+/**
+ * 通用返回结果,服务端响应的数据最终都会封装成此对象
+ * @param <T>
+ */
+@Data
+public class R<T> {
+    private Integer code; //编码:1成功,0和其它数字为失败
+    private String msg; //错误信息
+    private T data; //数据
+    private Map map = new HashMap(); //动态数据
+    public static <T> R<T> success(T object) {
+        R<T> r = new R<T>();
+        r.data = object;
+        r.code = 1;
+        return r;
+    }
+    public static <T> R<T> error(String msg) {
+        R r = new R();
+        r.msg = msg;
+        r.code = 0;
+        return r;
+    }
+    public R<T> add(String key, Object value) {
+        this.map.put(key, value);
+        return this;
+    }
+
+}

+ 25 - 0
src/main/java/com/izouma/nineth/dto/RiceDTO.java

@@ -0,0 +1,25 @@
+package com.izouma.nineth.dto;
+
+
+import com.izouma.nineth.domain.Rice;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+
+@Data
+public class RiceDTO extends Rice {
+
+
+    @ApiModelProperty("当前用户排行")
+    @Column(name = "score_rank")
+    private Integer scoreRank;
+
+
+    @ApiModelProperty("是否上榜")
+    private boolean isOnTop100;
+
+    @ApiModelProperty("离上榜还差多少名")
+    private int rankGap;
+
+}

+ 24 - 0
src/main/java/com/izouma/nineth/dto/RiceGameListDTO.java

@@ -0,0 +1,24 @@
+package com.izouma.nineth.dto;
+
+
+import com.izouma.nineth.domain.Rice;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class RiceGameListDTO {
+
+
+    @ApiModelProperty("当前用户排名")
+    private Long selfRank;
+
+    @ApiModelProperty("积分top50")
+    private List<Rice> data;
+
+}

+ 17 - 0
src/main/java/com/izouma/nineth/dto/TouristDTO.java

@@ -0,0 +1,17 @@
+package com.izouma.nineth.dto;
+
+import lombok.Data;
+import org.apache.commons.lang3.RandomStringUtils;
+
+@Data
+public class TouristDTO {
+
+    private String nickName;
+
+    private Long userId;
+
+    public TouristDTO() {
+        this.nickName = "游客-" + RandomStringUtils.randomAlphabetic(8);
+        this.userId = 999999L;
+    }
+}

+ 20 - 0
src/main/java/com/izouma/nineth/enums/MetaSize.java

@@ -0,0 +1,20 @@
+package com.izouma.nineth.enums;
+
+public enum MetaSize {
+
+    ONE_ONE("1:1"),
+
+    NINE_SIXTEEN("9:16"),
+
+    SIXTEEN_NINE("16:9");
+
+    private final String description;
+
+    MetaSize(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 21 - 0
src/main/java/com/izouma/nineth/enums/RiceOperationType.java

@@ -0,0 +1,21 @@
+package com.izouma.nineth.enums;
+
+public enum RiceOperationType {
+    WATER_DROP("水滴类型"),
+    SELF_SCORE("积分类型"),
+    EMPIRICAL_VALUE("经验值类型"),
+    SELF_ACTIVITY_SCORE("活动积分类型");
+
+
+
+
+    private final String description;
+
+    RiceOperationType(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 5 - 1
src/main/java/com/izouma/nineth/repo/AssetRepo.java

@@ -33,7 +33,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);
 
@@ -111,6 +111,10 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
             "and status = 'NORMAL' limit 1")
     Long findDiscount(Long userId, Collection<Long> ids);
 
+    @Query(nativeQuery = true, value = "select collection_id from asset where user_id = ?1 and collection_id in ?2 " +
+            "and status = 'NORMAL'")
+    Set<Long> findDiscounts(Long userId, Collection<Long> ids);
+
     List<Asset> findByStatus(AssetStatus status);
 
     List<Asset> findAllByUserIdAndTypeAndOpenedAndCompanyId(Long userId, CollectionType type, Boolean opened, Long companyId);

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

@@ -126,6 +126,8 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
 
     List<Collection> findByNameLike(String name);
 
+    List<Collection> findAllByPrefixNameAndDelFalse(String prefix);
+
     List<Collection> findByStockGreaterThan(int stock);
 
     @Query("update Collection c set c.stock = ?2 where c.id = ?1")

+ 1 - 1
src/main/java/com/izouma/nineth/repo/DomainOrderRepo.java

@@ -26,7 +26,7 @@ public interface DomainOrderRepo extends JpaRepository<DomainOrder, Long>, JpaSp
 
     Page<DomainOrder> findAllByOrderStatusOrderByCreatedAtDesc(OrderStatus status, Pageable pageable);
 
-    DomainOrder findByDomainNameAndOrderStatus(String name, OrderStatus status);
+    DomainOrder findFirstByDomainNameAndOrderStatus(String name, OrderStatus status);
 
     List<DomainOrder> findAllByStatusAndCreatedAtBeforeAndOrderStatus(CollectionStatus status, LocalDateTime endTime, OrderStatus orderStatus);
 

+ 24 - 0
src/main/java/com/izouma/nineth/repo/RiceInviteRepo.java

@@ -0,0 +1,24 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.Invite;
+import com.izouma.nineth.domain.RiceInvite;
+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.Optional;
+
+public interface RiceInviteRepo extends JpaRepository<RiceInvite, Long>, JpaSpecificationExecutor<RiceInvite> {
+    @Query("update RiceInvite t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+
+
+
+    Optional<RiceInvite> findByInviterIdAndInviteeId(Long inviterId, Long inviteeId);
+
+    Optional<RiceInvite> findByInviteeId(Long inviteeId);
+}

+ 16 - 0
src/main/java/com/izouma/nineth/repo/RiceOperationRecordRepo.java

@@ -0,0 +1,16 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.RiceOperationRecord;
+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;
+
+public interface RiceOperationRecordRepo extends JpaRepository<RiceOperationRecord, Long>, JpaSpecificationExecutor<RiceOperationRecord> {
+    @Query("update RiceOperationRecord t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+}

+ 36 - 0
src/main/java/com/izouma/nineth/repo/RiceRepo.java

@@ -0,0 +1,36 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.Rice;
+import io.lettuce.core.dynamic.annotation.Param;
+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;
+import java.util.Optional;
+
+public interface RiceRepo extends JpaRepository<Rice, Long>, JpaSpecificationExecutor<Rice> {
+    @Query("update Rice t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+
+    @Query(value = "select * from rice  where user_id = ?1 ", nativeQuery = true)
+    Optional<Rice> findByUserId(Long userId);
+
+
+
+    @Query("update Rice t set t.nickname = ?2 where t.userId = ?1")
+    @Modifying
+    @Transactional
+    void updateNickName(Long userId, String nickname);
+
+
+
+    @Query("SELECT COUNT(r) + 1 FROM Rice r WHERE r.selfScore > :score")
+    Integer findRankByScore(@Param("score") Long score);
+
+    List<Rice> findTop100ByOrderBySelfScoreDesc();
+}

+ 19 - 0
src/main/java/com/izouma/nineth/repo/RiceUserWaterDropRecordRepo.java

@@ -0,0 +1,19 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.RiceUserWaterDropRecord;
+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 RiceUserWaterDropRecordRepo extends JpaRepository<RiceUserWaterDropRecord, Long>, JpaSpecificationExecutor<RiceUserWaterDropRecord> {
+    @Query("update RiceUserWaterDropRecord t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+
+    List<RiceUserWaterDropRecord> findByUserId(Long userId);
+}

+ 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);
 

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

@@ -178,6 +178,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/metaVisitor/save").permitAll()
                 .antMatchers("/gpt3/**").permitAll()
                 .antMatchers("/metaSwitch/*/findSwitch").permitAll()
+                .antMatchers("/news/newsInfo").permitAll()
                 .antMatchers("/metaResources/getUrl").permitAll()
                 .antMatchers("/news/newsInfo").permitAll()
                 .antMatchers("/metaResources/like").permitAll()

+ 53 - 17
src/main/java/com/izouma/nineth/service/AssetService.java

@@ -49,6 +49,8 @@ import java.util.*;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ForkJoinPool;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 @Service
@@ -273,10 +275,17 @@ public class AssetService {
                 asset.setPrefixName("RIDN6");
             }
         } else {
-            if (domainOrder.getPicName().length() < 6) {
-                asset.setPrefixName("RID" + domainOrder.getPicName().length());
+            Pattern p;
+            p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
+            Matcher m = p.matcher(domainOrder.getPicName());
+            if (m.find()) {
+                asset.setPrefixName("RIDC");
             } else {
-                asset.setPrefixName("RID");
+                if (domainOrder.getPicName().length() < 6) {
+                    asset.setPrefixName("RID" + domainOrder.getPicName().length());
+                } else {
+                    asset.setPrefixName("RID");
+                }
             }
         }
         asset.setTags(new HashSet<>());
@@ -1078,22 +1087,23 @@ public class AssetService {
             if (tags.isEmpty()) return new PageImpl<>(Collections.emptyList());
             return assetRepo.findAll((Specification<Asset>) (root, query, criteriaBuilder) ->
                     query.distinct(true).where(
-                                    // where userId=some id
-                                    criteriaBuilder.equal(root.get("userId"), userId),
-                                    // and (lockTo is null or (lockTo is not null and lockTo < now))
-                                    criteriaBuilder.or(criteriaBuilder.isNull(root.get("lockTo")),
-                                            criteriaBuilder.and(criteriaBuilder.isNotNull(root.get("lockTo")),
-                                                    criteriaBuilder.lessThan(root.get("lockTo"), LocalDateTime.now()))),
-                                    // and status = 'NORMAL'
-                                    criteriaBuilder.equal(root.get("status"), AssetStatus.NORMAL),
-
-                                    criteriaBuilder.equal(root.get("consignment"), false),
-                                    // and has some tagId
-                                    root.join("tags").get("id").in(tags.stream().map(Tag::getId).toArray()))
+                            // where userId=some id
+                            criteriaBuilder.equal(root.get("userId"), userId),
+                            // and (lockTo is null or (lockTo is not null and lockTo < now))
+                            criteriaBuilder.or(criteriaBuilder.isNull(root.get("lockTo")),
+                                    criteriaBuilder.and(criteriaBuilder.isNotNull(root.get("lockTo")),
+                                            criteriaBuilder.lessThan(root.get("lockTo"), LocalDateTime.now()))),
+                            // and status = 'NORMAL'
+                            criteriaBuilder.equal(root.get("status"), AssetStatus.NORMAL),
+
+                            criteriaBuilder.equal(root.get("consignment"), false),
+                            // and has some tagId
+                            root.join("tags").get("id").in(tags.stream().map(Tag::getId).toArray()))
                             .getRestriction(), pageable);
         } else {
-            return assetRepo.findByUserIdAndStatusAndCompanyIdAndNameLikeAndConsignment(userId, AssetStatus.NORMAL, companyId,
-                    "%" + commonMatchDTO.getCollectionName() + "%", pageable, false);
+            return assetRepo
+                    .findByUserIdAndStatusAndCompanyIdAndNameLikeAndConsignment(userId, AssetStatus.NORMAL, companyId,
+                            "%" + commonMatchDTO.getCollectionName() + "%", pageable, false);
         }
     }
 
@@ -1266,6 +1276,32 @@ public class AssetService {
         return servicecharge;
     }
 
+    public double getDomainServiceCharge(Long userId) {
+//        if (servicecharge == 3) {
+//            return 3;
+//        }
+//        LongArrayConverter converter = new LongArrayConverter();
+//        String discountMinter = sysConfigService.getString("discount_minter");
+//        List<Long> minterIds = converter.convertToEntityAttribute(discountMinter);
+//        if (minterIds.contains(minterId)) {
+        String discountCollection = sysConfigService.getString("domain_discount");
+        JSONObject json = JSONObject.parseObject(discountCollection);
+        Set<String> keys = json.keySet();
+        List<Long> collectionIds = keys.stream().map(Long::parseLong).collect(Collectors.toList());
+        Set<Long> holdCollections = assetRepo.findDiscounts(userId, collectionIds);
+        double result = sysConfigService.getBigDecimal("domain_service_charge").doubleValue();
+        if (holdCollections.size() > 0) {
+            for (Long id : holdCollections) {
+                double discount = json.getDouble(id.toString());
+                if (discount < result) {
+                    result = discount;
+                }
+            }
+        }
+//        }
+        return result;
+    }
+
 
     @Async
     public void hcChain() throws ExecutionException, InterruptedException {

+ 115 - 73
src/main/java/com/izouma/nineth/service/DomainOrderService.java

@@ -88,7 +88,13 @@ public class DomainOrderService {
         if (StringUtils.isEmpty(str)) {
             throw new BusinessException("sms context is empty!");
         }
-        Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
+        boolean canChinese = sysConfigService.getBoolean("domain_sc");
+        Pattern p;
+        if (!canChinese) {
+            p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
+        } else {
+            p = Pattern.compile("[\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
+        }
         Matcher m = p.matcher(str);
         return m.find();
     }
@@ -378,36 +384,60 @@ public class DomainOrderService {
         } else {
             domainName = domain.toUpperCase();
         }
-        InputStream is1 = this.getClass()
-                .getResourceAsStream("/font/VonwaonBitmap_16pxLite.ttf");
-        Font font1 = Font.createFont(Font.TRUETYPE_FONT, is1);
-        is1.close();
-        InputStream is2 = this.getClass()
-                .getResourceAsStream("/font/VonwaonBitmap_12pxLite.ttf");
-        Font font2 = Font.createFont(Font.TRUETYPE_FONT, is2);
-        is2.close();
+        Pattern p;
+        p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
+        Matcher m = p.matcher(domain);
+        boolean chinese = m.find();
+        Font font1;
+        Font font2;
+        if (!chinese) {
+            InputStream is1 = this.getClass()
+                    .getResourceAsStream("/font/VonwaonBitmap_16pxLite.ttf");
+            font1 = Font.createFont(Font.TRUETYPE_FONT, is1);
+            is1.close();
+            InputStream is2 = this.getClass()
+                    .getResourceAsStream("/font/VonwaonBitmap_12pxLite.ttf");
+            font2 = Font.createFont(Font.TRUETYPE_FONT, is2);
+            is2.close();
+        } else {
+            InputStream is1 = this.getClass()
+                    .getResourceAsStream("/font/尔雅荣耀手书.ttf");
+            font1 = Font.createFont(Font.TRUETYPE_FONT, is1);
+            is1.close();
+            InputStream is2 = this.getClass()
+                    .getResourceAsStream("/font/尔雅荣耀手书.ttf");
+            font2 = Font.createFont(Font.TRUETYPE_FONT, is2);
+            is2.close();
+        }
+
         int length = domainName.length();
         BufferedImage shareImg;
-        if (length == 1) {
-            InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_jing.png");
-            shareImg = ImageIO.read(is3);
-            is3.close();
-        } else if (length == 2) {
-            InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_lv.png");
-            shareImg = ImageIO.read(is3);
-            is3.close();
-        } else if (length == 3) {
-            InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_b.png");
-            shareImg = ImageIO.read(is3);
-            is3.close();
-        } else if (length == 4) {
-            InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_h.png");
+        if (chinese) {
+            InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_baijiaxing.png");
             shareImg = ImageIO.read(is3);
             is3.close();
         } else {
-            InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_zi.png");
-            shareImg = ImageIO.read(is3);
-            is3.close();
+            if (length == 1) {
+                InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_jing.png");
+                shareImg = ImageIO.read(is3);
+                is3.close();
+            } else if (length == 2) {
+                InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_lv.png");
+                shareImg = ImageIO.read(is3);
+                is3.close();
+            } else if (length == 3) {
+                InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_b.png");
+                shareImg = ImageIO.read(is3);
+                is3.close();
+            } else if (length == 4) {
+                InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_h.png");
+                shareImg = ImageIO.read(is3);
+                is3.close();
+            } else {
+                InputStream is3 = this.getClass().getResourceAsStream("/static/img/png_zi.png");
+                shareImg = ImageIO.read(is3);
+                is3.close();
+            }
         }
 
 
@@ -426,56 +456,68 @@ public class DomainOrderService {
 
 
         int domainLength = domainName.length();
-        if (domainLength > 10) {
-            g.setColor(new Color(255, 255, 255));
-            Font topFont = font1.deriveFont(Font.PLAIN, 130f);
-            Font downFont = font2.deriveFont(Font.BOLD, 36f);
-            int subIndex = domainLength / 3;
-            String str1 = domainName.substring(0, subIndex);
-            String str2 = domainName.substring(subIndex, subIndex + subIndex);
-            String str3 = domainName.substring(subIndex + subIndex, domainLength);
-            ImageUtils.drawCenteredString(g, str1, new Rectangle(0, 180, shareImg
-                    .getWidth(), 86), topFont);
-            ImageUtils.drawCenteredString(g, str2, new Rectangle(0, 300, shareImg
-                    .getWidth(), 86), topFont);
-            ImageUtils.drawCenteredString(g, str3, new Rectangle(0, 420, shareImg
+        if (chinese) {
+            g.setColor(new Color(255, 241, 187));
+            Font topFont = font1.deriveFont(Font.PLAIN, 180f);
+            Font downFont = font2.deriveFont(Font.PLAIN, 30f);
+            ImageUtils.drawCenteredString(g, domainName, new Rectangle(5, 200, shareImg
                     .getWidth(), 86), topFont);
-            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 540, shareImg
+            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(-10, 370, shareImg
                     .getWidth(), 86), topFont);
             g.setColor(new Color(255, 255, 255));
-            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 650, shareImg
-                    .getWidth(), 12), downFont);
-        }
-        if (domainLength > 5 & domainLength <= 10) {
-            g.setColor(new Color(255, 255, 255));
-            Font topFont = font1.deriveFont(Font.PLAIN, 190f);
-            Font downFont = font2.deriveFont(Font.BOLD, 36f);
-            int subIndex = domainLength / 2;
-            String str1 = domainName.substring(0, subIndex);
-            String str2 = domainName.substring(subIndex, domainLength);
-            ImageUtils.drawCenteredString(g, str1, new Rectangle(0, 180, shareImg
-                    .getWidth(), 86), topFont);
-            ImageUtils.drawCenteredString(g, str2, new Rectangle(0, 350, shareImg
-                    .getWidth(), 86), topFont);
-            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 520, shareImg
-                    .getWidth(), 86), topFont);
-            g.setColor(new Color(255, 255, 255));
-            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 650, shareImg
-                    .getWidth(), 12), downFont);
-        }
-        if (domainLength <= 5) {
-            g.setColor(new Color(255, 255, 255));
-            Font topFont = font1.deriveFont(Font.PLAIN, 240f);
-            Font downFont = font2.deriveFont(Font.BOLD, 36f);
-            ImageUtils.drawCenteredString(g, domainName, new Rectangle(17, 220, shareImg
-                    .getWidth(), 86), topFont);
-            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(-10, 420, shareImg
-                    .getWidth(), 86), topFont);
-            g.setColor(new Color(255, 255, 255));
-            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 620, shareImg
+            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 600, shareImg
                     .getWidth(), 12), downFont);
+        } else {
+            if (domainLength > 10) {
+                g.setColor(new Color(255, 255, 255));
+                Font topFont = font1.deriveFont(Font.PLAIN, 130f);
+                Font downFont = font2.deriveFont(Font.BOLD, 36f);
+                int subIndex = domainLength / 3;
+                String str1 = domainName.substring(0, subIndex);
+                String str2 = domainName.substring(subIndex, subIndex + subIndex);
+                String str3 = domainName.substring(subIndex + subIndex, domainLength);
+                ImageUtils.drawCenteredString(g, str1, new Rectangle(0, 180, shareImg
+                        .getWidth(), 86), topFont);
+                ImageUtils.drawCenteredString(g, str2, new Rectangle(0, 300, shareImg
+                        .getWidth(), 86), topFont);
+                ImageUtils.drawCenteredString(g, str3, new Rectangle(0, 420, shareImg
+                        .getWidth(), 86), topFont);
+                ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 540, shareImg
+                        .getWidth(), 86), topFont);
+                g.setColor(new Color(255, 255, 255));
+                ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 650, shareImg
+                        .getWidth(), 12), downFont);
+            }
+            if (domainLength > 5 & domainLength <= 10) {
+                g.setColor(new Color(255, 255, 255));
+                Font topFont = font1.deriveFont(Font.PLAIN, 190f);
+                Font downFont = font2.deriveFont(Font.BOLD, 36f);
+                int subIndex = domainLength / 2;
+                String str1 = domainName.substring(0, subIndex);
+                String str2 = domainName.substring(subIndex, domainLength);
+                ImageUtils.drawCenteredString(g, str1, new Rectangle(0, 180, shareImg
+                        .getWidth(), 86), topFont);
+                ImageUtils.drawCenteredString(g, str2, new Rectangle(0, 350, shareImg
+                        .getWidth(), 86), topFont);
+                ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 520, shareImg
+                        .getWidth(), 86), topFont);
+                g.setColor(new Color(255, 255, 255));
+                ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 650, shareImg
+                        .getWidth(), 12), downFont);
+            }
+            if (domainLength <= 5) {
+                g.setColor(new Color(255, 255, 255));
+                Font topFont = font1.deriveFont(Font.PLAIN, 240f);
+                Font downFont = font2.deriveFont(Font.BOLD, 36f);
+                ImageUtils.drawCenteredString(g, domainName, new Rectangle(17, 220, shareImg
+                        .getWidth(), 86), topFont);
+                ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(-10, 420, shareImg
+                        .getWidth(), 86), topFont);
+                g.setColor(new Color(255, 255, 255));
+                ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 620, shareImg
+                        .getWidth(), 12), downFont);
+            }
         }
-
         //二维码
 //        QRCodeWriter qrCodeWriter = new QRCodeWriter();
 //        Map<EncodeHintType, Object> hints = new HashMap<>();
@@ -534,10 +576,10 @@ public class DomainOrderService {
         });
     }
 
-    @Scheduled(cron = "0 0/60 9-20 * * ?")
+    @Scheduled(cron = "0 0/5 9-20 * * ?")
     public void batchPass() {
         long time = sysConfigService.getInt("domain_pendingTime");
-        LocalDateTime lastTime = LocalDateTime.now().minusHours(time);
+        LocalDateTime lastTime = LocalDateTime.now().minusHours(time - 1);
         List<DomainOrder> domainOrders = domainOrderRepo
                 .findAllByStatusAndCreatedAtBeforeAndOrderStatus(CollectionStatus.PENDING, lastTime, OrderStatus.FINISH);
         domainOrders.forEach(domainOrder -> {

+ 1 - 1
src/main/java/com/izouma/nineth/service/OrderCancelService.java

@@ -158,7 +158,7 @@ public class OrderCancelService {
                     case SUCCESS:
                     case PENDING:
                         log.info("订单 {}, 状态 {}, 不能取消", id, query.getStatus().name());
-                        query.close();
+                        //query.close();
                         return false;
                     default:
                         log.info("订单 {}, 状态 {}, 可以取消", id, query.getStatus().name());

+ 1 - 1
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -399,7 +399,7 @@ public class OrderService {
                 Long sellerId = asset.getOwnerId();
                 order.setRoyalties(assetService.getRoyalties(minter.getId(), collection.getRoyalties(), sellerId));
                 if (asset.getType().equals(CollectionType.DOMAIN)) {
-                    order.setServiceCharge(sysConfigService.getBigDecimal("domain_service_charge").doubleValue());
+                    order.setServiceCharge(assetService.getDomainServiceCharge(sellerId));
                 } else {
                     order.setServiceCharge(assetService.getServicecharge(collection.getServiceCharge(), sellerId));
                 }

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

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

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

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

+ 403 - 0
src/main/java/com/izouma/nineth/service/RiceService.java

@@ -0,0 +1,403 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.Rice;
+import com.izouma.nineth.domain.RiceOperationRecord;
+import com.izouma.nineth.domain.RiceUserWaterDropRecord;
+import com.izouma.nineth.domain.User;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.dto.R;
+import com.izouma.nineth.dto.RiceDTO;
+import com.izouma.nineth.enums.RiceOperationType;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.RiceOperationRecordRepo;
+import com.izouma.nineth.repo.RiceRepo;
+import com.izouma.nineth.repo.RiceUserWaterDropRecordRepo;
+import com.izouma.nineth.repo.UserRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import com.izouma.nineth.utils.SecurityUtils;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.JsonReader;
+import java.io.StringReader;
+import java.time.LocalDateTime;
+import java.util.*;
+
+@Service
+@AllArgsConstructor
+public class RiceService {
+
+    private static final int MAX_NICKNAME_LENGTH = 6;
+    private static final String UPDATE_SUCCESS_MSG = "修改成功";
+    private RiceRepo riceRepo;
+    private RiceUserWaterDropRecordRepo riceUserWaterDropRecordRepo;
+    private RiceOperationRecordRepo riceOperationRecordRepo;
+    private UserRepo userRepo;
+    private SysConfigService sysConfigService;
+
+    public Page<Rice> all(PageQuery pageQuery) {
+        return riceRepo.findAll(JpaUtils.toSpecification(pageQuery, Rice.class), JpaUtils.toPageRequest(pageQuery));
+    }
+    //点击水稻游戏,进行初始化
+    public Rice getCurrentRiceUser(User authenticatedUser) throws BusinessException {
+        Long id = authenticatedUser.getId();
+        Optional<User> byId = userRepo.findByIdAndDelFalse(id);
+        String nickname = null;
+        String avatar = null;
+        if (byId.isPresent()) {
+            User user = byId.get();
+            nickname = user.getNickname();
+            avatar = user.getAvatar();
+        } else {
+            throw new BusinessException("用户不存在");
+        }
+        Optional<Rice> byUserId = riceRepo.findByUserId(id);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            return rice;
+        } else {
+            Rice rice = new Rice();
+            rice.setUserId(id);
+            rice.setAvatar(avatar);
+            rice.setNickname(nickname);
+            rice.setLevel(0L);
+            rice.setWaterDropCount(0L);
+            rice.setSignCount(0L);
+            rice.setSelfScore(0L);
+            rice.setEmpiricalValue(0L);
+            riceRepo.save(rice);
+            return rice;
+        }
+    }
+
+
+    //修改昵称
+    public R updateNickName(Long userId, String nickname) {
+        String trimmedNickname = StringUtils.trim(nickname);
+        if (trimmedNickname.length() > MAX_NICKNAME_LENGTH) {
+            return R.error("昵称不能超过" + MAX_NICKNAME_LENGTH + "个字符");
+        }
+        riceRepo.updateNickName(userId, trimmedNickname);
+        return R.success(UPDATE_SUCCESS_MSG);
+    }
+
+
+    /**
+     * 获取当前等级
+     *
+     * @param empiricalValue
+     * @return
+     */
+    public Map<String, Object> getCurrentLevel(Long empiricalValue) {
+        String jsonString = sysConfigService.getString("rice_level");
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            empiricalValue = rice.getEmpiricalValue();
+
+            JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
+            JsonArray jsonArray = jsonReader.readArray();
+
+            Long currentLevel = null;
+            Long currentStart = null;
+            Long nextStart = null;
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JsonObject jsonObject = jsonArray.getJsonObject(i);
+                Long start = Long.valueOf(jsonObject.getInt("start"));
+
+                if (empiricalValue >= start && empiricalValue < (i<jsonArray.size()-1?Long.valueOf(jsonArray.getJsonObject(i+1).getInt("start")):Long.MAX_VALUE)) {
+                    String currentLevelStr = jsonObject.getString("name").replace("Lv", "");
+                    currentLevel = Long.parseLong(currentLevelStr);
+                    currentStart = Long.valueOf(jsonObject.getInt("start"));
+
+                    if (i < jsonArray.size() - 1) {
+                        JsonObject nextObject = jsonArray.getJsonObject(i + 1);
+                        nextStart = nextObject.getJsonNumber("start").longValue();
+                    }
+                    break;
+                }
+            }
+
+            if (currentLevel != null && currentStart != null) {
+                Map<String, Object> result = new HashMap<>();
+                result.put("currentLevel", currentLevel);
+                double levelUpPercentage;
+                if (nextStart != null) {
+                    levelUpPercentage = (double)(empiricalValue - currentStart) / (nextStart - currentStart);
+                } else {
+                    levelUpPercentage = 1.0;
+                }
+                result.put("levelUpPercentage", levelUpPercentage);
+                return result;
+            } else {
+                throw new BusinessException("没有配置对应的等级对应经验值");
+            }
+        } else {
+            throw new BusinessException("用户不存在");
+        }
+    }
+
+
+    /**
+     * 任务初始化.显示各个任务能否点击
+     *
+     * @return R<?>
+     */
+    public R<?> taskInitialization() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Long lastSignInTime = rice.getLastSignInTime();
+            Long currentTime = System.currentTimeMillis();
+            // 判断上次签到时间是否为空,如果为空,则默认为从未签到过
+            if (lastSignInTime == null) {
+                return R.success("未签到").add("isSignedIn", false).add("exchangeCount", rice.getExchangeCount() == null ? 0 : rice.getExchangeCount()).add("waterDropCount", rice.getWaterDropCount());
+            }
+            // 判断今天是否已经签到过
+            if (DateUtils.isSameDay(new Date(lastSignInTime), new Date(currentTime))) {
+                return R.success("已签到").add("isSignedIn", true).add("exchangeCount", rice.getExchangeCount() == null ? 0 : rice.getExchangeCount()).add("waterDropCount", rice.getWaterDropCount());
+            } else {
+                return R.success("未签到").add("isSignedIn", false).add("exchangeCount", rice.getExchangeCount() == null ? 0 : rice.getExchangeCount()).add("waterDropCount", rice.getWaterDropCount());
+            }
+        }
+        return R.error("查询失败");
+    }
+
+
+
+
+    /**
+     * 获取当前用户积分
+     */
+    public R<String> getCurrentScore() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Long selfScore = rice.getSelfScore();
+            return R.success("获取到当前用户积分").add("selfScore", selfScore);
+        }
+        return R.error("获取失败");
+    }
+
+
+    //在RiceService中添加一个方法用于更新所有用户的排名。
+    public void updateScoreRank() {
+        List<Rice> allRices = riceRepo.findAll();
+        allRices.sort(Comparator.comparing(Rice::getSelfScore).reversed());
+        for (int i = 0; i < allRices.size(); i++) {
+            Rice rice = allRices.get(i);
+//            rice.setScoreRank(i + 1);
+            riceRepo.save(rice);
+        }
+    }
+
+
+    public List<RiceDTO> getTop100(Long userId) {
+        List<Rice> top100Rices = riceRepo.findTop100ByOrderBySelfScoreDesc();
+        List<RiceDTO> result = new ArrayList<>();
+
+        // 计算自己的排名
+        int selfRank = 0;
+        for (int i = 0; i < top100Rices.size(); i++) {
+            if (top100Rices.get(i).getId().equals(userId)) {
+                selfRank = i + 1;
+                break;
+            }
+        }
+
+        for (int i = 0; i < top100Rices.size(); i++) {
+            Rice rice = top100Rices.get(i);
+            RiceDTO riceDTO = new RiceDTO();
+            BeanUtils.copyProperties(rice, riceDTO);
+            riceDTO.setScoreRank(i + 1);
+            // 判断是否上榜
+            if (i < 100) {
+                riceDTO.setOnTop100(true);
+            } else {
+                riceDTO.setOnTop100(false);
+            }
+            // 如果是自己,则设置自己的头像、昵称、等级和离上榜还差多少名
+            if (rice.getId().equals(userId)) {
+                riceDTO.setAvatar(rice.getAvatar());
+                riceDTO.setNickname(rice.getNickname());
+                riceDTO.setLevel(rice.getLevel());
+                if (i < 100) {
+                    riceDTO.setRankGap(0);
+                } else {
+                    riceDTO.setRankGap(i + 1 - 100);
+                }
+            }
+            result.add(riceDTO);
+        }
+        return result;
+    }
+
+    //浇水
+    public R<? extends Object> watering() {
+        // 获取当前用户 ID,
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Long waterDropCount = rice.getWaterDropCount();
+            Long beforeWaterDropCount = rice.getWaterDropCount();
+            Long beforeEmpiricalValue = rice.getEmpiricalValue();
+            // 如果水滴次数为 0,返回不能浇水的提示
+            if (waterDropCount == 0) {
+                return R.error("水滴次数已用完,无法浇水").add("can", false);
+            }
+            // 浇水成功,更新水滴次数,经验值加2
+            rice.setWaterDropCount(waterDropCount - 1);
+            rice.setEmpiricalValue(rice.getEmpiricalValue()+2);
+            riceRepo.save(rice);
+            createRiceOperationRecord(authId, RiceOperationType.WATER_DROP, 1L,beforeWaterDropCount , rice.getWaterDropCount());
+            createRiceOperationRecord(authId, RiceOperationType.EMPIRICAL_VALUE, 2L,beforeEmpiricalValue , rice.getEmpiricalValue());
+
+            // Save watering record
+            RiceUserWaterDropRecord record = new RiceUserWaterDropRecord();
+            record.setUserId(authId);
+            record.setWateringTime(LocalDateTime.now());
+            riceUserWaterDropRecordRepo.save(record);
+
+            return R.success("浇水成功").add("can", true).add("time", waterDropCount - 1);
+        }
+        return R.error("浇水失败").add("can", false);
+    }
+    //根据用户ID和今日时间获取今日浇水次数的方法
+    public Long getTodayWateringCount(Long userId) {
+        List<RiceUserWaterDropRecord> records = riceUserWaterDropRecordRepo.findByUserId(userId);
+        Long count = records.stream()
+                .filter(RiceUserWaterDropRecord::isToday)
+                .count();
+        return count;
+    }
+
+    /**
+     * 每浇水一次可获得2经验值,升级所需经验值为下一等级所配置的经验值标准。按照以下方式来计算用户升级所需水滴数
+     * @param rice
+     * @return
+     */
+    public Long getWaterDropNeededForLevelUp(Rice rice) {
+        Long currentEmpiricalValue = rice.getEmpiricalValue();
+        String jsonString = sysConfigService.getString("rice_level");
+        JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
+        JsonArray jsonArray = jsonReader.readArray();
+
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JsonObject jsonObject = jsonArray.getJsonObject(i);
+            Long start = Long.valueOf(jsonObject.getInt("start"));
+            Long nextStart = 0L;
+            if (i + 1 < jsonArray.size()) {
+                JsonObject nextJsonObject = jsonArray.getJsonObject(i + 1);
+                nextStart = Long.valueOf(nextJsonObject.getInt("start"));
+            }
+            if (currentEmpiricalValue >= start && currentEmpiricalValue < nextStart) {
+                Long levelUpEmpiricalValue = nextStart - currentEmpiricalValue;
+                Long waterDropNeededForLevelUp = levelUpEmpiricalValue / 2;
+                return waterDropNeededForLevelUp;
+            }
+        }
+        throw new BusinessException("没有配置对应的等级对应经验值");
+    }
+
+
+
+    //签到
+    public R<?> signIn(Long userId) {
+        Optional<Rice> byUserId = riceRepo.findByUserId(userId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Long lastSignInTime = rice.getLastSignInTime();
+            Long currentTime = System.currentTimeMillis();
+            Long beforeWaterDropCount = rice.getWaterDropCount();
+            Long beforeEmpiricalValue = rice.getEmpiricalValue();
+            // 判断上次签到时间是否为空,如果为空,则默认为从未签到过
+            if (lastSignInTime == null) {
+                rice.setWaterDropCount(rice.getWaterDropCount() + 1);
+                rice.setSignCount(rice.getSignCount() + 1);
+                rice.setLastSignInTime(currentTime);
+                riceRepo.save(rice);
+                createRiceOperationRecord(userId,RiceOperationType.WATER_DROP, (long) 1,beforeWaterDropCount,rice.getWaterDropCount());
+                return R.success("签到成功").add("can",true).add("waterDropCount",rice.getWaterDropCount());
+            }
+            // 判断今天是否已经签到过
+            if (DateUtils.isSameDay(new Date(lastSignInTime), new Date(currentTime))) {
+                return R.error("今天已经签到过了").add("can",false);
+            }
+            // 签到成功,水滴数加1,签到次数加1,更新签到时间
+            rice.setWaterDropCount(rice.getWaterDropCount() + 1);
+            rice.setSignCount(rice.getSignCount() + 1);
+            rice.setLastSignInTime(currentTime);
+            riceRepo.save(rice);
+            createRiceOperationRecord(userId,RiceOperationType.WATER_DROP, (long) 1,beforeWaterDropCount,rice.getWaterDropCount());
+            return R.success("签到成功").add("can",true).add("waterDropCount",rice.getWaterDropCount());
+        }
+        return R.error("签到失败").add("can",false);
+    }
+
+
+    @Transactional
+    public R<?> exchangeScoreForWaterDrop(User authenticatedUser) {
+        Long authId = authenticatedUser.getId();
+        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Long selfScore = rice.getSelfScore();
+            Long beforeSelfScore = rice.getSelfScore();
+            Integer waterDropCount = Math.toIntExact(rice.getWaterDropCount());
+            Long beforeWaterDropCount = rice.getWaterDropCount();
+
+            // 每次兑换需要消耗的积分和最大兑换次数
+            int exchangeScore = 2;
+            int maxExchangeCount = 10;
+
+            // 计算当前可兑换的次数和消耗的积分
+            int exchangeCount = Math.min((int) (selfScore / exchangeScore), maxExchangeCount-rice.getExchangeCount());
+            int totalScore = exchangeCount * exchangeScore;
+
+            if (exchangeCount > 0) {
+                rice.setSelfScore(selfScore - totalScore);
+                rice.setWaterDropCount((long) (waterDropCount + exchangeCount));
+                riceRepo.save(rice);
+                createRiceOperationRecord(authId,RiceOperationType.WATER_DROP, (long) exchangeCount,beforeWaterDropCount,rice.getWaterDropCount());
+                return R.success("兑换成功").add("exchangeCount", exchangeCount).add("waterDropCount", rice.getWaterDropCount());
+            } else if(exchangeCount==0){
+                return R.error("今天已经兑换满10滴水滴了");
+
+            }
+            else {
+                return R.error("兑换失败,当前积分不足").add("exchangeCount", 0).add("waterDropCount", rice.getWaterDropCount());
+            }
+        }
+        return R.error("兑换失败,用户不存在");
+    }
+
+
+    private void createRiceOperationRecord(Long userId, RiceOperationType type, Long amount, Long beforeAmount, Long afterAmount) {
+        RiceOperationRecord record = new RiceOperationRecord();
+        record.setUserId(userId);
+        record.setType(type);
+        record.setAmount(amount);
+        record.setBeforeAmount(beforeAmount);
+        record.setAfterAmount(afterAmount);
+        riceOperationRecordRepo.save(record);
+    }
+
+
+}

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

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

+ 29 - 3
src/main/java/com/izouma/nineth/web/AssetController.java

@@ -3,14 +3,17 @@ package com.izouma.nineth.web;
 import com.fasterxml.jackson.annotation.JsonView;
 import com.izouma.nineth.TokenHistory;
 import com.izouma.nineth.domain.Asset;
+import com.izouma.nineth.domain.DomainOrder;
 import com.izouma.nineth.domain.GiftOrder;
 import com.izouma.nineth.dto.*;
 import com.izouma.nineth.enums.AssetStatus;
 import com.izouma.nineth.enums.CollectionType;
 import com.izouma.nineth.enums.OperationSource;
+import com.izouma.nineth.enums.OrderStatus;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.AssetRepo;
 import com.izouma.nineth.repo.CollectionRepo;
+import com.izouma.nineth.repo.DomainOrderRepo;
 import com.izouma.nineth.repo.OrderRepo;
 import com.izouma.nineth.service.*;
 import com.izouma.nineth.utils.SecurityUtils;
@@ -19,6 +22,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.Pageable;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -28,6 +32,7 @@ import java.io.IOException;
 import java.math.BigDecimal;
 import java.time.Duration;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -45,6 +50,7 @@ public class AssetController extends BaseController {
     private UserAssetSummaryService userAssetSummaryService;
     private CollectionRepo          collectionRepo;
     private SysConfigService        sysConfigService;
+    private DomainOrderRepo         domainOrderRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
 //    @PostMapping("/save")
@@ -64,7 +70,20 @@ public class AssetController extends BaseController {
     public Page<Asset> all(@RequestBody PageQuery pageQuery) {
         pageQuery.getQuery().put("userId", SecurityUtils.getAuthenticatedUser().getId());
         pageQuery.getQuery().putIfAbsent("companyId", 1);
-        return assetService.all(pageQuery);
+        Page<Asset> origin = assetService.all(pageQuery);
+        List<Asset> content = origin.getContent();
+        List<Asset> newResult = new ArrayList<>();
+        content.forEach(asset -> {
+            if (asset.getType().equals(CollectionType.DOMAIN)) {
+                String domainName = asset.getName().substring(9);
+                DomainOrder domainOrder = domainOrderRepo
+                        .findFirstByDomainNameAndOrderStatus(domainName, OrderStatus.FINISH);
+                if (domainOrder != null)
+                    asset.setEndTime(domainOrder.getEndTime());
+            }
+            newResult.add(asset);
+        });
+        return new PageImpl<>(newResult, origin.getPageable(), origin.getTotalElements());
     }
 
     /**
@@ -83,6 +102,12 @@ public class AssetController extends BaseController {
     @JsonView(Asset.View.Basic.class)
     public Asset get(@PathVariable Long id) {
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        if (asset.getType().equals(CollectionType.DOMAIN)) {
+            String domainName = asset.getName().substring(9);
+            DomainOrder domainOrder = domainOrderRepo
+                    .findFirstByDomainNameAndOrderStatus(domainName, OrderStatus.FINISH);
+            asset.setEndTime(domainOrder.getEndTime());
+        }
 //        orderRepo.findByIdAndDelFalse(asset.getOrderId()).ifPresent(order -> asset.setOpened(order.isOpened()));
         return asset;
     }
@@ -204,7 +229,8 @@ public class AssetController extends BaseController {
     @ApiOperation("元宇宙销毁")
     @PostMapping("/metaDestroy")
     public void metaDestroy(@RequestBody MetaDestroyParam metaDestroyParam) {
-        assetService.metaDestroyWithoutTradeCode(metaDestroyParam, SecurityUtils.getAuthenticatedUser().getId(), OperationSource.META);
+        assetService.metaDestroyWithoutTradeCode(metaDestroyParam, SecurityUtils.getAuthenticatedUser()
+                .getId(), OperationSource.META);
     }
 
     @ApiOperation("开盲盒")
@@ -237,7 +263,7 @@ public class AssetController extends BaseController {
     public double getServicecharge(@RequestParam Long id) {
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         if (asset.getType().equals(CollectionType.DOMAIN)) {
-            return sysConfigService.getBigDecimal("domain_service_charge").doubleValue();
+            return assetService.getDomainServiceCharge(SecurityUtils.getAuthenticatedUser().getId());
         }
         return assetService.getServicecharge(asset.getServiceCharge(), SecurityUtils.getAuthenticatedUser()
                 .getId());

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

@@ -2,11 +2,11 @@ package com.izouma.nineth.web;
 
 import com.izouma.nineth.domain.Company;
 import com.izouma.nineth.domain.UserBalance;
-import com.izouma.nineth.repo.UserBalanceRepo;
-import com.izouma.nineth.service.CompanyService;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.CompanyRepo;
+import com.izouma.nineth.repo.UserBalanceRepo;
+import com.izouma.nineth.service.CompanyService;
 import com.izouma.nineth.utils.ObjUtils;
 import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.excel.ExcelUtils;
@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.math.BigDecimal;
 import java.util.List;
 import java.util.Optional;
 
@@ -40,7 +39,7 @@ public class CompanyController extends BaseController {
         return companyRepo.save(record);
     }
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasRole('ADMIN') || hasRole('META')")
     @PostMapping("/all")
     public Page<Company> all(@RequestBody PageQuery pageQuery) {
         return companyService.all(pageQuery);

+ 181 - 0
src/main/java/com/izouma/nineth/web/RiceController.java

@@ -0,0 +1,181 @@
+package com.izouma.nineth.web;
+
+import com.izouma.nineth.domain.Rice;
+import com.izouma.nineth.domain.User;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.dto.R;
+import com.izouma.nineth.dto.RiceDTO;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.*;
+import com.izouma.nineth.service.*;
+import com.izouma.nineth.utils.ObjUtils;
+import com.izouma.nineth.utils.SecurityUtils;
+import com.izouma.nineth.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.time.DateUtils;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+@RestController
+@RequestMapping("/rice")
+@AllArgsConstructor
+@Slf4j
+public class RiceController extends BaseController {
+    private RiceService riceService;
+    private RiceRepo riceRepo;
+    private UserDetailService userDetailService;
+    private UserDetailRepo userDetailRepo;
+    private UserService userService;
+    private UserRepo userRepo;
+    private RiceInviteRepo RiceInviteRepo;
+    private RiceInviteService RiceInviteService;
+    private SysConfigService sysConfigService;
+    private SysConfigRepo sysConfigRepo;
+    private static final int MAX_NICKNAME_LENGTH = 14;
+    private static final String UPDATE_SUCCESS_MSG = "修改成功";
+
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public Rice save(@RequestBody Rice record) {
+        if (record.getId() != null) {
+            Rice orig = riceRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return riceRepo.save(orig);
+        }
+        return riceRepo.save(record);
+    }
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<Rice> all(@RequestBody PageQuery pageQuery) {
+        return riceService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public Rice get(@PathVariable Long id) {
+        return riceRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+/*    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        riceRepo.softDelete(id);
+    }*/
+
+    @PreAuthorize("hasRole('ADMIN')")
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<Rice> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    //点击水稻游戏后对riceuser进行初始化赋值
+    @GetMapping("/current")
+    public R<Rice> getCurrentUser() throws BusinessException {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        return R.success(riceService.getCurrentRiceUser(authenticatedUser));
+    }
+
+    //修改用户昵称
+    @PostMapping("/updateNickName")
+    public R updateNickName(@RequestParam("userId") Long userId, @RequestParam("nickname") String nickname) {
+        return riceService.updateNickName(userId, nickname);
+    }
+
+    //等级显示
+    @GetMapping("/showLevel")
+    public R<Map<String, Object>> getCurrentLevel() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Map<String, Object> currentLevel = riceService.getCurrentLevel(rice.getEmpiricalValue());
+            Long riceLevel = (Long) currentLevel.get("currentLevel");
+            Double levelUpPercentage = (Double) currentLevel.get("levelUpPercentage");
+            rice.setLevel(riceLevel);
+            riceRepo.save(rice);
+            Map<String, Object> responseData = new HashMap<>();
+            responseData.put("riceLevel", currentLevel);
+            responseData.put("levelUpPercentage", levelUpPercentage);
+            return R.success(responseData).add("msg", "查询成功");
+        } else {
+            throw new BusinessException("用户不存在");
+        }
+    }
+
+    //获取用户积分
+    @GetMapping("/selfScore")
+    public R<String> getCurrentScore() {
+        return riceService.getCurrentScore();
+    }
+
+    //一个获取积分排行榜的接口
+    @GetMapping("/scoreRanking")
+    public R<List<RiceDTO>> getTop100AndSelf() {
+        // 获取当前用户的id,假设这个方法可以获取当前用户的id
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        List<RiceDTO> top100 = riceService.getTop100(authId);
+        return R.success(top100);
+    }
+
+    //浇水响应
+    @GetMapping("/watering")
+    public R<String> watering() {
+        return (R<String>) riceService.watering();
+    }
+
+
+    //获取今日已浇水次数和还需浇水次数升级的接口
+    @GetMapping("/watering/count")
+    public R<?> getWateringCount() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long userId = authenticatedUser.getId();
+        Long todayWateringCount = riceService.getTodayWateringCount(userId);
+        Optional<Rice> byUserId = riceRepo.findByUserId(userId);
+        if (byUserId.isPresent()) {
+            Rice rice = byUserId.get();
+            Long waterDropNeededForLevelUp = riceService.getWaterDropNeededForLevelUp(rice);
+            return R.success(Map.of("todayWateringCount", todayWateringCount, "waterDropNeededForLevelUp", waterDropNeededForLevelUp));
+        }
+        return R.error("获取用户信息失败");
+    }
+
+    //签到
+    @GetMapping("/signin")
+    public R<?> signIn() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        Long authId = authenticatedUser.getId();
+        return riceService.signIn(authId);
+    }
+
+    //任务初始化
+    // 任务初始化.显示各个任务能否点击
+    @GetMapping("/taskInitialization")
+    public R<?> taskInitialization() {
+        return riceService.taskInitialization();
+    }
+
+    //积分兑换水滴
+    @GetMapping("/exchangeScoreForWaterDrop")
+    public R<?> exchangeScoreForWaterDrop() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        return riceService.exchangeScoreForWaterDrop(authenticatedUser);
+    }
+
+    //活动积分兑换水滴
+    @GetMapping("/exchangeActivityScoreForWaterDrop")
+    public R<?> exchangeActivityScoreForWaterDrop() {
+        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
+        return riceService.exchangeScoreForWaterDrop(authenticatedUser);
+    }
+
+
+}
+

+ 115 - 0
src/main/java/com/izouma/nineth/web/RiceInviteController.java

@@ -0,0 +1,115 @@
+package com.izouma.nineth.web;
+import com.izouma.nineth.domain.Invite;
+import com.izouma.nineth.domain.Rice;
+import com.izouma.nineth.domain.RiceInvite;
+import com.izouma.nineth.domain.RiceOperationRecord;
+import com.izouma.nineth.dto.R;
+import com.izouma.nineth.enums.RiceOperationType;
+import com.izouma.nineth.repo.*;
+import com.izouma.nineth.service.*;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+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.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+
+@RestController
+@RequestMapping("/riceInvite")
+@AllArgsConstructor
+public class RiceInviteController extends BaseController {
+    private RiceInviteService riceInviteService;
+    private RiceInviteRepo riceInviteRepo;
+    private RiceService riceService;
+    private RiceRepo riceRepo;
+    private UserDetailService userDetailService;
+    private UserDetailRepo userDetailRepo;
+    private UserService userService;
+    private UserRepo userRepo;
+    private RiceInviteRepo RiceInviteRepo;
+    private RiceInviteService RiceInviteService;
+    private SysConfigService sysConfigService;
+    private SysConfigRepo sysConfigRepo;
+    private RiceOperationRecordRepo riceOperationRecordRepo;
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public RiceInvite save(@RequestBody RiceInvite record) {
+        if (record.getId() != null) {
+            RiceInvite orig = riceInviteRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return riceInviteRepo.save(orig);
+        }
+        return riceInviteRepo.save(record);
+    }
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<RiceInvite> all(@RequestBody PageQuery pageQuery) {
+        return riceInviteService.all(pageQuery);
+    }
+    @GetMapping("/get/{id}")
+    public RiceInvite get(@PathVariable Long id) {
+        return riceInviteRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        riceInviteRepo.softDelete(id);
+    }
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<RiceInvite> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+
+
+    //邀请别人并认领水滴
+    @PostMapping("/inviteAndClaimWaterDrop")
+    public R<?> inviteAndClaimWaterDrop(@RequestParam Long inviterId, @RequestParam Long inviteeId) {
+        // 检查邀请是否重复
+        Optional<RiceInvite> invite = riceInviteRepo.findByInviterIdAndInviteeId(inviterId, inviteeId);
+        if (invite.isPresent()) {
+            return R.error("邀请已发送,请勿重复发送");
+        }
+        // 创建邀请记录
+        RiceInvite newInvite = new RiceInvite();
+        newInvite.setInviterId(inviterId);
+        newInvite.setInviteeId(inviteeId);
+        newInvite.setCreateTime(System.currentTimeMillis());
+        riceInviteRepo.save(newInvite);
+
+        // 增加邀请者的水滴数
+        Optional<Rice> inviterRice = riceRepo.findById(inviterId);
+        if (!inviterRice.isPresent()) {
+            return R.error("未找到邀请者的用户信息");
+        }
+        Rice rice = inviterRice.get();
+        Long beforeWaterDropCount = rice.getWaterDropCount();
+        rice.setWaterDropCount(rice.getWaterDropCount() + 1);
+        riceRepo.save(rice);
+        createRiceOperationRecord(inviterId,RiceOperationType.WATER_DROP,1L,beforeWaterDropCount,rice.getWaterDropCount());
+        return R.success("邀请成功并领取水滴").add("waterDropCount", rice.getWaterDropCount());
+    }
+
+
+    private void createRiceOperationRecord(Long userId, RiceOperationType type, Long amount, Long beforeAmount, Long afterAmount) {
+        RiceOperationRecord record = new RiceOperationRecord();
+        record.setUserId(userId);
+        record.setType(type);
+        record.setAmount(amount);
+        record.setBeforeAmount(beforeAmount);
+        record.setAfterAmount(afterAmount);
+        riceOperationRecordRepo.save(record);
+    }
+
+}
+

+ 41 - 0
src/main/java/com/izouma/nineth/web/RiceMonkeyTextController.java

@@ -0,0 +1,41 @@
+package com.izouma.nineth.web;
+
+
+import com.izouma.nineth.dto.R;
+import com.izouma.nineth.repo.SysConfigRepo;
+import com.izouma.nineth.service.SysConfigService;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Random;
+
+
+@RestController
+@RequestMapping("/MonkeyText")
+@AllArgsConstructor
+public class RiceMonkeyTextController extends BaseController {
+
+
+
+    private SysConfigService sysConfigService;
+    private SysConfigRepo sysConfigRepo;
+
+
+
+    @GetMapping("/test")
+    public R<String> monkeyText(){
+
+        String rice_monkey_text = sysConfigService.getString("rice_monkey_text");
+        String[] strings = rice_monkey_text.split(",");
+        int length = strings.length;
+        Random random = new Random();
+        int i = random.nextInt(length);
+        String s = strings[i];
+        return R.success(s);
+    }
+
+
+}
+

+ 60 - 0
src/main/java/com/izouma/nineth/web/RiceOperationRecordController.java

@@ -0,0 +1,60 @@
+package com.izouma.nineth.web;
+import com.izouma.nineth.domain.RiceOperationRecord;
+import com.izouma.nineth.service.RiceOperationRecordService;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.RiceOperationRecordRepo;
+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.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/riceOperationRecord")
+@AllArgsConstructor
+public class RiceOperationRecordController extends BaseController {
+    private RiceOperationRecordService riceOperationRecordService;
+    private RiceOperationRecordRepo riceOperationRecordRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public RiceOperationRecord save(@RequestBody RiceOperationRecord record) {
+        if (record.getId() != null) {
+            RiceOperationRecord orig = riceOperationRecordRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return riceOperationRecordRepo.save(orig);
+        }
+        return riceOperationRecordRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<RiceOperationRecord> all(@RequestBody PageQuery pageQuery) {
+        return riceOperationRecordService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public RiceOperationRecord get(@PathVariable Long id) {
+        return riceOperationRecordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        riceOperationRecordRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<RiceOperationRecord> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

+ 60 - 0
src/main/java/com/izouma/nineth/web/RiceUserWaterDropRecordController.java

@@ -0,0 +1,60 @@
+package com.izouma.nineth.web;
+import com.izouma.nineth.domain.RiceUserWaterDropRecord;
+import com.izouma.nineth.service.RiceUserWaterDropRecordService;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.RiceUserWaterDropRecordRepo;
+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.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/riceUserWaterDropRecord")
+@AllArgsConstructor
+public class RiceUserWaterDropRecordController extends BaseController {
+    private RiceUserWaterDropRecordService riceUserWaterDropRecordService;
+    private RiceUserWaterDropRecordRepo riceUserWaterDropRecordRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public RiceUserWaterDropRecord save(@RequestBody RiceUserWaterDropRecord record) {
+        if (record.getId() != null) {
+            RiceUserWaterDropRecord orig = riceUserWaterDropRecordRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return riceUserWaterDropRecordRepo.save(orig);
+        }
+        return riceUserWaterDropRecordRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<RiceUserWaterDropRecord> all(@RequestBody PageQuery pageQuery) {
+        return riceUserWaterDropRecordService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public RiceUserWaterDropRecord get(@PathVariable Long id) {
+        return riceUserWaterDropRecordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        riceUserWaterDropRecordRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<RiceUserWaterDropRecord> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

+ 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}")

BIN
src/main/resources/font/尔雅荣耀手书.ttf


BIN
src/main/resources/static/img/png_baijiaxing.png


Plik diff jest za duży
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/config.json


+ 0 - 1
src/main/resources/static/web-mobile/assets/main/import/03/0344b9548.json

@@ -1 +0,0 @@
-{"type":"cc.Texture2D","data":[["2,2,0,0,0,0",["1bv6CDSLxKv5dkscuExOD9"]],["2,2,2,2,0,0",["7dj5uJT9FMn6OrOOx83tfK"]],["2,2,2,2,0,0",["54TknWPwVPqJqeCR+Y/Czo"]],["2,2,0,0,0,0",["63EeZ7FEZMm7stBANrFpIQ"]],["2,2,2,2,0,0",["20g1ukYUVPvKWKBRznAKo+"]],["2,2,0,0,0,0",["17EEHgBadGB7pczePh/nFB"]],["2,2,2,2,0,0",["95EkngnxZFbYuFpsqVTaFr"]],["2,2,2,2,0,0",["afxHkx8GZGsJC+n+YfITQo"]],["2,2,2,2,0,0",["b7MFJ8MjNBwqr3fNq1j5dJ"]],["2,2,2,2,0,0",["ffuIqPr2JI9I8dPLYGRDpD"]]]}

+ 1 - 0
src/main/resources/static/web-mobile/assets/main/import/05/0540da930.json

@@ -0,0 +1 @@
+{"type":"cc.Texture2D","data":[["2,2,0,0,0,0",["7agYLdDS9B36JZNNWxkLmr"]],["2,2,2,2,0,0",["7dj5uJT9FMn6OrOOx83tfK"]],["2,2,0,0,0,0",["8fTqmwSy5Bp4hLSjS2HD5B"]],["2,2,2,2,0,0",["430fAuTFpIk5RfLE9CrJg/"]],["2,2,2,2,0,0",["54TknWPwVPqJqeCR+Y/Czo"]],["2,2,2,2,0,0",["20g1ukYUVPvKWKBRznAKo+"]],["2,2,0,0,0,0",["71dz4/aPdPN6j0GYuFXiO2"]],["2,2,2,2,0,0",["95EkngnxZFbYuFpsqVTaFr"]],["2,2,2,2,0,0",["57UgcWSMhKGYrPQcn4d3+w"]],["2,2,0,0,0,0",["abKie4/WVF5L4X9oRlX/P2"]]]}

+ 1 - 1
src/main/resources/static/web-mobile/assets/main/import/0e/0eb19e8da.json → src/main/resources/static/web-mobile/assets/main/import/05/05ec77bf4.json

@@ -1 +1 @@
-{"type":"cc.ImageAsset","data":[[1,0,0,["cc.ImageAsset"],0,[{"fmt":"1","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"1","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"1","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]]]}
+{"type":"cc.ImageAsset","data":[[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]],[1,0,0,["cc.ImageAsset"],0,[{"fmt":"0","w":0,"h":0},-1],[0],0,[],[],[]]]}

Plik diff jest za duży
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/06/06c153673.json


Plik diff jest za duży
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/0b/0bc88cdd2.json


BIN
src/main/resources/static/web-mobile/assets/main/import/1e/1e604f29-bddb-4bb8-8f9e-0f3065b1358a.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/2a/2ac81863-7f8a-4be6-b06c-96d5b519afc2.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@02016.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@07a3e.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@17666.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@1af55.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@21875.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@36c80.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@3d5e2.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@3e5d4.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@3f405.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@404b8.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@44e7a.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@4ae73.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@4f967.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@5413d.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@5ef9c.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@5f48d.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@613ad.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@62bb3.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@6c96e.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@73130.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@78636.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@817c6.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@8e375.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@8e9b3.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@93caa.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@982bc.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@9e3a0.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@9e898.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@a9caa.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@af7c0.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@b9a95.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@bec08.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@c4533.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@c6ca8.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@d2bce.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@da32c.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e06cb.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e1bfd.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e4755.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e5c73.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e6997.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@e73b9.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@ef784.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@f3d06.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@fd535.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/569cbd4b-87e0-4d6b-8d2d-36faa51cde9b@ffbb9.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/58/5837fe81-a1e1-4794-9f8d-13ff782cae61.cconb


Plik diff jest za duży
+ 1 - 2
src/main/resources/static/web-mobile/assets/main/index.js


BIN
src/main/resources/static/web-mobile/assets/main/native/12/1263d74c-8167-4928-91a6-4e2672411f47@2e76e.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/17/171041e0-05a7-4607-ba5c-cde3e1fe7141.jpg


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików