Files
UserBaseService/src/main/java/com/yunhai/userbase/model/identity/IdentitySwitchOapiRequest.java
T
chenxing c588dedea7
ci-userbase-service / build-and-push (push) Successful in 44s
跨校身份修订
2026-08-27 20:14:12 +08:00

31 lines
1.0 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.yunhai.userbase.model.identity;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 开放接口(oapi)切换身份入参:目标用户 + 目标学校与该学校下的角色。<br>
* 服务端校验 (userId, roleId, schoolId) 在 {@code sys_user_role_rel} 中存在且正常态,
* 不存在则拒绝(防止越权切换到非授权身份)。<br>
* 调用方应用须在 {@code yh.identity.switch-allowed-app-keys} 白名单内(AppKey 级闸门)。
*
* @author chenx
* @date 2026/8/27
*/
@Data
public class IdentitySwitchOapiRequest {
/** 目标用户ID(由调用方应用后端从登录会话获取,禁止前端透传) */
@NotNull(message = "用户ID不能为空")
private Integer userId;
/** 目标角色ID(SysRoleEnum.key) */
@NotNull(message = "角色ID不能为空")
private Integer roleId;
/** 目标学校ID(=学校组 sys_group.id;无学校维度传 0) */
@NotNull(message = "学校ID不能为空")
private Integer schoolId;
}