MCPcopy Create free account
hub / github.com/Semporia/Scripts / opt

Function opt

jd_try.js:242–268  ·  view source on GitHub ↗
(ids)

Source from the content-addressed store, hash-verified

240
241async function getApplyStateByActivityIds() {
242 function opt(ids) {
243 return new Promise((resolve, reject) => {
244 $.get(taskurl(`${selfDomain}/getApplyStateByActivityIds?activityIds=${ids.join(',')}`), (err, resp, data) => {
245 try {
246 if (err) {
247 console.log(`🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(err)}`)
248 } else {
249 data = JSON.parse(data)
250 ids.length = 0
251 for (let apply of data) ids.push(apply.activityId)
252 }
253 } catch (e) {
254 reject(`⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(data)}`)
255 } finally {
256 $.goodList = $.goodList.filter(good => {
257 for (let id of ids) {
258 if (id == good.id) {
259 return false
260 }
261 }
262 return true
263 })
264 resolve()
265 }
266 })
267 })
268 }
269
270 let list = []
271 for (let good of $.goodList) {

Callers 1

Calls 3

taskurlFunction · 0.70
getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected