Kaynağa Gözat

Merge branch 'dev'

xiongzhu 4 yıl önce
ebeveyn
işleme
283e82e83b

+ 1 - 1
src/main/comos/.env.development

@@ -1,4 +1,4 @@
-VUE_APP_BASE_URL=https://nfttest.9space.vip/
+VUE_APP_BASE_URL=https://nft.9space.vip/
 NODE_ENV=development
 PUBLIC_PATH=/
 ASSETS_PATH=raex

+ 1 - 1
src/main/comos/src/mixins/product.js

@@ -64,7 +64,7 @@ export default {
             }
         },
         isSold() {
-            return !this.info.stock;
+            return this.info.stock ? this.info.stock <= 0 : true;
         }
     },
     methods: {

+ 8 - 0
src/main/comos/src/router/index.js

@@ -479,6 +479,14 @@ const routes = [
             title: 'Cosmos Art'
         }
     },
+    {
+        path: '/share',
+        name: 'share',
+        component: () => import('../views/user/Share.vue'),
+        meta: {
+            title: 'Cosmos Art'
+        }
+    },
     {
         path: '/mineExchange',
         name: 'mineExchange',

+ 147 - 0
src/main/comos/src/views/user/Share.vue

@@ -0,0 +1,147 @@
+<template>
+    <div class="page">
+        <div class="share-btn">
+            <van-button type="primary" round block>立即邀请</van-button>
+        </div>
+        <div class="code">
+            <div class="code-top">
+                <div class="text1">我的邀请码</div>
+                <div class="text2">7474448585955505057578578</div>
+                <van-button round plain> 复制</van-button>
+            </div>
+            <div class="code-btn">
+                <van-button type="primary" round block>领取奖励</van-button>
+            </div>
+        </div>
+
+        <div class="panel">
+            <div class="panel-title">我的邀请</div>
+            <div class="panel-box">
+                <div class="panel-item">
+                    <div class="text1">
+                        <span>3</span>
+                        <small>个</small>
+                    </div>
+                    <div class="text2">已获得藏品</div>
+                </div>
+                <div class="panel-item">
+                    <div class="text1">
+                        <span>1</span>
+                        <small>人</small>
+                    </div>
+                    <div class="text2">邀请好友</div>
+                </div>
+            </div>
+        </div>
+
+        <div class="tips">
+            活动规则<br />
+            1.邀请5位好友可获得平台空投稀有数字藏品<br />
+            2.在活动期间,参与活动的用户(以下称用“用户”“您”) 每邀请一位新用户(“新用户”系指从未注册过“第九空
+            间”的用户,是否为新用户以平台判断为准),在注册当 日绑定您的邀请码,在三个工作日后您可获得平台空投。
+        </div>
+    </div>
+</template>
+
+<script>
+export default {};
+</script>
+
+<style lang="less" scoped>
+.page {
+    background-color: #f3f4f5;
+}
+.share-btn {
+    padding: 16px 70px;
+}
+
+.code {
+    padding: 0 7px;
+    .code-top {
+        .flex();
+        height: 56px;
+        border-bottom: 1px dotted #ebeff1;
+
+        .text1 {
+            font-size: 12px;
+            color: #939599;
+        }
+        .text2 {
+            font-size: 12px;
+            color: #26273c;
+            margin-left: 4px;
+            flex-grow: 1;
+        }
+        .van-button {
+            border: 1px solid #ebeff1;
+            min-width: 70px;
+        }
+    }
+    background-color: #fff;
+    margin: 0 16px;
+    border-radius: 12px;
+
+    .code-btn {
+        padding: 12px 80px 16px;
+    }
+}
+
+.panel {
+    margin: 20px 16px 0;
+    background: #ffffff;
+    border-radius: 12px;
+
+    .panel-title {
+        font-size: 18px;
+        font-weight: bold;
+        line-height: 24px;
+        color: #26273c;
+        padding-top: 22px;
+        text-align: center;
+    }
+
+    .panel-box {
+        .flex();
+        .panel-item {
+            width: 50%;
+            .flex-col();
+            align-items: center;
+            justify-content: center;
+            padding: 28px 0;
+
+            .text1 {
+                font-size: 26px;
+                font-weight: bold;
+                line-height: 35px;
+                color: #ff6464;
+                .flex();
+                span {
+                    display: inline-block;
+                }
+                small {
+                    font-size: 12px;
+                    font-weight: normal;
+                    line-height: 17px;
+                    color: #939599;
+                    margin-top: 6px;
+                    display: inline-block;
+                }
+            }
+
+            .text2 {
+                font-size: 12px;
+                line-height: 17px;
+                color: #939599;
+                margin-top: 2px;
+            }
+        }
+    }
+}
+
+.tips {
+    font-size: 14px;
+    line-height: 24px;
+    color: #939599;
+    margin: 25px 16px;
+}
+</style>

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

@@ -127,4 +127,10 @@ public class User extends BaseEntity implements Serializable {
     private String inviteCode;
 
     private int minterProjectId;
+
+    @ApiModelProperty(value = "邀请得空投")
+    private Long invitor;
+
+    @ApiModelProperty(value = "邀请数量")
+    private int inviteNum;
 }

+ 2 - 0
src/main/java/com/izouma/nineth/dto/UserRegister.java

@@ -46,4 +46,6 @@ public class UserRegister {
     private int minterProjectId;
 
     private String intro;
+
+    private Long invitor;
 }

+ 6 - 0
src/main/java/com/izouma/nineth/repo/AssetRepo.java

@@ -48,4 +48,10 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
 
     @Query("select id from Asset where status = ?1")
     List<Long> findAllByStatus(AssetStatus status);
+
+    @Query(nativeQuery = true, value = "select asset.* from asset " +
+            "join collection_info on asset.collection_id = collection_info.id " +
+            "where asset.number > collection_info.total and status = 'NORMAL'")
+    List<Asset> findOverNumber();
+
 }

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

