package com.xiaopeng.account.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaopeng.account.service.IXpOperationsRoleService;
import com.xiaopeng.api.model.account.XpOperationsRole;
import com.xiaopeng.common.core.domain.R;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
*
* 运维人员角色中间表 前端控制器
*
*
* @author mitao
* @since 2026-02-03
*/
@RestController
public class XpOperationsRoleController {
@Resource
private IXpOperationsRoleService xpOperationsRoleService;
/**
* 内部调用
* 查询角色对于的运维人员
* @param roleId
* @return
*/
@GetMapping("/logan/inner/xp-operations-role/getXpOperationsRoleByRoleId")
public R> getXpOperationsRoleByRoleId(@RequestParam("roleId") Long roleId) {
List list = xpOperationsRoleService.list(new QueryWrapper().eq("role_id", roleId));
return R.ok(list);
}
/**
* 内部调用
* 查询运维人员关联的角色列表
*
* @param operationUserId 运维人员id
*/
@GetMapping("/logan/inner/xp-operations-role/listByOperationUserId")
public R> listByOperationUserId(@RequestParam("operationUserId") Long operationUserId) {
List list = xpOperationsRoleService.list(new QueryWrapper()
.eq("operations_user_id", operationUserId));
return R.ok(list);
}
/**
* 内部调用
* 查询角色关联的运维人员
* @param roleIds
* @return
*/
@PostMapping("/logan/inner/xp-operations-role/getXpOperationsRoleByRoleIds")
public R> getXpOperationsRoleByRoleIds(@RequestBody List roleIds) {
List list = xpOperationsRoleService.list(new LambdaQueryWrapper().in(XpOperationsRole::getRoleId, roleIds));
return R.ok(list);
}
}