import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {ObjectData} from '../../utils/objectData.service';
import {environment} from '../../../environments/environment';

@Injectable({
  providedIn: 'root'
})
export class DictionaryService {

  constructor(private http: HttpClient) {}

  /**
   *
   * 查询数据字典
   * @param codeType 【非必填】 码值类型
   * @param callback
   */
  public getDictionary(codeType: string , callback: any): any {
    this.http.get(environment.baseUrl + '/common/queryDictionary?codeType=' + codeType).subscribe( data => {
      callback(data);
    });
  }

}
