import { Injectable } from '@angular/core'; import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from './commons.service'; import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root' }) export class MsgService { constructor( private http: HttpClient, private common: CommonsService ) { } /** * 查询站内信消息 * * @param paramsObject 对象 * @param callBack 回调 */ public getMsgByList(paramsObject: object, callBack) { this.http.get(environment.baseUrl + 'bsMsg/getMsgByList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { callBack(data); }); } /** * 新增站内信内容内容 * * @param params 上传对象 * @param callBack 回调 * @return data 返回结果 */ public insertMsg(params: object, callBack) { this.http.post(environment.baseUrl + 'bsMsg/insertMsg', params).subscribe(data => { callBack(data); }); } /** * 发布站内信 * * @param iId id * @param callBack 回调 */ public pushMsg(id: number, callBack) { this.http.get(environment.baseUrl + 'bsMsg/pushMsg?id=' + id).subscribe(data => { callBack(data); }); } }