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