@@ -126,4 +126,8 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
     @Transactional
     @Modifying
     int updateSale(Long id, int sale);
+
+    @Transactional
+    @Modifying
+    int deleteByAssetId(Long assetId);
 }

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

@@ -34,7 +34,15 @@ public class AdapayService {
         memberParams.put("cert_id", idNo);
         Map<String, Object> member = AdapayCommon.requestAdapay(memberParams);
         log.info("createMember\n{}", JSON.toJSONString(member, SerializerFeature.PrettyFormat));
-        checkSuccess(member);
+        try {
+            checkSuccess(member);
+        } catch (BusinessException e) {
+            if ("member_id_exists".equals(e.getMessage())) {
+                return id.toString();
+            } else {
+                throw e;
+            }
+        }
         return MapUtils.getString(member, "member_id");
     }
 
@@ -81,6 +89,9 @@ public class AdapayService {
 
     public static void checkSuccess(Map<String, Object> map) {
         if (!"succeeded".equals(MapUtils.getString(map, "status"))) {
+            if ("member_id_exists".equals(MapUtils.getString(map, "error_code"))) {
+                throw new BusinessException("member_id_exists");
+            }
             String errMsg = MapUtils.getString(map, "error_msg");
             String errCode = MapUtils.getString(map, "error_code");
             throw new BusinessException(errMsg + "(" + errCode + ")");

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

@@ -602,6 +602,9 @@ public class OrderService {
 
     @Scheduled(fixedRate = 30000)
     public void batchCancel() {
+        if (Arrays.asList(env.getActiveProfiles()).contains("dev")) {
+            return;
+        }
         List<Order> orders = orderRepo.findByStatusAndCreatedAtBeforeAndDelFalse(OrderStatus.NOT_PAID,
                 LocalDateTime.now().minusSeconds(210));
         orders.forEach(o -> {

+ 47 - 23
src/main/java/com/izouma/nineth/service/UserService.java

@@ -10,11 +10,9 @@ import com.huifu.adapay.model.AdapayCommon;
 import com.huifu.adapay.model.SettleAccount;
 import com.izouma.nineth.config.AdapayProperties;
 import com.izouma.nineth.config.Constants;
-import com.izouma.nineth.domain.Follow;
-import com.izouma.nineth.domain.IdentityAuth;
-import com.izouma.nineth.domain.Invite;
-import com.izouma.nineth.domain.User;
+import com.izouma.nineth.domain.*;
 import com.izouma.nineth.dto.*;
+import com.izouma.nineth.enums.AirDropType;
 import com.izouma.nineth.enums.AuthStatus;
 import com.izouma.nineth.enums.AuthorityName;
 import com.izouma.nineth.event.AccountCreatedEvent;
@@ -57,24 +55,24 @@ import java.util.stream.Collectors;
 @Slf4j
 @AllArgsConstructor
 public class UserService {
-    private UserRepo          userRepo;
-    private WxMaService       wxMaService;
-    private WxMpService       wxMpService;
-    private SmsService        smsService;
-    private StorageService    storageService;
-    private JwtTokenUtil      jwtTokenUtil;
-    private CaptchaService    captchaService;
-    private FollowService     followService;
-    private FollowRepo        followRepo;
-    private IdentityAuthRepo  identityAuthRepo;
-    private SysConfigService  sysConfigService;
-    private CollectionService collectionService;
-    private AdapayService     adapayService;
-    private UserBankCardRepo  userBankCardRepo;
-    private CacheService      cacheService;
-    private InviteRepo        inviteRepo;
-    private NFTService        nftService;
-    private AdapayProperties  adapayProperties;
+    private UserRepo         userRepo;
+    private WxMaService      wxMaService;
+    private WxMpService      wxMpService;
+    private SmsService       smsService;
+    private StorageService   storageService;
+    private JwtTokenUtil     jwtTokenUtil;
+    private CaptchaService   captchaService;
+    private FollowService    followService;
+    private FollowRepo       followRepo;
+    private IdentityAuthRepo identityAuthRepo;
+    private SysConfigService sysConfigService;
+    private AirDropService   airDropService;
+    private AdapayService    adapayService;
+    private UserBankCardRepo userBankCardRepo;
+    private CacheService     cacheService;
+    private InviteRepo       inviteRepo;
+    private NFTService       nftService;
+    private AdapayProperties adapayProperties;
 
     @CacheEvict(value = "user", key = "#user.username")
     public User update(User user) {
@@ -155,7 +153,7 @@ public class UserService {
         return user;
     }
 
-    public User phoneRegister(String phone, String code, String password, String inviteCode) {
+    public User phoneRegister(String phone, String code, String password, String inviteCode, Long invitor) {
         String name = "9th_" + RandomStringUtils.randomAlphabetic(8);
         Invite invite = null;
         if (StringUtils.isNotBlank(inviteCode)) {
@@ -172,10 +170,36 @@ public class UserService {
                 .invitorPhone(Optional.ofNullable(invite).map(Invite::getPhone).orElse(null))
                 .invitorName(Optional.ofNullable(invite).map(Invite::getName).orElse(null))
                 .inviteCode(Optional.ofNullable(invite).map(Invite::getCode).orElse(null))
+                .invitor(invitor)
                 .build());
         if (invite != null) {
             inviteRepo.increaseNum(invite.getId());
         }
+        if (invitor != null) {
+            userRepo.findByIdAndDelFalse(invitor).ifPresent(user1 -> {
+                user1.setInviteNum(user1.getInviteNum() + 1);
+                userRepo.save(user1);
+                if (user1.getInviteNum() >= 15) {
+                    airDropService.create(AirDrop.builder()
+                            .name("宇宙熊-致敬奥运-纯金款")
+                            .type(AirDropType.asset)
+                            .collectionId(8472L)
+                            .phone(List.of(user1.getPhone()))
+                            .userIds(List.of(invitor))
+                            .projectId(1)
+                            .build());
+                } else if (user1.getInviteNum() >= 5) {
+                    airDropService.create(AirDrop.builder()
+                            .name("宇宙熊-致敬奥运-纯黄款")
+                            .type(AirDropType.asset)
+                            .collectionId(8406L)
+                            .phone(List.of(user1.getPhone()))
+                            .userIds(List.of(invitor))
+                            .projectId(1)
+                            .build());
+                }
+            });
+        }
         return user;
     }
 

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

@@ -65,8 +65,8 @@ public class AuthenticationController {
 
     @PostMapping("/phoneRegister")
     @ApiOperation(value = "手机号密码注册")
-    public String phonePwdLogin(String phone, String code, String password, String inviteCode) {
-        User user = userService.phoneRegister(phone, code, password, inviteCode);
+    public String phonePwdLogin(String phone, String code, String password, String inviteCode, Long invitor) {
+        User user = userService.phoneRegister(phone, code, password, inviteCode, invitor);
         return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
     }
 

+ 31 - 6
src/main/vue/src/views/UserList.vue

@@ -42,11 +42,13 @@
                     ></el-image>
                 </template>
             </el-table-column>
-            <el-table-column label="手机" prop="phone"></el-table-column>
-            <el-table-column label="注册时间" prop="createdAt" width="150"></el-table-column>
-            <el-table-column label="操作" align="center" fixed="right" width="200">
+            <el-table-column label="手机" prop="phone" min-width="100"></el-table-column>
+            <el-table-column label="注册时间" prop="createdAt" min-width="150"></el-table-column>
+            <el-table-column label="邀请人数" prop="inviteNum" min-width="80"></el-table-column>
+            <el-table-column label="操作" align="center" fixed="right" width="220">
                 <template slot-scope="{ row }">
-                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="getInviteInfo(row)" type="text" size="mini" plain>邀请列表</el-button>
+                    <el-button @click="editRow(row)" type="text" size="mini" plain>编辑</el-button>
                     <el-button @click="removeCard(row)" size="mini" type="text" :disabled="!row.settleAccountId">
                         解绑卡
                     </el-button>
@@ -74,6 +76,15 @@
             >
             </el-pagination>
         </div>
+
+        <el-dialog :visible.sync="showDialog" title="邀请列表" width="800px" top="10vh">
+            <el-table :data="list" v-loading="dialogLoading" height="60vh">
+                <el-table-column prop="id" label="ID" width="80"></el-table-column>
+                <el-table-column prop="nickname" label="昵称"></el-table-column>
+                <el-table-column prop="phone" label="手机"></el-table-column>
+                <el-table-column prop="createdAt" label="注册时间"></el-table-column>
+            </el-table>
+        </el-dialog>
     </div>
 </template>
 <script>
@@ -89,7 +100,10 @@ export default {
             search: '',
             url: '/user/all',
             downloading: false,
-            createdAt: ''
+            createdAt: '',
+            showDialog: false,
+            dialogLoading: false,
+            list: []
         };
     },
     computed: {
@@ -178,7 +192,7 @@ export default {
                     .then(res => {
                         let el = document.createElement('div');
                         new ClipboardJS(el, {
-                            text: function(trigger) {
+                            text: function (trigger) {
                                 return res;
                             }
                         });
@@ -270,6 +284,17 @@ export default {
                     }
                 }
             }).then(_ => {});
+        },
+        getInviteInfo(row) {
+            this.list = [];
+            this.showDialog = true;
+            this.dialogLoading = true;
+            this.$http
+                .post('/user/all', { size: 10000, sort: 'id,desc', query: { invitor: row.id } }, { body: 'json' })
+                .then(res => {
+                    this.list = res.content;
+                    this.dialogLoading = false;
+                });
         }
     }
 };

+ 134 - 0
src/test/java/com/izouma/nineth/FixOverSale.java

@@ -0,0 +1,134 @@
+package com.izouma.nineth;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.huifu.adapay.model.Refund;
+import com.izouma.nineth.domain.Asset;
+import com.izouma.nineth.domain.Order;
+import com.izouma.nineth.enums.AssetStatus;
+import com.izouma.nineth.enums.CollectionSource;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.AssetRepo;
+import com.izouma.nineth.repo.CollectionRepo;
+import com.izouma.nineth.repo.OrderRepo;
+import com.izouma.nineth.repo.TokenHistoryRepo;
+import com.izouma.nineth.utils.SnowflakeIdWorker;
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.File;
+import java.io.IOException;
+import java.math.RoundingMode;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class FixOverSale extends ApplicationTests {
+    @Autowired
+    private OrderRepo         orderRepo;
+    @Autowired
+    private AssetRepo         assetRepo;
+    @Autowired
+    private TokenHistoryRepo  tokenHistoryRepo;
+    @Autowired
+    private SnowflakeIdWorker snowflakeIdWorker;
+    @Autowired
+    private CollectionRepo    collectionRepo;
+
+    @Test
+    public void fix() throws IOException {
+        List<Asset> assets = assetRepo.findOverNumber();
+        List<Order> successOrders = new ArrayList<>();
+        List<Asset> successAssets = new ArrayList<>();
+        List<TokenHistory> successHistory = new ArrayList<>();
+        List<Order> error = new ArrayList<>();
+        assets.parallelStream().forEach(asset -> {
+            Order order = null;
+            if (asset.getOrderId() != null) {
+                order = orderRepo.findById(asset.getOrderId()).orElse(null);
+            }
+            if (order != null && order.getSource() == CollectionSource.OFFICIAL
+                    && asset.getStatus() == AssetStatus.NORMAL) {
+                System.out.println(order.getTransactionId());
+                try {
+                    Map<String, Object> refundParams = new HashMap<>();
+                    refundParams.put("refund_amt", order.getTotalPrice()
+                            .setScale(2, RoundingMode.HALF_UP)
+                            .toPlainString());
+                    refundParams.put("refund_order_no", snowflakeIdWorker.nextId() + "");
+                    Map<String, Object> response = Refund.create(order.getTransactionId(), refundParams);
+                    System.out.println(JSON.toJSONString(response, SerializerFeature.PrettyFormat));
+                    if (StringUtils.isEmpty(MapUtils.getString(response, "id"))) {
+                        throw new BusinessException("err");
+                    }
+                    successOrders.add(order);
+                    successAssets.add(asset);
+                    successHistory.addAll(tokenHistoryRepo.findByTokenIdOrderByCreatedAtDesc(asset.getTokenId()));
+                    collectionRepo.deleteByAssetId(asset.getId());
+                    assetRepo.delete(asset);
+                    orderRepo.delete(order);
+                    tokenHistoryRepo.deleteByTokenId(asset.getTokenId());
+                } catch (Exception e) {
+                    error.add(order);
+                }
+            }
+        });
+        FileUtils.write(new File("/Users/drew/Desktop/0301Fix/success_orders.json"),
+                JSON.toJSONString(successOrders, SerializerFeature.PrettyFormat), StandardCharsets.UTF_8);
+        FileUtils.write(new File("/Users/drew/Desktop/0301Fix/success_assets.json"),
+                JSON.toJSONString(successAssets, SerializerFeature.PrettyFormat), StandardCharsets.UTF_8);
+        FileUtils.write(new File("/Users/drew/Desktop/0301Fix/success_history.json"),
+                JSON.toJSONString(successHistory, SerializerFeature.PrettyFormat), StandardCharsets.UTF_8);
+        FileUtils.write(new File("/Users/drew/Desktop/0301Fix/error.json"),
+                JSON.toJSONString(error, SerializerFeature.PrettyFormat), StandardCharsets.UTF_8);
+    }
+
+
+    @Test
+    public void verify() throws IOException {
+        List<Order> errors = new ArrayList<>();
+        JSON.parseArray(FileUtils.readFileToString(new File("/Users/drew/Desktop/0301Fix/error.json"), StandardCharsets.UTF_8), Order.class)
+                .parallelStream().forEach(order -> {
+                    try {
+                        Map<String, Object> refundParams = new HashMap<>(2);
+                        refundParams.put("payment_id", order.getTransactionId());
+                        Map<String, Object> refund = Refund.query(refundParams);
+                        JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(refund));
+                        if ("S".equals(jsonObject.getJSONArray("refunds")
+                                .getJSONObject(jsonObject.getJSONArray("refunds").size() - 1)
+                                .getString("trans_status"))) {
+
+                            Asset asset = assetRepo.findByOrderId(order.getId()).stream().findAny().orElse(null);
+                            if (asset != null) {
+                                tokenHistoryRepo.findByTokenIdOrderByCreatedAtDesc(asset.getTokenId());
+                                collectionRepo.deleteByAssetId(asset.getId());
+                                assetRepo.delete(asset);
+                                orderRepo.delete(order);
+                                tokenHistoryRepo.deleteByTokenId(asset.getTokenId());
+                            } else {
+                                errors.add(order);
+                            }
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        errors.add(order);
+                    }
+                });
+        FileUtils.write(new File("/Users/drew/Desktop/0301Fix/verify_error.json"),
+                JSON.toJSONString(errors, SerializerFeature.PrettyFormat), StandardCharsets.UTF_8);
+
+    }
+
+    @Test
+    public void fixOverNumber() {
+        List<Asset> assets = assetRepo.findOverNumber();
+
+    }
+}

+ 4 - 4
src/test/java/com/izouma/nineth/service/AdapayTest.java

@@ -26,14 +26,14 @@ import java.util.List;
 import java.util.Map;
 
 public class AdapayTest {
-    private final String appId = "app_f8760acc-f4d8-46f6-8f70-d80e36517075";
+    private final String appId = "app_843a743d-744e-4d73-bd60-3ebbee15d383";
 
     public AdapayTest() {
         Adapay.debug = false;
         Adapay.prodMode = true;
 
         MerConfig merConfig = new MerConfig();
-        merConfig.setApiKey("api_live_8818cac1-894b-40bc-ac77-803e02e9c260");
+        merConfig.setApiKey("api_live_c9db942a-b6d6-4cf7-b1b1-ec1e2873a7e7");
         merConfig.setApiMockKey("api_test_0b1b0eb9-30e1-4acd-8e03-10b529de1856");
         merConfig.setRSAPrivateKey("MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQCnIaIrFP598qcf/s3FqXxMTjrVAevnf1w5CAMdJqcRFv0WvdLEmNRxxqAYSLl/iQ8AyU4yqVwkwYqvn/aENBg0iQ5h5qboxb8T6xmrZLctk97TiIuCUwbd7Q5NBHJXzHlaKc1p1KBvTCJDMw8+t0Jh3sBkBvu7l0KPliEQHtPLBDkKvy3NBQD6BMy47kPersjSUH53HBvNpcjcPZGpUX/TmL3SNkS98RkoebFxuorK5UdazYN5xvarjfcYziShIjU3WIZJb52DGUxYWTk6vJKZrJhw7AhWIEQpH7qJxvml/B8RMQ4guHdtp3ojxwkHDtZdPU9rY8i6EHwba4qOYgobAgMBAAECggEAT36L5/oAYl+8ZleIAHBxEspS6WYUkvPdJbNN59uus04/60U2rxQSWFulYmeU87h5TmJxs18i2MjF8msfkhpFORfHo4FV+nm0PQEiIIezKRagcfUMhlx/c6eBmdh3mpNDVUN01NWxyb5ovZXXtnjsNikBUZKQwdVcb3d1GnnPO0xtt6/0xwiduCkA2ihS1tgnsYYDhMHgukIdZ3eczn3stRPQ+QyCt1JWS6DDd1nS3S2RyPZw8P9Z1zzJFVKH8z3bGqk3/98Lw7Hw+rKFnKhIA6/H9ZVORKw5OuGC3Ozy6cVbmUn8tuw3sC0NdR7w56dedB+fjJB8od0nahX1Cc6eQQKBgQDckcenslWqjs2PbncwW1wqlw7FdJX9rzJAg7kp9ItpHCoNi/kSgXeLphHXWJmyj7a1BkWynmTGxO48X3dPXUrDPFKJc42fSbxMgAQdtc/A2z+v7Ga/oUpH8jajKfKmcgeRX026R7gd9W0yi0EW+C0WdFhrzNKKY4shvnYy9lc+QwKBgQDB+mHSllqLqYru0bLrtKOKJXaR3N3INxDBZKnRqba4tUKN35IVIexiEMkHmC51jtjoRyA5Y+fc/8P11i9FbuShtRVGHWeyDibKlwff5zrETveSLTpSULBKZ6MsFSm0Fo1krSUC1QTUGG5VX/wwWm9AB2UKJqG5cMDd3i3RiPeDSQKBgBs1ED+rS83iF5Eduy4H1vKZ94R7wRSty7ERjoGSXK/2fWl2Xp7dwXVEYucBUtQnzg2+XFKQHzY1jH19+SWdCF/UzQmPa2S+n6+ACwHvL1VGtjBpJLN2nccKJZsyzW+imTRhYSEdP6TSZUnay4idzFH8v/tsJHxVkw/ygnn+0PwpAn8uOHsWsrzgioWQYmc/wss1H7ghCX/PNU/IxTOxwb7IRGiXZa5pWqv4sgc0yA5J9L+6mTgUdLnK7ybCbUbWRJY18fAfxOHwi26y10oJEA/wtuBG9H/xHUjkcc1vs5s8TiNi2d73zcpYv3mK3lQ5MVNQ7nIk+Q+QIE3UkBxa0UgpAoGBAMDwg0ebzBEZsV2cr/Er2b25LsXteDJ+V67plBNrv+A1/omA9a52sWek4bY0D+Uu6zPTDaLj9BhHC2wJmThYl0eLRKyDKYQslBR3h253Gsn3If6RH9/tSyDsQ88iAEI1f6QH27bGHL9VDrsLGEFg5E7ZEzFQuJPqoUvBOoURNwa6");
         merConfig.setRSAPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApyGiKxT+ffKnH/7Nxal8TE461QHr539cOQgDHSanERb9Fr3SxJjUccagGEi5f4kPAMlOMqlcJMGKr5/2hDQYNIkOYeam6MW/E+sZq2S3LZPe04iLglMG3e0OTQRyV8x5WinNadSgb0wiQzMPPrdCYd7AZAb7u5dCj5YhEB7TywQ5Cr8tzQUA+gTMuO5D3q7I0lB+dxwbzaXI3D2RqVF/05i90jZEvfEZKHmxcbqKyuVHWs2Decb2q433GM4koSI1N1iGSW+dgxlMWFk5OrySmayYcOwIViBEKR+6icb5pfwfETEOILh3bad6I8cJBw7WXT1Pa2PIuhB8G2uKjmIKGwIDAQAB");
@@ -198,9 +198,9 @@ public class AdapayTest {
     @Test
     public void singleRefund() throws BaseAdaPayException {
         Map<String, Object> refundParams = new HashMap<>();
-        refundParams.put("refund_amt", "250.00");
+        refundParams.put("refund_amt", "0.01");
         refundParams.put("refund_order_no", new SnowflakeIdWorker(0, 0).nextId() + "");
-        Map<String, Object> response = Refund.create("002112022022011030310341306906502942720", refundParams);
+        Map<String, Object> response = Refund.create("002112022030111085110344569856421703680", refundParams);
         System.out.println(JSON.toJSONString(response, SerializerFeature.PrettyFormat));
     }
 

+ 5 - 0
src/test/java/com/izouma/nineth/service/UserServiceTest.java

@@ -62,4 +62,9 @@ public class UserServiceTest extends ApplicationTests {
     public void switchAccount() {
         userService.switchAccount();
     }
+
+    @Test
+    public void test() {
+        userService.phoneRegister("18200001115", "1234", "123456", null, 7834L);
+    }
 }