import Request from '../request';

let request = Request.http;



export default {
    /**
  * 获取所有群组
  * @param {*} param 
  * @returns 
  */
    getAllGroups(param) {
        return request({
            url: '/im/app/v1/im/getAllGroups',
            method: 'post',
            data: param,
        })
    },
    /**
     * 入群下单
     * @param {*} param 
     * @returns 
     */
    addImGroupOrder(param) {
        return request({
            url: '/order/app/v1/imorder/addImGroupOrder',
            method: 'post',
            data: param,
            header: {
                'Content-Type': 'application/json'
            }
        })
    },
    /**
     * 根据群组groupId查询群组信息--是否已加入该群组
     * @param {*} param 
     * @returns 
     */
    getGroupByGroupId(param) {
        return request({
            url: '/im/app/v1/im/getResourceAggregationGroupByGroupId',
            method: 'get',
            data: param,
        })
    },
    /**
 * 加入指定的群组
 * @param {*} param 
 * @returns 
 */
    addRagUser(param) {
        return request({
            url: '/im/app/v1/im/addRagUser',
            method: 'post',
            data: param,
            // header: {
            //     'Content-type': "application/x-www-form-urlencoded",
            // }
        })
    },

    /**
     * 根据手机号获取用户
     * @param {*} param 
     * @returns 
     */
    getUserInfoByPhone(param) {
        return request({
            url: '/user/app/v1/user/getUserInfoByPhone/' + param,
            method: 'post',
        })
    },

    /**
     * 获取用户信息
     * @param {*} param 
     * @returns 
     */
    getUserInfo(param) {
        return request({
            url: '/user/app/v1/user/getUserInfo/' + param,
            method: 'post',
        })
    },

    /**
       * 获取店铺信息
       * @param {*} param 
       * @returns 
       */
    getByOwnerId(param) {
        return request({
            url: '/user/app/v1/store/getByOwnerId/' + param,
            method: 'post',
        })
    },

    /**
     * 订单详情
     * @param {*} param 
     * @returns 
     */
    orderDetail(param) {
        return request({
            url: '/order/app/v1/seller/order/detail-v2/' + param,
            method: 'get',
        })
    },

    /**
  * 通知列表
  * @param {*} param 
  * @returns 
  */
    noticeList(param) {
        return request({
            url: '/user/app/v1/notice/list',
            method: 'get',
            data: param
        })
    },


    nuRead(param) {
        return request({
            url: '/user/app/v1/notice/nuRead/' + param,
            method: 'get',
        })
    },


    readAll(param) {
        return request({
            url: '/user/app/v1/notice/readAll',
            method: 'put',
            data: param
        })
    },
}


