base.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. // Controller基础类,所有Controller会继承此类
  2. package controllers
  3. import (
  4. "encoding/base64"
  5. "errors"
  6. "fmt"
  7. "reflect"
  8. "strconv"
  9. "strings"
  10. "github.com/astaxie/beego"
  11. "dashoo.cn/business2/userRole"
  12. // "dashoo.cn/backend/api/business/material"
  13. "dashoo.cn/backend/api/models"
  14. "dashoo.cn/utils"
  15. "dashoo.cn/utils/redis"
  16. )
  17. // Operations about tokens
  18. type BaseController struct {
  19. beego.Controller
  20. User *models.UserInfo
  21. }
  22. type ErrorInfo struct {
  23. Code int64 `json:"code"`
  24. Message string `json:"message,omitempty"`
  25. }
  26. type ErrorDataInfo struct {
  27. Code int64 `json:"code"`
  28. Message string `json:"message,omitempty"`
  29. Item interface{} `json:"item,omitempty"` //数据
  30. }
  31. type DataEntryInfo struct {
  32. Code int64 `json:"code"`
  33. Message string `json:"message,omitempty"`
  34. Item interface{} `json:"item,omitempty"` //数据
  35. Info int `json:"info"`
  36. CurrentItemCount int64 `json:"currentItemCount,omitempty"` //结果集中的条目数目
  37. ItemsPerPage int64 `json:"itemsPerPage,omitempty"` //每页记录数目
  38. StartIndex int64 `json:"startIndex,omitempty"` //items中第一个条目的索引
  39. TotalItemsx int64 `json:"totalItemsx,omitempty"` //当前集合中可用的总条目数
  40. PageIndex int64 `json:"pageIndex,omitempty"` //条目的当前页索引
  41. TotalPages int64 `json:"totalPages,omitempty"` //当前结果集中的总页数
  42. }
  43. type Request struct {
  44. Status int `json:"status"`
  45. Id string `json:"id"`
  46. Message string `json:"message"`
  47. }
  48. type PageInfo struct {
  49. CurrentPage int64 `form:"_currentPage"`
  50. Size int64 `form:"_size"`
  51. }
  52. type Status struct {
  53. Status int `json:"status"`
  54. Id string `json:"id"`
  55. Message string `json:"message"`
  56. }
  57. type ValidformStruct struct {
  58. Info string `json:"info"`
  59. Status string `json:"status"`
  60. Items interface{} `json:"items,omitempty"` //数据列表
  61. }
  62. var (
  63. Nsqdtcpaddr string
  64. Nsqtopic string
  65. SalesAdmin string = "SalesAdmin" //分销商管理员
  66. ProjectSourse string = "coldchain"
  67. DonorstbName string = "DonorsInfo"
  68. DonorslogtbName string = "DonorsLog"
  69. DonorsNoteItemName string = "DonorsNoteItem"
  70. IsUpdating string = "false"
  71. EquipmentModelName string = "EquipMentModel" //设备型号管理表
  72. SamplesLogtbName string = "SamplesLog"
  73. SamplesMaintbName string = "SamplesMain"
  74. SamplesDetailtbName string = "SamplesDetail"
  75. SamplesBusstbName string = "SamplesBusiness"
  76. SamplesDetailFiletbName string = "SamplesFileDetail" // 归档表
  77. SamplesAttachmenttbName string = "SamplesAttachment" // 附件表
  78. SampleSearchTemplateName string = "SampleSearchTemplate" // 样本搜索模版表
  79. SampleTestMainName string = "SampleTestMain" //样本检测信息主表
  80. SampleTestDetailName string = "SampleTestDetail" //样本检测子表
  81. SamplesBookName string = "SamplesBook" //样本列表
  82. SamplesBookDetailName string = "SamplesBookDetail" //样本列表详情
  83. SampleTypeName string = "SampleType" //样本类型
  84. STypeNoteItemName string = "STypeNoteItem" //样本特有扩展
  85. ManagementPreparationName string = "ManagementPreparation" //制备管理
  86. PreparationStepDataName string = "PreparationStepData" //制备步骤
  87. PreparationStepDetailDataName string = "PreparationStepDetailData" //制备操作详情
  88. ManagementControlName string = "ManagementPreparation" //质控管理
  89. ControlStepDataName string = "PreparationStepData" //质控步骤
  90. ControlStepDetailDataName string = "PreparationStepDetailData" //质控操作详情
  91. BaseOperationLogName string = "Base_OperationLog" //操作日志表
  92. MaterialInfoName string = "MaterialInfo" //库存信息表
  93. MaterialBatchKCName string = "MaterialBatchKC" //物料批次库存信息表
  94. MaterialStoreHouseName string = "MaterialStoreHouse" //仓库列表
  95. MaterialCKDetailName string = "MaterialCKDetail" //出库管理子表
  96. MaterialCKHeadName string = "MaterialCKHead" //出库管理主表
  97. MaterialPDDetailName string = "MaterialPDDetail" //盘点子表
  98. MaterialPDHeadName string = "MaterialPDHead" //盘点管理主表
  99. MicrobialName string = "Microbial" //动物微生物表
  100. CellBloodName string = "CellBlood" //采血表
  101. TestTemplateName string = "TestTemplate" //检测模板
  102. PreparationTemplateName string = "PreparationTemplate"
  103. PreparationTemplateStepName string = "PreparationTemplateStep"
  104. PreparationTemplateStepDetailName string = "PreparationTemplateStepDetail"
  105. CellSaveName string = "CellSave" //细胞存储表
  106. Coustom_InformationName string = "Coustom_Information" //客户信息表
  107. Order_InformationName string = "Order_Information" //订单信息表
  108. GeneProductName string = "GeneProduct" //基因治疗表
  109. CellProductName string = "CellProduct" //细胞制备表
  110. MaterialRKDetailName string = "MaterialRKDetail" //库存表
  111. MaterialRKHeadName string = "MaterialRKHead" //入库主表
  112. TestSampleName string = "TestSample" //检验样本
  113. TestSampleDetailName string = "TestSampleDetail" //检验样本详情表
  114. TestSampleInfoName string = "TestSampleInfo" //检验样本信息
  115. TestSampleRelationName string = "TestSampleRelation" //样本套餐-采样关系表
  116. TestTransferOrdersName string = "TestTransferOrders" //检验交接单
  117. TestInfoName string = "TestInfo" //检验单
  118. TestInfoDetailName string = "TestInfoDetail" //检验结果
  119. TestItemsListName string = "TestItemsList" // 检验项目内容
  120. TestListName string = "TestList" //检验项目主表
  121. TestListDetailName string = "TestListDetail" //检验项目详情表
  122. TestLaboratoryName string = "TestLaboratory" //检验实验室
  123. TestQualityControlName string = "TestQualityControl" //质控数据
  124. TestControlParametersName string = "TestControlParameters" //质控品参数
  125. TestControlParametersDetailName string = "TestControlParametersDetail" //质控品详情
  126. AccusationParametersName string = "AccusationParameters"
  127. TestApplicationName string = "TestApplication" //检验申请单
  128. TestPackageCategoryName string = "TestPackageCategory" // 类别
  129. TestPrintTemplateName string = "TestPrintTemplate" //打印模板
  130. TestPackageName string = "TestPackage" //检验套餐
  131. TestPackageItemsName string = "TestPackageItems" //检验套餐项目明细
  132. InstrumentName string = "Instrument"
  133. Base_ItemTreeDetailsName string = "Base_ItemTreeDetails" //数据字典 文档结构
  134. Base_ItemDetailsName string = "Base_ItemDetails" //数据字典
  135. InstrumenMaintainLogName string = "InstrumenMaintainLog" //质量管理
  136. InstrumenstateName string = "Instrumenstate" //设备自动发送信息
  137. InstrumenRunRecordName string = "InstrumenRunRecord" //设备运行信息
  138. CustomerName string = "Customer" //客户原始信息内容
  139. CellsContractName string = "CellsContract" //合同管理
  140. CellsContractDetailName string = "CellsContractDetail" //合同详情
  141. CellsCollectionName string = "CellsCollection" //样本采集
  142. CellsCollectionDetailName string = "CellsCollectionDetail" //样本采集子表
  143. CellsCollectionSensorsName string = "CellsCollectionSensors" //采集单Sensor表
  144. CellsPrepareTemplateName string = "CellsPrepareTemplate" //Cells制备模板主表
  145. CellsPrepareTemplateStepName string = "CellsPrepareTemplateStep" //Cells制备模板步骤表
  146. CellsPrepareTemplateStepDetailName string = "CellsPrepareTemplateStepDetail" //Cells制备模板步骤详情表
  147. CellsPreparationName string = "CellsPreparation" //Cells制备表
  148. CellsPreparationInfoName string = "CellsPreparationInfo"
  149. CellsPreparationInfoDetailName string = "CellsPreparationInfoDetail"
  150. CellsPreparationSamplesName string = "CellsPreparationSamples" //Cells制备样本信息表
  151. CellsPreparationInfoDetailAttachmentName string = "CellsPreparationInfoDetailAttachment" //Cells制备附件表
  152. DonorsInfoAttachmentName string = "DonorsInfoAttachment" //样本采集附件
  153. InstrumenMaintainLogAttachmentName string = "InstrumenMaintainLogAttachment" //质量管理附件
  154. CellsContractAttachmentName string = "CellsContractAttachment" //合同管理附件
  155. CellsProductDeliveryName string = "CellsProductDelivery" //产品交付
  156. CellsProductDeliverySampleName string = "CellsProductDeliverySample" //交付详情
  157. CellsProductDeliveryAttachmentName string = "CellsProductDeliveryAttachment" //产品交付附件
  158. CellsPreparationTraceName string = "CellsPreparationTrace" //制备信息溯源表
  159. ControlTemplateName string = "ControlTemplate" //Cells质控备模板主表
  160. ControlTemplateStepName string = "ControlTemplateStep" //Cells质控模板步骤表
  161. ControlTemplateStepDetailName string = "ControlTemplateStepDetail" //Cells质控模板步骤详情表
  162. ControlName string = "Control" //Cells质控表
  163. ControlInfoName string = "ControlInfo"
  164. ControlInfoDetailName string = "ControlInfoDetail"
  165. ControlInfoDetailAttachmentName string = "ControlInfoDetailAttachment"
  166. ControlTraceName string = "ControlTrace" //制备信息溯源表
  167. DocumentInfoName string = "DocumentInfo" //文档
  168. DocumentHistoryName string = "DocumentHistory" //历史文档
  169. SamplesCustomorName string = "SamplesCustomor" //样本库客户信息表
  170. SamplesCommunicationName string = "SamplesCommunication" //样本库客户交流记录表
  171. SamplesProtocolName string = "SamplesProtocol" //样本库协议表
  172. SamplesProtocolDetailName string = "SamplesProtocolDetail" //样本库协议执行信息表
  173. DonorsDetailName string = "DonorsDetail" //样本库样本来源详情表
  174. ShelfName string = "Shelf" //设备冻存架表
  175. BoxName string = "Box" //设备冻存盒表
  176. GroupDetailName string = "GroupDetail" //样本库分组表
  177. SamplesApplyName string = "SamplesApply" //出入库申请表
  178. SamplesApplyDetailName string = "SamplesApplyDetail" //出入库申请详情表
  179. SamplesRecordName string = "SamplesRecord" //样本操作记录表
  180. LimsEntrustMainName string = "LimsEntrustMain" //LIMS委托管理
  181. TestPackageTypesName string = "TestPackageTypes" // LIMS检验类型
  182. LimsSampleTypeName string = "LimsSampleType" // LIMS样品类型
  183. LimsDocTemplateName string = "LimsDocTemplate" // lims模板
  184. LimsDocTemplateDetailName string = "LimsDocTemplateDetail" // lims模板详情
  185. LimsTaskBalanceName string = "LimsTaskBalance" // 任务分配表
  186. LimsDeliverName string = "LimsDeliver" //样品交接表
  187. LimsDeliverDetailName string = "LimsDeliverDetail" //样品交接详情表
  188. LimsPreparationName string = "LimsPreparation" //样品制备表
  189. LimsCreateReportName string = "LimsCreateReport" //报告生成
  190. LimsDateEntryName string = "LimsDateEntry" //数据录入
  191. LimsDocHistoryName string = "LimsDocHistory" //数据录入文档历史
  192. LimsEntrustSampleName string = "LimsEntrustSample" //委托样品明细表
  193. LimsEntrustSampleTypeName string = "LimsEntrustSampleType" //详情表
  194. LimsReportHuxfName string = "LimsReportHuxf" //呼吸阀检测数据记录表
  195. LimsReportYeyaqfName string = "LimsReportYeyaqf" //液压安全阀检测数据记录表
  196. LimsReportZuhqName string = "LimsReportZuhq" //阻火器检测数据记录表
  197. LimsReportElecGroundName string = "LimsReportElecGround" //电气接地装置检测原始记录
  198. LimsReportLeakProtectName string = "LimsReportLeakProtect" //漏电保护器检测数据记录表
  199. LimsReportEquipotentName string = "LimsReportEquipotent" //防雷装置(等电位)检测原始记录
  200. LimsReportLightProtectName string = "LimsReportLightProtect" //防雷装置检测原始记录
  201. LimsReportAmmeterName string = "LimsReportAmmeter" //电流表检测原始记录
  202. LimsReportKqpmName string = "LimsReportAirFoamGenerator" //空气泡沫产生器检测数据记录表
  203. LimsReportNoBeamPumpingUnitName string = "LimsReportNoBeamPumpingUnit" //无游梁式抽油机检测数据记录表
  204. LimsReportBeamPumpingUnitName string = "LimsReportBeamPumpingUnits" //游梁式抽油机检测数据记录表
  205. LimsDrillingDailyName string = "LimsDrillingDaily" //工程监督中心钻井工程监督日报
  206. LimsOilTestingDailyName string = "LimsOilTestingDaily" //试油监督日报表
  207. LimsReportSignName string = "LimsReportSign" //报告签发
  208. LimsReportHistoryName string = "LimsReportHistory" //报告历史
  209. LimsCustomerpositionName string = "LimsCustomerPosition"
  210. LimsPressureLeakName string = "LimsPressureLeak" //阻火器压力损失表
  211. LimsSpecifyStandardName string = "LimsSpecifyStandard" //Lims规格型号标准
  212. BaseUserName string = "Base_User" //用户表
  213. UserQualificationName string = "UserQualification" //用户资质表
  214. LimsInstrumentGroup string = "LimsInstrumentGroup" // 检测仪器关联
  215. OilAuditSettingName string = "Base_OilAuditSetting" // 单位审批步骤自定义配置
  216. OilBasisBuildName string = "OilBasisBuild" // 基建类资质对照表
  217. OilGoodsAptitudeName string = "OilGoodsAptitude" // 物资类项目与资质对照表
  218. OilTableFiledSettingName string = "OilTableFiledSetting" // 资质项目与字段对照表
  219. OilTechnologyServiceName string = "OilTechnologyService" // 技术服务类资质对照表
  220. OilSupplierName string = "OilSupplier" // 供方基本信息表
  221. OilSupplierCertName string = "OilSupplierCert" // 供方准入证书信息表
  222. OilSupplierCertSubName string = "OilSupplierCertSub" // 供方对应准入子分类表
  223. OilSupplierCertAppendName string = "OilSupplierCertAppend" // 供方增项信息表
  224. OilSupplierCertAppendSubName string = "OilSupplierCertAppendSub" // 供方增项信息分类表
  225. OilSupplierFileName string = "OilSupplierFile" // 供方准入文件表
  226. OilGoodsAptitudeClassName string = "OilGoodsAptitudeClass" // 物资类资质分类层级表
  227. OilTechnologyServiceClassName string = "OilTechnologyServiceClass" // 技术服务类资质分类层级表
  228. OilEnterpriseMajorEquipmentName string = "OilEnterpriseMajorEquipment" //企业主要装备情况
  229. OilThreeYearsPerformanceName string = "OilThreeYearsPerformance" //近三年主要工程业绩
  230. OilPatentStatisticalName string = "OilPatentStatistical" //拥有专利、专有技术及工法
  231. OilWinningProjectName string = "OilWinningProject" //近三年获得省部级及以上主要技术、管理成果、获奖项目
  232. OilTechsrvDetailViewName string = "oil_techsrv_detail_view" //技术服务类视图
  233. OilGoodsAptDetailViewName string = "oil_goodsapt_detail_view" //物資类视图
  234. OilClassOrgSettingName string = "OilClassOrgSetting" //分类部门审批配置表
  235. OilAnnualAuditName string = "OilAnnualAudit" //年审表
  236. OilSupplierOpinionName string = "OilSupplierOpinion" //追加意见表
  237. OilInfoChangeItemName string = "OilInfoChangeItem" //信息变更表
  238. OilInfoChangeName string = "OilInfoChange" //信息变更表
  239. )
  240. //分页信息及数据
  241. type DataInfo struct {
  242. CurrentItemCount int64 `json:"currentItemCount,omitempty"` //结果集中的条目数目
  243. ItemsPerPage int64 `json:"itemsPerPage,omitempty"` //每页记录数目
  244. StartIndex int64 `json:"startIndex,omitempty"` //items中第一个条目的索引
  245. TotalItemsx int64 `json:"totalItemsx,omitempty"` //当前集合中可用的总条目数
  246. PageIndex int64 `json:"pageIndex,omitempty"` //条目的当前页索引
  247. TotalPages int64 `json:"totalPages,omitempty"` //当前结果集中的总页数
  248. Items interface{} `json:"items,omitempty"` //数据列表
  249. }
  250. //下拉idname
  251. type SelectIdNameModel struct {
  252. Id int `json:"id"`
  253. Name string `json:"name"`
  254. }
  255. func (this *BaseController) Prepare() {
  256. find := false
  257. // 不需要做登录验证的页面
  258. urls := []string{"/api/auth", "/api/users/registemanage", "/printservice",
  259. "/api/webinterface/preparelist", "/api/webinterface/prepareinfo",
  260. "/api/sampletest_v/sampletest", "/api/sampletest_v/getpass", "/api/sampletest_v/editpass/",
  261. "/api/sampletest_v/donorsdetail", "/api/sampletest_v/testdetail", "/api/uploads/samplesinput", "/api/doctemplate_onlyoffice/callback", "/api/doctemplate_onlyoffice/viewcallback", "/api/limsupload/usersignimg",
  262. "/api/uploads/samplestypeimg", "/api/workflow/historyimg/", "/api/document/getdocumentnameandtime", "/api/annualaudit/auditcallback", "/api/suppliercert/auditcallback"}
  263. for _, v := range urls {
  264. fmt.Println("**this.Ctx.Input.URL()**", this.Ctx.Input.URL())
  265. if this.Ctx.Input.URL() == v {
  266. find = true
  267. break
  268. }
  269. if strings.Contains(this.Ctx.Input.URL(), "/api/sampletest_v/editpass/") {
  270. find = true
  271. fmt.Println("/api/sampletest_v/editpass/")
  272. break
  273. }
  274. if strings.Contains(this.Ctx.Input.URL(), "/api/workflow/historyimg/") {
  275. find = true
  276. fmt.Println("/api/workflow/historyimg/")
  277. break
  278. }
  279. }
  280. if !find { // 如果是登录操作不做验证
  281. var err error
  282. this.User, err = this.ParseToken()
  283. if err != nil { // token非法或已失效
  284. fmt.Println(err)
  285. this.Abort("401")
  286. }
  287. if this.User == nil {
  288. this.User = &models.UserInfo{}
  289. }
  290. svc := userRole.GetUserService(utils.DBE)
  291. usermodel := svc.GetUserInfoSelf(this.User.Username)
  292. this.User.Id = utils.ToStr(usermodel.Id)
  293. this.User.Realname = usermodel.Realname
  294. this.User.AccCode = usermodel.AccCode
  295. this.User.Description = usermodel.Description
  296. this.User.DepartmentId = usermodel.Departmentid
  297. this.User.IsCompanyUser = usermodel.IsCompanyUser
  298. this.User.Superior = usermodel.Superior
  299. this.User.Roles = utils.ToStr(usermodel.Roleid)
  300. beego.Debug("User:", this.User)
  301. }
  302. if this.User == nil {
  303. fmt.Println("user is null")
  304. this.User = &models.UserInfo{}
  305. }
  306. }
  307. // ParseToken parse JWT token in http header.
  308. func (this *BaseController) ParseToken() (*models.UserInfo, error) {
  309. authString := this.Ctx.Input.Header("Authorization")
  310. beego.Debug("AuthString:", authString)
  311. kv := strings.Split(authString, " ")
  312. if len(kv) != 2 || kv[0] != "Bearer" {
  313. beego.Error("AuthString invalid:", authString)
  314. return nil, errors.New("AuthString invalid")
  315. }
  316. tokenString := kv[1]
  317. pUserinfo, err := models.CheckToken(tokenString)
  318. return pUserinfo, err
  319. }
  320. //获取waterdrop帐号密码
  321. func (this *BaseController) GetuAndp() (string, string) {
  322. return "seedplatform", "seed@platformDASHOO.cn"
  323. //return "coldcloud", "CC@p1a2w3d4word"
  324. }
  325. //获取accode
  326. func (this *BaseController) GetAccode() string {
  327. return this.User.AccCode
  328. }
  329. //获取仓库Id
  330. //func (this *BaseController) GetHouseIdByLoginuser() int {
  331. // svc := material.GetMaterialService(utils.DBE)
  332. // return svc.GetHouseIdByDepartmentId(this.User.AccCode+MaterialStoreHouseName, this.User.DepartmentId)
  333. //}
  334. func (this *BaseController) GetupdbAndHost() (string, string, string, string) {
  335. return "coldcloud", "cc@1qaz2wsx", "coldcloud", "121.42.244.202:9086"
  336. }
  337. func (this *BaseController) GetPageInfoForm() (page PageInfo) {
  338. page.CurrentPage, _ = this.GetInt64("_currentPage")
  339. page.Size, _ = this.GetInt64("_size")
  340. return
  341. }
  342. //初始化redis
  343. func InitRedis() {
  344. poolnum := 5
  345. addr := utils.Cfg.MustValue("redis", "addr")
  346. redis.InitRedis(poolnum, addr)
  347. }
  348. //打印相关
  349. type PrintColType struct {
  350. JsonType string
  351. FieldIndex int
  352. FieldType string
  353. FieldSize int
  354. FieldName string
  355. Required bool
  356. }
  357. type PrintData struct {
  358. Data interface{}
  359. Cols []PrintColType
  360. }
  361. type PrintInfo struct {
  362. Alldata []PrintData `json:"alldata"`
  363. Vars []string `json:"vars"`
  364. }
  365. func AutoColType(source interface{}) (cols []PrintColType) {
  366. sObjT := reflect.TypeOf(source).Elem()
  367. for i := 0; i < sObjT.NumField(); i++ {
  368. fieldT := sObjT.Field(i)
  369. var fieldName, jsontype, datatype string = fieldT.Name, fieldT.Type.Kind().String(), "string"
  370. var fildsize = 2000
  371. switch fieldT.Type.Kind() {
  372. case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
  373. fildsize = 0
  374. datatype = "integer"
  375. case reflect.Float32, reflect.Float64:
  376. datatype = "float"
  377. fildsize = 0
  378. }
  379. cols = append(cols, PrintColType{jsontype, i, datatype, fildsize, fieldName, false})
  380. }
  381. return
  382. }
  383. //base64 解密
  384. const (
  385. base64Table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  386. )
  387. var coder = base64.NewEncoding(base64Table)
  388. func Base64Decode(src string) string {
  389. co, _ := coder.DecodeString(src)
  390. return string(co)
  391. }
  392. func FloatPoint(value float64, bit int) float64 {
  393. value_str := strconv.FormatFloat(value, 'f', bit, 64)
  394. value_f64, _ := strconv.ParseFloat(value_str, 64)
  395. return value_f64
  396. }
  397. //===========ln
  398. type DetailsInfo struct {
  399. Code int64 `json:"code"`
  400. Message string `json:"message,omitempty"`
  401. Item interface{} `json:"item,omitempty"` //数据
  402. Types interface{} `json:"types,omitempty"` //检测类型
  403. }