|
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import reactor.core.publisher.Mono;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -44,9 +45,9 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "分页查询")
|
|
@Operation(summary = "分页查询")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public BasePageResult<IpInterfaceVO> paginQuery(IpInterfaceParam ipInterfaceParam){
|
|
|
|
|
|
|
+ public Mono<BasePageResult<IpInterfaceVO>> paginQuery(IpInterfaceParam ipInterfaceParam){
|
|
|
BasePageResult<IpInterfaceVO> ipAccountPOS = ipInterfaceService.paginQuery(ipInterfaceParam, ipInterfaceParam.getPageNum(), ipInterfaceParam.getPageSize());
|
|
BasePageResult<IpInterfaceVO> ipAccountPOS = ipInterfaceService.paginQuery(ipInterfaceParam, ipInterfaceParam.getPageNum(), ipInterfaceParam.getPageSize());
|
|
|
- return ipAccountPOS;
|
|
|
|
|
|
|
+ return Mono.just(ipAccountPOS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -57,13 +58,13 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "新增/更新数据")
|
|
@Operation(summary = "新增/更新数据")
|
|
|
@PostMapping("/saveOrUpdate")
|
|
@PostMapping("/saveOrUpdate")
|
|
|
- public BaseReturnDto<IpAccountVO> saveOrUpdate(@RequestBody IpInterfaceParam ipInterfaceParam){
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto<IpAccountVO>> saveOrUpdate(@RequestBody IpInterfaceParam ipInterfaceParam){
|
|
|
LoginUser user= TokenUtil.getUser();
|
|
LoginUser user= TokenUtil.getUser();
|
|
|
if(user==null || user.getUserid()==null || user.getUserid()==0L){
|
|
if(user==null || user.getUserid()==null || user.getUserid()==0L){
|
|
|
throw new RuntimeException("没有找到用户信息");
|
|
throw new RuntimeException("没有找到用户信息");
|
|
|
}
|
|
}
|
|
|
ipInterfaceService.saveOrUpdate(ipInterfaceParam,user.getUsername(),user.getUserid());
|
|
ipInterfaceService.saveOrUpdate(ipInterfaceParam,user.getUsername(),user.getUserid());
|
|
|
- return BaseReturnDto.success();
|
|
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -74,9 +75,9 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "通过主键删除数据")
|
|
@Operation(summary = "通过主键删除数据")
|
|
|
@DeleteMapping("/delete/{id}")
|
|
@DeleteMapping("/delete/{id}")
|
|
|
- public BaseReturnDto<Boolean> deleteById(@PathVariable Long id){
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto<Boolean>> deleteById(@PathVariable Long id){
|
|
|
LoginUser user = TokenUtil.getUser();
|
|
LoginUser user = TokenUtil.getUser();
|
|
|
- return BaseReturnDto.success(ipInterfaceService.deleteById(id,user));
|
|
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success(ipInterfaceService.deleteById(id,user)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -86,8 +87,8 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "修改状态")
|
|
@Operation(summary = "修改状态")
|
|
|
@PostMapping("/switchStatus")
|
|
@PostMapping("/switchStatus")
|
|
|
- public BaseReturnDto<Boolean> switchStatus(@RequestBody SwitchStatusParam switchStatusParam){
|
|
|
|
|
- return BaseReturnDto.success(ipInterfaceService.switchStatus(switchStatusParam));
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto<Boolean>> switchStatus(@RequestBody SwitchStatusParam switchStatusParam){
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success(ipInterfaceService.switchStatus(switchStatusParam)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -97,8 +98,8 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "接口下拉列表")
|
|
@Operation(summary = "接口下拉列表")
|
|
|
@PostMapping("/optionList")
|
|
@PostMapping("/optionList")
|
|
|
- public BaseReturnDto<List<NameValueVO>> optionList(){
|
|
|
|
|
- return BaseReturnDto.success(ipInterfaceService.optionList());
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto<List<NameValueVO>>> optionList(){
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success(ipInterfaceService.optionList()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -106,10 +107,10 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "账号配置接口")
|
|
@Operation(summary = "账号配置接口")
|
|
|
@PostMapping("/interfaceConfig")
|
|
@PostMapping("/interfaceConfig")
|
|
|
- public BaseReturnDto interfaceConfig(@RequestBody InterfaceConfigParam param){
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto> interfaceConfig(@RequestBody InterfaceConfigParam param){
|
|
|
LoginUser user = TokenUtil.getUser();
|
|
LoginUser user = TokenUtil.getUser();
|
|
|
ipTokenInterfaceService.interfaceConfig(param,user);
|
|
ipTokenInterfaceService.interfaceConfig(param,user);
|
|
|
- return BaseReturnDto.success();
|
|
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -118,13 +119,13 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "生成 token")
|
|
@Operation(summary = "生成 token")
|
|
|
@PostMapping("/token/generate")
|
|
@PostMapping("/token/generate")
|
|
|
- public BaseReturnDto<SecretVO> generateToken(){
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto<SecretVO>> generateToken(){
|
|
|
SecretVO vo = new SecretVO();
|
|
SecretVO vo = new SecretVO();
|
|
|
String secret = RandomStringUtils.random(64, "0123456789abcdef");
|
|
String secret = RandomStringUtils.random(64, "0123456789abcdef");
|
|
|
String token = RandomStringUtils.random(32, "0123456789abcdef");
|
|
String token = RandomStringUtils.random(32, "0123456789abcdef");
|
|
|
vo.setToken(token);
|
|
vo.setToken(token);
|
|
|
vo.setSecret(secret);
|
|
vo.setSecret(secret);
|
|
|
- return BaseReturnDto.success(vo);
|
|
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success(vo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -133,10 +134,10 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "删除账号关联的接口")
|
|
@Operation(summary = "删除账号关联的接口")
|
|
|
@DeleteMapping("/delAccountInterface/{id}")
|
|
@DeleteMapping("/delAccountInterface/{id}")
|
|
|
- public BaseReturnDto delAccountInterface(@PathVariable Long id){
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto> delAccountInterface(@PathVariable Long id){
|
|
|
LoginUser user = TokenUtil.getUser();
|
|
LoginUser user = TokenUtil.getUser();
|
|
|
ipTokenInterfaceService.delAccountInterface(id,user);
|
|
ipTokenInterfaceService.delAccountInterface(id,user);
|
|
|
- return BaseReturnDto.success();
|
|
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -144,9 +145,9 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "查询账号下关联的接口列表")
|
|
@Operation(summary = "查询账号下关联的接口列表")
|
|
|
@PostMapping("/account/ref/list")
|
|
@PostMapping("/account/ref/list")
|
|
|
- public BasePageResult<AccountInterfaceVO> accountInterfaceList(@RequestBody AccountInterfaceParam pageParam){
|
|
|
|
|
|
|
+ public Mono<BasePageResult<AccountInterfaceVO>> accountInterfaceList(@RequestBody AccountInterfaceParam pageParam){
|
|
|
BasePageResult<AccountInterfaceVO> result = ipTokenInterfaceService.accountInterfaceList(pageParam);
|
|
BasePageResult<AccountInterfaceVO> result = ipTokenInterfaceService.accountInterfaceList(pageParam);
|
|
|
- return result;
|
|
|
|
|
|
|
+ return Mono.just(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -156,7 +157,7 @@ public class IpInterfaceController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "修改状态")
|
|
@Operation(summary = "修改状态")
|
|
|
@PostMapping("/account/interface/ref/switchStatus")
|
|
@PostMapping("/account/interface/ref/switchStatus")
|
|
|
- public BaseReturnDto<Boolean> accountInterfaceRefSwitch(@RequestBody SwitchStatusParam switchStatusParam){
|
|
|
|
|
- return BaseReturnDto.success(ipTokenInterfaceService.switchStatus(switchStatusParam));
|
|
|
|
|
|
|
+ public Mono<BaseReturnDto<Boolean>> accountInterfaceRefSwitch(@RequestBody SwitchStatusParam switchStatusParam){
|
|
|
|
|
+ return Mono.just(BaseReturnDto.success(ipTokenInterfaceService.switchStatus(switchStatusParam)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|