base.go 24 KB

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