import { Member, User } from 'nsn-entity';

export interface CommonDownloadTemplateParams {
  folder?: string;
  template_name: string;
  file_name?: string;
}

export interface CommonImageViewParams {
  fileUploadId: string;
}

export interface CommonPinyinFirstLettersParams {
  chinese: string
}

export type CommonCaptchaParams = Partial<Pick<User, 'account'> & Pick<Member, 'mobile' | 'email'>>

/** 公用服务 */
export interface CommonService {
  /** 模板文件下载 */
  download_template: (params: CommonDownloadTemplateParams) => Promise<any>;

  /** 图片预览 */
  image_view: (params: CommonImageViewParams) => Promise<any>;

  /** 查询汉字拼音首字母 */
  pinyin_first_letters: (params: CommonPinyinFirstLettersParams) => Promise<any>;

  /** 获取验证码 */
  captcha: (params: CommonCaptchaParams) => Promise<any>;
}
