Slide 23
Slide 23 text
υΩϡϝϯτϕʔεͷܕ҆શͳϩά࣮ίʔυࣗಈੜ
֓ཁ
wϩάఆٛυΩϡϝϯτʢ.BSLEPXOʣ͔Β
ϩά࣮ίʔυʢ4XJGUʣΛࣗಈੜ
τϥϯεύΠϧ
# recipe_search
Ϩγϐݕࡧը໘ͷΠϕϯτͰ͢
## search
ϨγϐݕࡧΛߦͬͨࡍʹૹ͞Ε·͢
- keyword: !string 256
- ݕࡧΩʔϫʔυ
- order: SearchOrder
- ݕࡧॱ
- latest,popularity
## show_recipe
ݕࡧ݁Ռը໘͔ΒϨγϐৄࡉը໘ʹભҠ͢Δࡍʹૹ͞Ε·͢
- recipe_id: !integer
- දࣔͨ͠ϨγϐͷID
/// Ϩγϐݕࡧը໘ͷΠϕϯτͰ͢
public enum RecipeSearch: LogCategory {
public static var categoryName: String { "recipe_search" }
public var eventName: String {
switch self {
case .search: return "search"
case .showRecipe: return "show_recipe"
}
}
public func makePayload() -> [String: Any] {
switch self {
case let .search(keyword, order):
return [
"keyword": keyword.validateLength(within: 256).dump(),
"order": order.dump(),
].compactMapValues { $0 }
case let .showRecipe(recipeId):
return [
"recipe_id": recipeId.dump(),
].compactMapValues { $0 }
}
}
/// ϨγϐݕࡧΛߦͬͨࡍʹૹ͞Ε·͢
case search(keyword: String, order: SearchOrder)
/// ݕࡧ݁Ռը໘͔ΒϨγϐৄࡉը໘ʹભҠ͢Δࡍʹૹ͞Ε·͢
case showRecipe(recipeId: Int64)
}
ਓ͕ॻ͍ͨ.BSLEPXOܗࣜͷυΩϡϝϯτ ࣗಈੜ͞ΕΔ4XJGUͷίʔυ
The Swift logo is a trademark of Apple Inc. https://developer.apple.com/swift/resources/
The Markdown Mark https://github.com/dcurtis/markdown-mark