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) } NBLFίϚϯυ ϩάఆٛͷྻڍܕʢFOVNʣɹ /// Ϩγϐݕࡧը໘ͷΠϕϯτͰ͢ public enum RecipeSearch: LogCategory { ʢதུʣ ɹ /// ϨγϐݕࡧΛߦͬͨࡍʹૹ͞Ε·͢ case search(keyword: String, order: SearchOrder) /// ݕࡧ݁Ռը໘͔ΒϨγϐৄࡉը໘ʹભ…… case showRecipe(recipeId: Int64) }