messageService.js 873 Bytes
import BaseService from '../../libs/services/baseService.js';

const UFO_MESSAGE_TYPE = 'ufo.users.listInboxTypeInfo';
const UFO_MESSAGE_LIST = 'ufo.users.listInboxs';

export default class MessageService extends BaseService {
  async fetchMessageTypeInfo(params, complete) {
    return await this.GET(
      {
        ...params,
        method: UFO_MESSAGE_TYPE
      },
      {
        complete
      }
    ).then((data) => {
      return data;
    }).catch((error) => {
      // 这里请抛出异常,不要return
      throw error;
    })
  }

  async fetchNewMessageList(params, complete) {
    return await this.GET(
      {
        ...params,
        method: UFO_MESSAGE_LIST
      },
      {
        complete
      }
    ).then((data) => {
      return data;
    }).catch((error) => {
      // 这里请抛出异常,不要return
      throw error;
    })
  }
}