[back/refactor] remove function parameter

This commit is contained in:
SouthFox 2023-09-12 21:50:45 +08:00
parent 64aa07a572
commit 44ea7aaca9

View file

@ -149,22 +149,20 @@
question-json)) question-json))
(defn build-paging-next (defn build-paging-next
[question-id next] [next-url]
(let [cursor (last (re-find #"cursor=(.*?)&" next)) (let [cursor (last (re-find #"cursor=(.*?)&" next-url))
session-id (last (re-find #"session_id=(.*?)(?:&|$)" next))] session-id (last (re-find #"session_id=(.*?)(?:&|$)" next-url))]
{"cursor" cursor
{"question_id" question-id "session_id" session-id}))
"cursor" cursor
"session_id" session-id}
))
(defn process-api-paging (defn process-api-paging
[question-id docs] [question-id docs]
(let [next (get docs "next")] (let [next-url (get docs "next")]
{:paging (merge {:paging (merge
{"page" (get docs "page") {"page" (get docs "page")
"is_end" (get docs "is_end")} "is_end" (get docs "is_end")
(build-paging-next question-id next))})) "question_id" question-id}
(build-paging-next next-url))}))
(defn process-json-paging (defn process-json-paging
[question-id docs] [question-id docs]
@ -175,8 +173,9 @@
(let [next_url (get answers "next")] (let [next_url (get answers "next")]
{:paging (merge {:paging (merge
{"page" nil {"page" nil
"is_end" false} "is_end" false
(build-paging-next question-id next_url))})))) "question_id" question-id}
(build-paging-next next_url))}))))
(defn fetch-hu-question (defn fetch-hu-question
[request params] [request params]