type.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @author chengliang
  3. * @date 2026/1/12 21:16
  4. * @brief
  5. *
  6. **/
  7. package service
  8. import "dsbqj-admin/model/mongo/hotupdate"
  9. type TGetVersionReq struct {
  10. Proj string `form:"proj" binding:"required" json:"proj"`
  11. Os string `form:"os" binding:"required" json:"os"`
  12. }
  13. type TGetMaxVersionReq struct {
  14. Os string `form:"os" binding:"required" json:"os"`
  15. }
  16. type TGetVersionRsp struct {
  17. ID string `json:"id"`
  18. Proj string `json:"proj"`
  19. Os string `json:"os"`
  20. CreateTimeSec int64 `json:"createTime"`
  21. UpdateTimeSec int64 `json:"updateTime"`
  22. Version string `json:"version"`
  23. PackageUrl string `json:"packageUrl"`
  24. RemoteManifestUrl string `json:"remoteManifestUrl"`
  25. RemoteVersionUrl string `json:"remoteVersionUrl"`
  26. Status int16 `json:"status"`
  27. }
  28. func (this *TGetVersionRsp) FromMVersion(mVersion *hotupdate.MVersionInfo) {
  29. this.ID = mVersion.ID.Hex()
  30. this.CreateTimeSec = mVersion.CreatedAt.Unix()
  31. this.UpdateTimeSec = mVersion.UpdatedAt.Unix()
  32. this.Version = mVersion.Version
  33. this.PackageUrl = mVersion.PackageUrl
  34. this.RemoteVersionUrl = mVersion.RemoteVersionUrl
  35. this.RemoteManifestUrl = mVersion.RemoteManifestUrl
  36. this.Status = mVersion.Status
  37. this.Proj = mVersion.Proj
  38. this.Os = mVersion.Os
  39. }
  40. type TAddVersionReq struct {
  41. Proj string `form:"proj" binding:"required" json:"proj"`
  42. Os string `form:"os" binding:"required" json:"os"`
  43. Version string `form:"version" binding:"required" json:"version"`
  44. PackageUrl string `form:"packageUrl" binding:"required" json:"packageUrl"`
  45. RemoteManifestUrl string `form:"remoteManifestUrl" binding:"required" json:"remoteManifestUrl"`
  46. RemoteVersionUrl string `form:"remoteVersionUrl" binding:"required" json:"remoteVersionUrl"`
  47. TimeSec int64 `form:"timesec" json:"timesec"`
  48. Sign string `form:"sign" json:"sign"`
  49. }
  50. type TGetVersionListReq struct {
  51. Start int64 `form:"start" binding:"required" json:"start"` // Start是闭区间 包含的,列如去前5条 start=1,limit=5
  52. Limit int64 `form:"limit" binding:"required" json:"limit"`
  53. }
  54. type TChangeStautsReq struct {
  55. ID string `form:"id" binding:"required" json:"id"`
  56. Status int16 `form:"status" binding:"required" json:"status"`
  57. }