mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
Deploying to gh-pages from @ 7bea70565583e9b9f1db58694f682de94972e46d 🚀
This commit is contained in:
@@ -1134,6 +1134,28 @@
|
||||
<a href="#1134" id="1134">1134</a>
|
||||
<a href="#1135" id="1135">1135</a>
|
||||
<a href="#1136" id="1136">1136</a>
|
||||
<a href="#1137" id="1137">1137</a>
|
||||
<a href="#1138" id="1138">1138</a>
|
||||
<a href="#1139" id="1139">1139</a>
|
||||
<a href="#1140" id="1140">1140</a>
|
||||
<a href="#1141" id="1141">1141</a>
|
||||
<a href="#1142" id="1142">1142</a>
|
||||
<a href="#1143" id="1143">1143</a>
|
||||
<a href="#1144" id="1144">1144</a>
|
||||
<a href="#1145" id="1145">1145</a>
|
||||
<a href="#1146" id="1146">1146</a>
|
||||
<a href="#1147" id="1147">1147</a>
|
||||
<a href="#1148" id="1148">1148</a>
|
||||
<a href="#1149" id="1149">1149</a>
|
||||
<a href="#1150" id="1150">1150</a>
|
||||
<a href="#1151" id="1151">1151</a>
|
||||
<a href="#1152" id="1152">1152</a>
|
||||
<a href="#1153" id="1153">1153</a>
|
||||
<a href="#1154" id="1154">1154</a>
|
||||
<a href="#1155" id="1155">1155</a>
|
||||
<a href="#1156" id="1156">1156</a>
|
||||
<a href="#1157" id="1157">1157</a>
|
||||
<a href="#1158" id="1158">1158</a>
|
||||
</pre></div><pre class="rust"><code><span class="comment">// Copyright (C) 2022 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
@@ -2123,12 +2145,8 @@
|
||||
<span class="kw-2">&</span><span class="self">self</span>,
|
||||
captcha_id: <span class="kw-2">&</span>str,
|
||||
) -> DBResult<String> {
|
||||
<span class="kw">struct </span>ID {
|
||||
psuedo_id: String,
|
||||
}
|
||||
|
||||
<span class="kw">let </span>res = <span class="macro">sqlx::query_as!</span>(
|
||||
ID,
|
||||
PsuedoID,
|
||||
<span class="string">"SELECT psuedo_id FROM
|
||||
mcaptcha_psuedo_campaign_id
|
||||
WHERE
|
||||
@@ -2205,6 +2223,28 @@
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
<span class="doccomment">/// Get all psuedo IDs
|
||||
</span><span class="kw">async fn </span>analytics_get_all_psuedo_ids(<span class="kw-2">&</span><span class="self">self</span>, page: usize) -> DBResult<Vec<String>> {
|
||||
<span class="kw">const </span>LIMIT: usize = <span class="number">50</span>;
|
||||
<span class="kw">let </span>offset = LIMIT * page;
|
||||
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>res = <span class="macro">sqlx::query_as!</span>(
|
||||
PsuedoID,
|
||||
<span class="string">"
|
||||
SELECT
|
||||
psuedo_id
|
||||
FROM
|
||||
mcaptcha_psuedo_campaign_id
|
||||
ORDER BY ID ASC LIMIT ? OFFSET ?;"</span>,
|
||||
LIMIT <span class="kw">as </span>i64,
|
||||
offset <span class="kw">as </span>i64
|
||||
)
|
||||
.fetch_all(<span class="kw-2">&</span><span class="self">self</span>.pool)
|
||||
.<span class="kw">await
|
||||
</span>.map_err(|e| map_row_not_found_err(e, DBError::CaptchaNotFound))<span class="question-mark">?</span>;
|
||||
|
||||
<span class="prelude-val">Ok</span>(res.drain(<span class="number">0</span>..).map(|r| r.psuedo_id).collect())
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attr">#[derive(Clone)]
|
||||
@@ -2270,4 +2310,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">struct </span>PsuedoID {
|
||||
psuedo_id: String,
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
||||
Reference in New Issue
Block a user