小红书代理修改

master
yqy 1 year ago
parent b061a03f98
commit 33a1b87475

@ -39,7 +39,7 @@ public class ProxyController {
@PostMapping("/add") @PostMapping("/add")
@Inner(value = false) @Inner(value = false)
@ApiOperation("添加") @ApiOperation("添加IP")
public Result<?> add(@Validated({AddGroup.class}) @RequestBody ProxyEntity proxyEntity){ public Result<?> add(@Validated({AddGroup.class}) @RequestBody ProxyEntity proxyEntity){
proxyService.add(proxyEntity); proxyService.add(proxyEntity);
return Result.success(); return Result.success();
@ -47,7 +47,7 @@ public class ProxyController {
@PostMapping("/update") @PostMapping("/update")
@Inner(value = false) @Inner(value = false)
@ApiOperation("修改") @ApiOperation("修改IP")
public Result<?> update(@Validated({UpdateGroup.class}) @RequestBody ProxyEntity proxyEntity){ public Result<?> update(@Validated({UpdateGroup.class}) @RequestBody ProxyEntity proxyEntity){
proxyService.update(proxyEntity); proxyService.update(proxyEntity);
return Result.success(); return Result.success();
@ -63,7 +63,7 @@ public class ProxyController {
@GetMapping("/ipBindingList") @GetMapping("/ipBindingList")
@Inner(value = false) @Inner(value = false)
@ApiOperation("IP绑定手机号列表") @ApiOperation("IP绑定手机号-列表")
public PageResult ipBindingList(ProxyDTO proxyDTO, Pageable pageable){ public PageResult ipBindingList(ProxyDTO proxyDTO, Pageable pageable){
return proxyService.ipBindingList(proxyDTO, pageable); return proxyService.ipBindingList(proxyDTO, pageable);
} }
@ -83,11 +83,11 @@ public class ProxyController {
return Result.success(); return Result.success();
} }
@GetMapping("/replaceAccountIp") @GetMapping("/addAccountIp")
@Inner(value = false) @Inner(value = false)
@ApiOperation("替换账号绑定IP") @ApiOperation("添加账号-IP绑定")
public Result<?> replaceAccountIp(@RequestParam("proxyId") Long proxyId, @RequestParam("phone") String phone){ public Result<?> addAccountIp(@RequestParam("proxyId") Long proxyId, @RequestParam("phone") String phone){
proxyService.replaceAccountIp(proxyId, phone); proxyService.addAccountIp(proxyId, phone);
return Result.success(); return Result.success();
} }

@ -52,7 +52,7 @@ public interface ProxyService {
/** /**
* IP * IP
*/ */
void replaceAccountIp(Long proxyId, String phone); void addAccountIp(Long proxyId, String phone);
/** /**
* *

@ -180,7 +180,7 @@ public class ProxyServiceImpl implements ProxyService {
Page<ProxyEntity> page = new Page<>(pageable.getPageNumber(), pageable.getPageSize()); Page<ProxyEntity> page = new Page<>(pageable.getPageNumber(), pageable.getPageSize());
LambdaQueryWrapper<ProxyEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProxyEntity> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(ip)) wrapper.eq(ProxyEntity::getIp, ip); if (StringUtils.isNotBlank(ip)) wrapper.like(ProxyEntity::getIp, ip);
List<ProxyAccountEntity> entities; List<ProxyAccountEntity> entities;
if (StringUtils.isNotBlank(phone)) { if (StringUtils.isNotBlank(phone)) {
@ -215,12 +215,9 @@ public class ProxyServiceImpl implements ProxyService {
} }
@Override @Override
public void replaceAccountIp(Long proxyId, String phone) { public void addAccountIp(Long proxyId, String phone) {
ProxyAccountEntity proxyAccountEntity = proxyAccountMapper.selectOne(new LambdaQueryWrapper<ProxyAccountEntity>() ProxyAccountEntity proxyAccountEntity = new ProxyAccountEntity(phone, proxyId);
.eq(ProxyAccountEntity::getNid, phone)); proxyAccountMapper.insert(proxyAccountEntity);
proxyAccountEntity.setProxyId(proxyId);
proxyAccountMapper.updateById(proxyAccountEntity);
} }
@Override @Override

Loading…
Cancel
Save