我在表中有两个唯一的键:id和userId。如果两个键中的任何一个作为路径变量给出,我必须在 Spring 中创建一个 REST API 来获取用户详细信息。
这里的挑战是我们必须创建两个不同的端点来让用户通过id和 让用户通过userId,但对两者使用相同的方法。我的表中还有idis的数据类型long和userIdis的数据类型String。
所以我正在尝试执行以下操作:
@RequestMapping(value = {"/{id}","/user/{id}"}, method=RequestMethod.GET)
public response getUser(@PathVariable("id") String id) {
}
Run Code Online (Sandbox Code Playgroud)
但我无法弄清楚如何检查我是否获得了该方法id或userId在该方法内。这也是正确的方法吗?
我想在 python 中使用 selenium 选择一个复选框。以下是复选框的 HTML。将鼠标悬停在复选框上时,跨度元素会突出显示
超文本标记语言
<div id="rc-anchor-container" class="rc-anchor rc-anchor-normal rc-anchor-light">
<div id="recaptcha-accessible-status" class="rc-anchor-aria-status" aria-hidden="true">Recaptcha requires verification. </div>
<div class="rc-anchor-error-msg-container" style="display:none"><span class="rc-anchor-error-msg" aria-hidden="true"></span></div>
<div class="rc-anchor-content">
<div class="rc-inline-block">
<div class="rc-anchor-center-container">
<div class="rc-anchor-center-item rc-anchor-checkbox-holder"><span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox" role="checkbox" aria-checked="false" id="recaptcha-anchor" tabindex="0" dir="ltr" aria-labelledby="recaptcha-anchor-label"><div class="recaptcha-checkbox-border" role="presentation"></div><div class="recaptcha-checkbox-borderAnimation" role="presentation"></div><div class="recaptcha-checkbox-spinner" role="presentation"></div><div class="recaptcha-checkbox-spinnerAnimation" role="presentation"></div><div class="recaptcha-checkbox-checkmark" role="presentation"></div></span></div>
</div>
</div>
<div class="rc-inline-block">
<div class="rc-anchor-center-container">
<label class="rc-anchor-center-item rc-anchor-checkbox-label" aria-hidden="true" role="presentation" id="recaptcha-anchor-label"><span aria-live="polite" aria-labelledby="recaptcha-accessible-status"></span>I'm not a robot</label>
</div>
</div>
</div>
<div class="rc-anchor-normal-footer">
<div class="rc-anchor-logo-portrait" aria-hidden="true" role="presentation">
<div …Run Code Online (Sandbox Code Playgroud)