const system = require("../../../system");
const ServiceBase = require("../../svems.base")

class SsmUserService extends ServiceBase {
  constructor() {
    super();
  }

  /**
   * fn:ssmUser登录
   * @param params
   * @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}|{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
   */
  async ssmUserlogin(params) {
    try {
      return await this.callms("uc", "ssmUserlogin", params);
    } catch (error) {
      return system.getResult(null, `系统错误 错误信息 ${error}`);
    }
  }

  /**
   * fn:添加ssmUser 用户
   * @param params
   * @returns {Promise<void>}
   */
  async addSsm(params, pobj2, req){
    try {
      return await this.callms("uc", "addSsm", params);
    } catch (error) {
      return system.getResult(null, `系统错误 错误信息 ${error}`);
    }
  }

  /**
   * fn:更新ssmUser 用户
   * @param params
   * @returns {Promise<void>}
   */
  async updSsm(params){
    try {
      return await this.callms("uc", "updSsm", params);
    } catch (error) {
      return system.getResult(null, `系统错误 错误信息 ${error}`);
    }
  }

  /**
   * fn：查询用户信息
   * @param params
   * @returns {Promise<void>}
   */
  async querySsmUser(params) {
    try {
      return await this.callms("uc", "querySsmUser", params);
    } catch (error) {
      return system.getResult(null, `系统错误 错误信息 ${error}`);
    }
  }

  /**
   * fn:ssmuser用户列表
   * @param params
   * @returns {Promise<void>}
   */
  async querySsmUsers(params) {
    try {
      return await this.callms("uc", "querySsmUsers", params);
    } catch (error) {
      return system.getResult(null, `系统错误 错误信息 ${error}`);
    }
  }

}

module.exports = SsmUserService;