1. add merchant update address limit
This commit is contained in:
2025-11-06 13:03:32 +08:00
parent b474c285f9
commit 77186b4612
3 changed files with 14 additions and 1 deletions

View File

@@ -444,6 +444,12 @@ public class ARMerchantManager {
Assert.notNull(merchantInfo, "未授权商家"); Assert.notNull(merchantInfo, "未授权商家");
long updateLimit = paramService.queryARUpdateLimit();
long count = arMerchantAddressLogService.count(Wrappers.<ArMerchantAddressLog>lambdaQuery().eq(ArMerchantAddressLog::getUserId, request.getUserId()));
Assert.isTrue(updateLimit>= count, "超过修改次数上限");
String oldValue = merchantInfo.getAddress(); String oldValue = merchantInfo.getAddress();
RegionInfo regionInfo = regionInfoService.getById(request.getRegionId()); RegionInfo regionInfo = regionInfoService.getById(request.getRegionId());

View File

@@ -604,5 +604,5 @@ public interface ParamService extends IService<Param> {
String findZYPARAuthToken(); String findZYPARAuthToken();
Long queryARUpdateLimit();
} }

View File

@@ -221,6 +221,8 @@ public class ParamServiceImpl extends ServiceImpl<ParamMapper, Param> implements
public static final String ZYP_AR_AUTH_TOKEN = "zyp.ar.auth.token"; public static final String ZYP_AR_AUTH_TOKEN = "zyp.ar.auth.token";
public static final String ZYP_AR_UPDATE_LIMIT = "zyp.ar.update.limit";
@NonNull @NonNull
@@ -1244,4 +1246,9 @@ public class ParamServiceImpl extends ServiceImpl<ParamMapper, Param> implements
return getOne(new LambdaQueryWrapper<Param>().eq(Param::getParamKey, ZYP_AR_AUTH_TOKEN)).getParamValue(); return getOne(new LambdaQueryWrapper<Param>().eq(Param::getParamKey, ZYP_AR_AUTH_TOKEN)).getParamValue();
} }
@Override
public Long queryARUpdateLimit() {
Param param = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamKey, ZYP_AR_UPDATE_LIMIT));
return Long.parseLong(param.getParamValue());
}
} }