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