feat:
1. add merchant update address limit
This commit is contained in:
@@ -444,6 +444,12 @@ public class ARMerchantManager {
|
||||
|
||||
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();
|
||||
|
||||
RegionInfo regionInfo = regionInfoService.getById(request.getRegionId());
|
||||
|
||||
@@ -604,5 +604,5 @@ public interface ParamService extends IService<Param> {
|
||||
|
||||
String findZYPARAuthToken();
|
||||
|
||||
|
||||
Long queryARUpdateLimit();
|
||||
}
|
||||
|
||||
@@ -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_UPDATE_LIMIT = "zyp.ar.update.limit";
|
||||
|
||||
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long queryARUpdateLimit() {
|
||||
Param param = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamKey, ZYP_AR_UPDATE_LIMIT));
|
||||
return Long.parseLong(param.getParamValue());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user