import { get, post } from './request'

const taskApi = {
  /**
   * 获取日常任务
   */
  getUserDailyTask: async (config: any): Promise<any> => {
    return await get('/taskConfig/getUserDailyTask', undefined, config)
  },

  /**
   * 获取周长任务
   */
  getUserWeekTask: async (config: any): Promise<any> => {
    return await get('/taskConfig/getUserWeekTask', undefined, config)
  },

  /**
   * 获取家长任务
   */
  getParentOrTeacherTask: async (config: any): Promise<any> => {
    return await get('/taskConfig/getParentOrTeacherTask/parent', undefined, config)
  },

  /**
   * 获取新手任务
   */
  getNewbieTask: async (config: any): Promise<any> => {
    return await get('/taskConfig/getUserNewbieTask', undefined, config)
  },

  /**
   * 获取成就任务
   */
  getUserAchievementTask: async (config: any): Promise<any> => {
    return await get('/taskConfig/getUserAchievementTask', undefined, config)
  },

  /**
   * 领取每日、每周、成就任务奖品
   */
  openReward: async (data: anyObj): Promise<any> => {
    return await post('/taskConfig/openReward', data)
  },

  /**
   * 领取每日、每周、成就活跃度奖品
   */
  openDynamicReward: async (data: anyObj): Promise<any> => {
    return await post('/taskConfig/openDynamicReward', data)
  },

  /**
   * 领取家长、老师奖品
   */
  openParentOrTeacherReward: async (data: anyObj): Promise<any> => {
    return await post('/taskConfig/openParentOrTeacherReward', data)
  },

  /**
   * 一键领取所有奖品
   */
  openAllReward: async (data: anyObj): Promise<any> => {
    return await post('/taskConfig/openAllReward', data)
  },

  /**
   * 获取首页任务红点提示
   */
  getTaskRewardStatus: async (): Promise<any> => {
    return await get('/taskConfig/getTaskRewardStatus')
  },
}

export default taskApi
