(ctx *fiber.Ctx)
| 25 | } |
| 26 | } |
| 27 | func (c *clientController) CheckUpdate(ctx *fiber.Ctx) error { |
| 28 | environmentKey := ctx.Query("deployment_key") |
| 29 | appVersion := ctx.Query("app_version") |
| 30 | bundleHash := ctx.Query("package_hash") |
| 31 | label := ctx.Query("label") |
| 32 | clientUniqueId := ctx.Query("client_unique_id") |
| 33 | |
| 34 | logger.L.Info("In CheckUpdate", zap.String("environmentKey", environmentKey), zap.String("appVersion", appVersion), zap.String("bundleHash", bundleHash), zap.String("label", label), zap.String("clientUniqueId", clientUniqueId)) |
| 35 | updateInfo, err := c.clientService.CheckUpdate(environmentKey, appVersion, bundleHash) |
| 36 | if err != nil { |
| 37 | logger.L.Error("In CheckUpdate: Error checking update", zap.Error(err)) |
| 38 | // when update_info is nil, it means there is no update available |
| 39 | // to be safe of sdk crashing upon any irrelavent error, we return nil |
| 40 | return ctx.Status(fiber.StatusOK).JSON(fiber.Map{ |
| 41 | "update_info": nil, |
| 42 | }) |
| 43 | } |
| 44 | return ctx.Status(fiber.StatusOK).JSON(fiber.Map{ |
| 45 | "update_info": updateInfo, |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | func (c *clientController) ReportStatusDeploy(ctx *fiber.Ctx) error { |
| 50 | reportStatusRequest := new(types.ReportStatusDeployRequest) |
nothing calls this directly
no test coverage detected