You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.go 20 kB

6 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
6 months ago
6 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. package sch
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/types"
  4. "gitlink.org.cn/cloudream/common/sdks/hpc"
  5. schsdk "gitlink.org.cn/cloudream/common/sdks/scheduler"
  6. cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
  7. "gitlink.org.cn/cloudream/common/utils/serder"
  8. "time"
  9. )
  10. type ResourceType string
  11. const (
  12. ResourceTypeCPU ResourceType = "CPU"
  13. ResourceTypeNPU ResourceType = "NPU"
  14. ResourceTypeGPU ResourceType = "GPU"
  15. ResourceTypeMLU ResourceType = "MLU"
  16. ResourceTypeStorage ResourceType = "STORAGE"
  17. ResourceTypeMemory ResourceType = "MEMORY"
  18. ResourceTypeDCU ResourceType = "DCU"
  19. ResourceTypeGCU ResourceType = "GCU"
  20. Split = "/"
  21. CODE = "code"
  22. DATASET = "dataset"
  23. IMAGE = "image"
  24. MODEL = "model"
  25. RESULT = "result"
  26. PackageTypeNormal = "normal"
  27. PackageTypeNull = "null"
  28. Null = "null"
  29. OrderByName = "name"
  30. OrderBySize = "size"
  31. OrderByTime = "time"
  32. StorageTypeURL = "url"
  33. StorageTypeJCS = "jcs"
  34. RejectedStatus = "rejected"
  35. PendingStatus = "pending"
  36. ApprovedStatus = "approved"
  37. RevokedStatus = "revoked"
  38. CancelStatus = "cancel"
  39. ExpiredStatus = "expired"
  40. ApplyAccess = "apply"
  41. PrivateAccess = "private"
  42. PublicAccess = "public"
  43. PreferencePriority = "preference"
  44. SpecifyClusterPriority = "specify"
  45. FailedStatus = "failed"
  46. SuccessStatus = "success"
  47. SucceededStatus = "succeeded"
  48. UploadingStatus = "uploading"
  49. RunningStatus = "running"
  50. Query = "query"
  51. Delete = "delete"
  52. ChildrenType = "children"
  53. ParentType = "parent"
  54. PlatformSugon = "sugon"
  55. PlatformOpenI = "OpenI"
  56. PlatformModelArts = "ModelArts"
  57. PlatformAI = "AI" // 智算
  58. PlatformCloud = "CLOUD" // 云算
  59. PlatformCloudInference = "PCM_Inference"
  60. PlatformHPC = "HPCSlurm" //超算
  61. PlatformHPCArm = "HPCArm"
  62. PlatformHPCX86 = "HPCX86"
  63. PlatformOctopus = "Octopus"
  64. URL = "url"
  65. ID = "id"
  66. Startup = "startup"
  67. OnlyCreate = "onlyCreate"
  68. Schedule = "schedule"
  69. BlockChainJobCreatePrefix = "job_create_"
  70. Complete = "Complete"
  71. NodeTypeBinding = "binding"
  72. NodeTypeUpload = "upload"
  73. NodeTypeDataReturn = "DataReturn"
  74. NodeTypeHPCCreate = "hpc_create"
  75. NodeTypeInference = "inference"
  76. NodeTypeInferenceStop = "inference_stop"
  77. NodeTypeAICreate = "ai_job_create"
  78. NodeTypeAIJobRun = "ai_job_run"
  79. NodeTypeNotify = "notify"
  80. NodeTypeBroadcastWait = "broadcast_wait"
  81. Inference = "Inference"
  82. Train = "Train"
  83. BroadcastWait = "BroadcastWait"
  84. WaitBroadcast = "WaitBroadcast"
  85. Broadcast = "Broadcast"
  86. Wait = "Wait"
  87. )
  88. type TaskID int64
  89. type DataID int64
  90. type ClusterDetail struct {
  91. // 集群ID
  92. ClusterId schsdk.ClusterID `json:"clusterID"`
  93. // 集群功能类型:云算,智算,超算
  94. ClusterType string `json:"clusterType"`
  95. // 集群地区:华东地区、华南地区、华北地区、华中地区、西南地区、西北地区、东北地区
  96. Region string `json:"region"`
  97. // 资源类型
  98. Resources2 []ResourceData `json:"resources1,omitempty"`
  99. //Resources2 []ResourceData `json:"resources"`
  100. Resources []ClusterResource `json:"resources"`
  101. }
  102. type ClusterResource struct {
  103. Resource TmpResourceData `json:"resource"`
  104. BaseResources []TmpResourceData `json:"baseResources"`
  105. }
  106. type TmpResourceData struct {
  107. Type ResourceType `json:"type"`
  108. Name string `json:"name"`
  109. Total UnitValue[float64] `json:"total"`
  110. Available UnitValue[float64] `json:"available"`
  111. }
  112. type ResourceDetail struct {
  113. ID DataID `json:"id"`
  114. SourceKey string `json:"sourceKey"`
  115. Type ResourceType `json:"type"`
  116. Name string `json:"name"`
  117. TotalCount int64 `json:"totalCount"`
  118. AvailableCount int64 `json:"availableCount"`
  119. ChangeType int64 `json:"changeType"`
  120. Status int64 `json:"status"`
  121. Region string `json:"region"`
  122. ClusterID schsdk.ClusterID `json:"clusterId"`
  123. CostPerUnit float64 `json:"costPerUnit"`
  124. CostType string `json:"costType"`
  125. Tag string `json:"tag"`
  126. UserID cdssdk.UserID `json:"userId"`
  127. CreateTime string `json:"createTime"`
  128. UpdateTime string `json:"updateTime"`
  129. BaseResourceSpecs []ResourceSpec `json:"baseResourceSpecs"`
  130. }
  131. type ResourceSpec struct {
  132. ID DataID `json:"id"`
  133. ResourceSpecId DataID `json:"resourceSpecId"`
  134. Type ResourceType `json:"type"`
  135. Name string `json:"name"`
  136. TotalValue float64 `json:"totalValue"`
  137. TotalUnit string `json:"totalUnit"`
  138. AvailableValue float64 `json:"availableValue"`
  139. AvailableUnit string `json:"availableUnit"`
  140. UserID cdssdk.UserID `json:"userId"`
  141. CreateTime string `json:"createTime"`
  142. UpdateTime string `json:"updateTime"`
  143. }
  144. type ResourceData interface {
  145. Noop()
  146. }
  147. var ResourceDataTypeUnion = types.NewTypeUnion[ResourceData](
  148. (*CPUResourceData)(nil),
  149. (*NPUResourceData)(nil),
  150. (*GPUResourceData)(nil),
  151. (*MLUResourceData)(nil),
  152. (*DCUResourceData)(nil),
  153. (*GCUResourceData)(nil),
  154. (*GPGPUResourceData)(nil),
  155. (*StorageResourceData)(nil),
  156. (*MemoryResourceData)(nil),
  157. (*BalanceResourceData)(nil),
  158. (*RateResourceData)(nil),
  159. )
  160. var _ = serder.UseTypeUnionInternallyTagged(&ResourceDataTypeUnion, "type")
  161. type ResourceDataBase struct{}
  162. func (d *ResourceDataBase) Noop() {}
  163. type UnitValue[T any] struct {
  164. Unit string `json:"unit"`
  165. Value T `json:"value"`
  166. }
  167. type CPUResourceData struct {
  168. serder.Metadata `union:"CPU"`
  169. ResourceDataBase
  170. Type string `json:"type"`
  171. Name ResourceType `json:"name"`
  172. Total UnitValue[int64] `json:"total"`
  173. Available UnitValue[int64] `json:"available"`
  174. }
  175. type NPUResourceData struct {
  176. serder.Metadata `union:"NPU"`
  177. ResourceDataBase
  178. Type string `json:"type"`
  179. Name ResourceType `json:"name"`
  180. Total UnitValue[int64] `json:"total"`
  181. Available UnitValue[int64] `json:"available"`
  182. }
  183. type GPUResourceData struct {
  184. serder.Metadata `union:"GPU"`
  185. ResourceDataBase
  186. Type string `json:"type"`
  187. Name ResourceType `json:"name"`
  188. Total UnitValue[int64] `json:"total"`
  189. Available UnitValue[int64] `json:"available"`
  190. }
  191. type MLUResourceData struct {
  192. serder.Metadata `union:"MLU"`
  193. ResourceDataBase
  194. Type string `json:"type"`
  195. Name ResourceType `json:"name"`
  196. Total UnitValue[int64] `json:"total"`
  197. Available UnitValue[int64] `json:"available"`
  198. }
  199. type DCUResourceData struct {
  200. serder.Metadata `union:"DCU"`
  201. ResourceDataBase
  202. Type string `json:"type"`
  203. Name ResourceType `json:"name"`
  204. Total UnitValue[int64] `json:"total"`
  205. Available UnitValue[int64] `json:"available"`
  206. }
  207. type GCUResourceData struct {
  208. serder.Metadata `union:"GCU"`
  209. ResourceDataBase
  210. Type string `json:"type"`
  211. Name ResourceType `json:"name"`
  212. Total UnitValue[int64] `json:"total"`
  213. Available UnitValue[int64] `json:"available"`
  214. }
  215. type GPGPUResourceData struct {
  216. serder.Metadata `union:"ILUVATAR-GPGPU"`
  217. ResourceDataBase
  218. Type string `json:"type"`
  219. Name ResourceType `json:"name"`
  220. Total UnitValue[int64] `json:"total"`
  221. Available UnitValue[int64] `json:"available"`
  222. }
  223. type StorageResourceData struct {
  224. serder.Metadata `union:"STORAGE"`
  225. ResourceDataBase
  226. Type string `json:"type"`
  227. Name ResourceType `json:"name"`
  228. Total UnitValue[float64] `json:"total"`
  229. Available UnitValue[float64] `json:"available"`
  230. }
  231. type MemoryResourceData struct {
  232. serder.Metadata `union:"MEMORY"`
  233. ResourceDataBase
  234. Type string `json:"type"`
  235. Name ResourceType `json:"name"`
  236. Total UnitValue[float64] `json:"total"`
  237. Available UnitValue[float64] `json:"available"`
  238. }
  239. type BalanceResourceData struct {
  240. serder.Metadata `union:"BALANCE"`
  241. ResourceDataBase
  242. Type string `json:"type"`
  243. Name ResourceType `json:"name"`
  244. Total UnitValue[float64] `json:"total"`
  245. Available UnitValue[float64] `json:"available"`
  246. }
  247. type RateResourceData struct {
  248. serder.Metadata `union:"RATE"`
  249. ResourceDataBase
  250. Type string `json:"type"`
  251. Name ResourceType `json:"name"`
  252. Total UnitValue[float64] `json:"total"`
  253. Available UnitValue[float64] `json:"available"`
  254. }
  255. type ResourceRange struct {
  256. UserID cdssdk.UserID `json:"userID"`
  257. Type ResourceType `json:"type"`
  258. GPU Range `json:"gpu"`
  259. GPUNumber int `json:"gpuNumber"`
  260. CPU Range `json:"cpu"`
  261. Memory Range `json:"memory"`
  262. Storage Range `json:"storage"`
  263. Ids []string `json:"ids"`
  264. }
  265. type JobInfo struct {
  266. TaskID string `json:"taskID"`
  267. JobSubmitInfo JobSubmitInfo `json:"jobSubmitInfo"`
  268. ResultFiles []ResultFile `json:"resultFiles"`
  269. Status string `json:"status"`
  270. ErrorMsg string `json:"errorMsg"`
  271. }
  272. type ResultFile struct {
  273. ClusterID schsdk.ClusterID `json:"clusterID"`
  274. Objects []cdssdk.Object `json:"objects"`
  275. }
  276. type JobSubmitInfo interface {
  277. Noop()
  278. }
  279. type JobSubmitInfoBase struct {
  280. }
  281. var JobSubmitInfoTypeUnion = types.NewTypeUnion[JobSubmitInfo](
  282. (*PCMJobSubmitInfo)(nil),
  283. (*HPCJobSubmitInfo)(nil),
  284. )
  285. var _ = serder.UseTypeUnionInternallyTagged(&JobSubmitInfoTypeUnion, "type")
  286. func (d *JobSubmitInfoBase) Noop() {}
  287. type PCMJobSubmitInfo struct {
  288. serder.Metadata `union:"pcm"`
  289. JobSubmitInfoBase
  290. Type string `json:"type"`
  291. Info CreateAIJobReq `json:"info"`
  292. }
  293. type HPCJobSubmitInfo struct {
  294. serder.Metadata `union:"hpc"`
  295. JobSubmitInfoBase
  296. Type string `json:"type"`
  297. Info hpc.CreateHPCJobReq `json:"info"`
  298. }
  299. type Range struct {
  300. Min float64 `json:"min"`
  301. Max float64 `json:"max"`
  302. }
  303. type ResourcePriority interface {
  304. Noop()
  305. }
  306. type ResourcePriorityBase struct {
  307. }
  308. var ResourcePriorityTypeUnion = types.NewTypeUnion[ResourcePriority](
  309. (*RegionPriority)(nil),
  310. (*ChipPriority)(nil),
  311. (*BiasPriority)(nil),
  312. )
  313. var _ = serder.UseTypeUnionInternallyTagged(&ResourcePriorityTypeUnion, "type")
  314. func (d *ResourcePriorityBase) Noop() {}
  315. type RegionPriority struct {
  316. serder.Metadata `union:"region"`
  317. ResourcePriorityBase
  318. Type string `json:"type"`
  319. Options []string `json:"options"`
  320. }
  321. type ChipPriority struct {
  322. serder.Metadata `union:"chip"`
  323. ResourcePriorityBase
  324. Type string `json:"type"`
  325. Options []string `json:"options"`
  326. }
  327. type BiasPriority struct {
  328. serder.Metadata `union:"bias"`
  329. ResourcePriorityBase
  330. Type string `json:"type"`
  331. Options []string `json:"options"`
  332. }
  333. type TaskMessage struct {
  334. Status string `json:"status"`
  335. Message string `json:"message"`
  336. }
  337. type ReportMessage struct {
  338. TaskName string `json:"taskName"`
  339. TaskID string `json:"taskID"`
  340. Status bool `json:"status"`
  341. Message string `json:"message"`
  342. ClusterID schsdk.ClusterID `json:"clusterID"`
  343. Output string `json:"output"`
  344. }
  345. type UploadParams struct {
  346. DataType string `json:"dataType"`
  347. UploadInfo UploadInfo `json:"uploadInfo"`
  348. }
  349. type UploadInfo interface {
  350. Noop()
  351. }
  352. var UploadInfoTypeUnion = types.NewTypeUnion[UploadInfo](
  353. (*LocalUploadInfo)(nil),
  354. (*RemoteUploadInfo)(nil),
  355. )
  356. var _ = serder.UseTypeUnionInternallyTagged(&UploadInfoTypeUnion, "type")
  357. type LocalUploadInfo struct {
  358. serder.Metadata `union:"local"`
  359. UploadInfoBase
  360. Type string `json:"type"`
  361. LocalPath string `json:"localPath"`
  362. ObjectIDs []cdssdk.ObjectID `json:"objectIDs"`
  363. }
  364. type RemoteUploadInfo struct {
  365. serder.Metadata `union:"url"`
  366. UploadInfoBase
  367. Type string `json:"type"`
  368. Url string `json:"url"`
  369. Branch string `json:"branch"`
  370. DataName string `json:"dataName"`
  371. Cluster schsdk.ClusterID `json:"clusterID"`
  372. }
  373. type UploadInfoBase struct{}
  374. func (d *UploadInfoBase) Noop() {}
  375. type UploadPriority interface {
  376. Noop()
  377. }
  378. var UploadPriorityTypeUnion = types.NewTypeUnion[UploadPriority](
  379. (*Preferences)(nil),
  380. (*SpecifyCluster)(nil),
  381. )
  382. var _ = serder.UseTypeUnionInternallyTagged(&UploadPriorityTypeUnion, "type")
  383. type Preferences struct {
  384. serder.Metadata `union:"preference"`
  385. UploadPriorityBase
  386. Type string `json:"type"`
  387. ResourcePriorities []ResourcePriority `json:"priorities"`
  388. }
  389. type SpecifyCluster struct {
  390. serder.Metadata `union:"specify"`
  391. UploadPriorityBase
  392. Type string `json:"type"`
  393. Clusters []schsdk.ClusterID `json:"clusters"`
  394. }
  395. type UploadPriorityBase struct{}
  396. func (d *UploadPriorityBase) Noop() {}
  397. type QueryData struct {
  398. DataType string `json:"dataType" binding:"required"`
  399. UserID cdssdk.UserID `json:"userID" binding:"required"`
  400. Path string `json:"path"`
  401. PackageID cdssdk.PackageID `json:"packageID" binding:"required"`
  402. CurrentPage int `json:"currentPage"`
  403. PageSize int `json:"pageSize"`
  404. OrderBy string `json:"orderBy" binding:"required"`
  405. PackageName string `json:"packageName"`
  406. }
  407. type DataBinding interface {
  408. Noop()
  409. }
  410. var DataBindingTypeUnion = types.NewTypeUnion[DataBinding](
  411. (*DatasetBinding)(nil),
  412. (*ModelBinding)(nil),
  413. (*CodeBinding)(nil),
  414. (*ImageBinding)(nil),
  415. (*HPCBinding)(nil),
  416. )
  417. var _ = serder.UseTypeUnionInternallyTagged(&DataBindingTypeUnion, "type")
  418. type DataBindingBase struct {
  419. RootPath string `json:"rootPath"`
  420. }
  421. func (d *DataBindingBase) Noop() {}
  422. type DatasetBinding struct {
  423. serder.Metadata `union:"dataset"`
  424. DataBindingBase
  425. Type string `json:"type"`
  426. Name string `json:"name"`
  427. OperateType string `json:"operateType"`
  428. ClusterIDs []schsdk.ClusterID `json:"clusterIDs"`
  429. Description string `json:"description"`
  430. Category string `json:"category"`
  431. PackageID cdssdk.PackageID `json:"packageID"`
  432. RepositoryName string `json:"repositoryName"`
  433. ConsumptionPoints int64 `json:"points"`
  434. }
  435. type ModelBinding struct {
  436. serder.Metadata `union:"model"`
  437. DataBindingBase
  438. Type string `json:"type"`
  439. Name string `json:"name"`
  440. OperateType string `json:"operateType"`
  441. ClusterIDs []schsdk.ClusterID `json:"clusterIDs"`
  442. Description string `json:"description"`
  443. Category string `json:"category"`
  444. ModelType string `json:"modelType"`
  445. Env string `json:"env"`
  446. Version string `json:"version"`
  447. PackageID cdssdk.PackageID `json:"packageID"`
  448. RepositoryName string `json:"repositoryName"`
  449. }
  450. type CodeBinding struct {
  451. serder.Metadata `union:"code"`
  452. DataBindingBase
  453. Type string `json:"type"`
  454. Name string `json:"name"`
  455. OperateType string `json:"operateType"`
  456. ClusterID schsdk.ClusterID `json:"clusterID"`
  457. Description string `json:"description"`
  458. ImageID schsdk.ImageID `json:"imageID"`
  459. BootstrapObjectID cdssdk.ObjectID `json:"bootstrapObjectID"`
  460. FilePath string `json:"filePath"` //当BootstrapObjectID为空时,filePath为必填
  461. PackageID cdssdk.PackageID `json:"packageID"`
  462. Output string `json:"output"`
  463. // 当集群为openi的时候,需要传入分支
  464. Branch string `json:"branch"`
  465. }
  466. type HPCBinding struct {
  467. serder.Metadata `union:"HPCSlurm"`
  468. DataBindingBase
  469. Type string `json:"type"`
  470. Name string `json:"name"`
  471. OperateType string `json:"operateType"`
  472. ClusterIDs []schsdk.ClusterID `json:"clusterIDs"`
  473. Description string `json:"description"`
  474. PackageID cdssdk.PackageID `json:"packageID"`
  475. }
  476. //type ImageBinding struct {
  477. // serder.Metadata `union:"image"`
  478. // DataBindingBase
  479. // Type string `json:"type"`
  480. // Name string `json:"name"`
  481. // ClusterIDs []schsdk.ClusterID `json:"clusterIDs"`
  482. // Description string `json:"description"`
  483. // Architecture string `json:"architecture"`
  484. // ResourceType string `json:"resourceType"`
  485. // Tags []string `json:"tags"`
  486. // PackageID cdssdk.PackageID `json:"packageID"`
  487. //}
  488. type ImageBinding struct {
  489. serder.Metadata `union:"image"`
  490. DataBindingBase
  491. Type string `json:"type"`
  492. ID int64 `json:"id"`
  493. OperateType string `json:"operateType"`
  494. Name string `json:"name"`
  495. IDType string `json:"idType"`
  496. ImageID string `json:"imageID"`
  497. ClusterID schsdk.ClusterID `json:"clusterID"`
  498. }
  499. type Image struct {
  500. ImageID schsdk.ImageID `json:"imageID" gorm:"column:ImageID;primaryKey"`
  501. Name string `json:"name" gorm:"column:Name"`
  502. CreateTime time.Time `json:"createTime" gorm:"column:CreateTime"`
  503. ClusterImage []ClusterImage `gorm:"foreignKey:image_id;references:ImageID" json:"clusterImages"`
  504. }
  505. type ClusterImage struct {
  506. ImageID schsdk.ImageID `gorm:"column:image_id" json:"imageID"`
  507. ClusterID schsdk.ClusterID `gorm:"column:cluster_id" json:"clusterID"`
  508. OriginImageType string `gorm:"column:origin_image_type" json:"originImageType"`
  509. OriginImageID string `gorm:"column:origin_image_id" json:"originImageID"`
  510. OriginImageName string `gorm:"column:origin_image_name" json:"originImageName"`
  511. ClusterImageCard []ClusterImageCard `gorm:"foreignKey:origin_image_id;references:origin_image_id" json:"cards"`
  512. }
  513. func (ClusterImage) TableName() string {
  514. return "cluster_image"
  515. }
  516. type ClusterImageCard struct {
  517. OriginImageID string `gorm:"column:origin_image_id" json:"originImageID"`
  518. Card string `gorm:"column:card" json:"card"`
  519. }
  520. func (ClusterImageCard) TableName() string {
  521. return "cluster_image_card"
  522. }
  523. type QueryBindingFilters struct {
  524. Status string `json:"status"`
  525. Name string `json:"name"`
  526. }
  527. type QueryBindingDataParam interface {
  528. Noop()
  529. }
  530. var QueryBindingDataParamTypeUnion = types.NewTypeUnion[QueryBindingDataParam](
  531. (*PrivateLevel)(nil),
  532. (*ApplyLevel)(nil),
  533. (*PublicLevel)(nil),
  534. )
  535. var _ = serder.UseTypeUnionInternallyTagged(&QueryBindingDataParamTypeUnion, "type")
  536. type QueryBindingDataParamBase struct{}
  537. func (d *QueryBindingDataParamBase) Noop() {}
  538. type PrivateLevel struct {
  539. serder.Metadata `union:"private"`
  540. QueryBindingDataParamBase
  541. Type string `json:"type" binding:"required"`
  542. UserID cdssdk.UserID `json:"userID" binding:"required"`
  543. BindingID int64 `json:"bindingID" binding:"required"`
  544. Info DataBinding `json:"info"` // 可选,用于精细筛选,功能暂未实现
  545. }
  546. type ApplyLevel struct {
  547. serder.Metadata `union:"apply"`
  548. QueryBindingDataParamBase
  549. Type string `json:"type" binding:"required"`
  550. UserID cdssdk.UserID `json:"userID" binding:"required"`
  551. Info DataBinding `json:"info"` // 可选,用于精细筛选,功能暂未实现
  552. }
  553. type PublicLevel struct {
  554. serder.Metadata `union:"public"`
  555. QueryBindingDataParamBase
  556. UserID cdssdk.UserID `json:"userID" binding:"required"`
  557. Type string `json:"type" binding:"required"`
  558. Info DataBinding `json:"info"` // 可选,用于精细筛选,功能暂未实现
  559. }