-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
astraea-974 Implement RecordHandler post request #1156
Changes from 4 commits
c71e2fe
d291d36
8cac794
95493ca
1851625
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.astraea.app.web; | ||
|
||
public interface Request { | ||
|
||
/** Indicates the object used in the request */ | ||
interface RequestObject {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不好意思,我不太確定這個介面的用途是什麼? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 主要想解決 之前提過的一個問題
像是以下
這裡直接在那些PostRecord上面加上這個interface 來做驗證 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不好意思,我最近記憶力有點薄弱,我講錯的話就請提醒我一下 現在的驗證是驗證一個「建構出來的物件」,因此 records 這個變數我們就是驗證它是否為 null 以及 它內涵的物件(而非generic type)是否有符合規範。 條列的地來說,一個 Request / Response 物件只能有三種 members
因此在我的想像中,PostRecord 應該也是繼承 Request 就好 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我先合併這隻PR,後面接著微調,以免擋著太多 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 瞭解 |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這邊簡單一點,就直接呼叫
toString
取代PostRequest.handle
,然後留個TODO,描述說要處理只能傳入 number and string,並且開好對應的議題There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1163