mybatis-plus 查询 url拼接参数
1.GetMapping url中带参数
1.1 controller
// Request URL:http://127.0.0.1/user/userAddress/getCoinAddress/coinId
@GetMapping("/getCoi/user/userAddress/getCoinAddress/coinIdnAddress/{coinId}")
public R getCoinAddress(@PathVariable("coinId") Long coinId){String userId = SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString();UserAddress userAddress = userAddressService.getUserAddressByUserIdAndCoinId(userId,coinId) ;return R.ok(userAddress.getAddress()) ;}
1.2server
/*** 使用用户的Id 和币种的Id 查询用户的充币地址* @param userId* @param coinId* @return*/UserAddress getUserAddressByUserIdAndCoinId(String userId, Long coinId);
1.3serverimpl
/*** 使用用户的Id 和币种的Id 查询用户的充币地址** @param userId* @param coinId* @return*/@Overridepublic UserAddress getUserAddressByUserIdAndCoinId(String userId, Long coinId) {return getOne(new LambdaQueryWrapper().eq(UserAddress::getUserId,userId).eq(UserAddress::getCoinId,coinId));}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
