checkin.js
2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* @Date: 2025-06-06 09:26:16
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-06 16:19:13
* @FilePath: /mlaj/src/api/checkin.js
* @Description: 签到模块相关接口
*/
import { fn, fetch } from './fn'
const Api = {
GET_TASK_LIST: '/srv/?a=task&t=my_list',
GET_TASK_DETAIL: '/srv/?a=task&t=detail',
TASK_CHECKIN: '/srv/?a=checkin&t=checkin',
TASK_UPLOAD_ADD: '/srv/?a=checkin&t=upload_add',
TASK_UPLOAD_LIST: '/srv/?a=checkin&t=upload_list',
}
/**
* @description: 获取签到类型列表
* @param: keyword 搜索课程名称
* @return: data: [{ id 作业id, title 作业名称, begin_date 开始时间, end_date 结束时间, task_type 任务类型 [checkin=签到 | file=上传附件], is_gray 作业是否应该置灰 }]
*/
export const getTaskListAPI = (params) => fn(fetch.get(Api.GET_TASK_LIST, params))
/**
* @description: 获取作业详情
* @param: i 作业id
* @param: month 月份
* @returns data: { id 作业id, title 作业名称, frequency 交作业的频次, begin_date 开始时间, end_date 结束时间, task_type 任务类型 [checkin=签到 | file=上传附件], is_gray 作业是否应该置灰, my_checkin_dates 我在日历中打过卡的日期, target_number 打卡的目标数量, checkin_number 已经打卡的数量, checkin_avatars 最后打卡的10个人的头像 }
*/
export const getTaskDetailAPI = (params) => fn(fetch.get(Api.GET_TASK_DETAIL, params))
/**
* @description: 签到打卡
* @param task_id 签到作业ID
* @returns
*/
export const checkinTaskAPI = (params) => fn(fetch.post(Api.TASK_CHECKIN, params))
/**
* @description: 新增上传打卡
* @param task_id 上传作业ID
* @param note 打卡文字
* @param meta_id[] 附件ID列表
* @param file_type 上传附件的类型 image=上传图片,video=视频,audio=音频
* @returns
*/
export const addUploadTaskAPI = (params) => fn(fetch.post(Api.TASK_UPLOAD_ADD, params))
/**
* @description: 获取打卡动态列表
* @param task_id 上传作业ID
* @param date 日期
* @param keyword 搜索
* @param order_by_time asc=正序,desc=倒序。默认为倒序
* @param limit
* @param offset
* @returns
*/
export const getUploadTaskListAPI = (params) => fn(fetch.post(Api.TASK_UPLOAD_LIST, params))