Update pom.xml for MyBatis Plus integration and downgrade Spring Boot version; refactor validation imports from Jakarta to Javax; modify mappers to extend BaseMapper for CRUD operations; clean up unused MyBatis-Flex mappers; adjust application.yml for MyBatis Plus configuration.
This commit is contained in:
@@ -28,7 +28,7 @@ public class UserService {
|
||||
* 根据ID获取用户账户
|
||||
*/
|
||||
public Mono<AccountResponse> getById(Long id) {
|
||||
return Mono.fromCallable(() -> userAccountMapper.findById(id))
|
||||
return Mono.fromCallable(() -> userAccountMapper.selectById(id))
|
||||
.subscribeOn(Schedulers.boundedElastic())
|
||||
.filter(Objects::nonNull)
|
||||
.map(this::toAccountResponse);
|
||||
|
||||
@@ -68,7 +68,7 @@ public class AccountService {
|
||||
}
|
||||
|
||||
public Mono<AccountResponse> get(Long id) {
|
||||
return Mono.fromCallable(() -> mapper.findById(id))
|
||||
return Mono.fromCallable(() -> mapper.selectById(id))
|
||||
.subscribeOn(Schedulers.boundedElastic())
|
||||
.map(this::toResp);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class AccountService {
|
||||
@Transactional
|
||||
public Mono<AccountResponse> update(Long id, AccountUpdateRequest req) {
|
||||
return Mono.fromCallable(() -> {
|
||||
UserAccount db = mapper.findById(id);
|
||||
UserAccount db = mapper.selectById(id);
|
||||
if (db == null) return null;
|
||||
|
||||
// 验证用户名唯一性(如果要更新用户名)
|
||||
@@ -120,8 +120,8 @@ public class AccountService {
|
||||
}
|
||||
}
|
||||
|
||||
mapper.update(patch);
|
||||
return mapper.findById(id);
|
||||
mapper.updateById(patch);
|
||||
return mapper.selectById(id);
|
||||
})
|
||||
.subscribeOn(Schedulers.boundedElastic())
|
||||
.map(this::toResp);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class LinkGenerationService {
|
||||
}
|
||||
|
||||
// 获取操作者账户信息
|
||||
UserAccount operator = userAccountMapper.findById(operatorId);
|
||||
UserAccount operator = userAccountMapper.selectById(operatorId);
|
||||
if (operator == null) {
|
||||
throw new IllegalArgumentException("操作者账户不存在");
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class LinkGenerationService {
|
||||
UserAccount patch = new UserAccount();
|
||||
patch.setId(operator.getId());
|
||||
patch.setPointsBalance(after);
|
||||
userAccountMapper.update(patch);
|
||||
userAccountMapper.updateById(patch);
|
||||
}
|
||||
|
||||
GenerateResult result = new GenerateResult();
|
||||
|
||||
Reference in New Issue
Block a user