/*
 * @Author: XianKaiQun
 * @Date: 2020-07-06 22:55:37
 * @LastEditors  : WuWei
 * @LastEditTime : 2022-01-18 17:41:46
 * @Description: 
 */
import 'package:app_package/app_package.dart';

class AppParseUtil {
  ///图片id转url
  static String image(String fileId) {
    return '${APPConfig.baseURL}/file/images/$fileId';
  }

  ///毫秒转文字描述
  ///eg： 10小时49分49秒
  static String ms2str(int ms) {
    int? s = (ms / 1000).floor();
    int m = (s / 60).floor();
    int h = (m / 60).floor();
    String back = '${s - m * 60}秒';
    if (m > 0) {
      back = ' ${m - h * 60}分$back';
      if (h > 0) {
        back = ' $h小时$back';
      }
    }
    return back;
  }
}
