Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code-push.sql
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ CREATE TABLE `package` (
`deployment_id` int DEFAULT NULL,
`size` bigint DEFAULT NULL,
`hash` varchar(256) DEFAULT NULL,
`description` TEXT DEFAULT NULL,
`download` varchar(256) DEFAULT NULL,
`active` int DEFAULT '0',
`failed` int DEFAULT '0',
Expand All @@ -120,6 +121,9 @@ CREATE TABLE `package` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

-- `description` is not part of v1.0.1, it can be added by
-- ALTER TABLE `package` ADD `description` TEXT DEFAULT NULL;

--
-- Dumping data for table `package`
--
Expand Down
1 change: 1 addition & 0 deletions model/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Package struct {
Failed *int `json:"failed"`
Installed *int `json:"installed"`
CreateTime *int64 `json:"create_time"`
Description *string `json:"description"`
}

func (Package) TableName() string {
Expand Down
2 changes: 2 additions & 0 deletions request/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type createBundleReq struct {
AppName *string `json:"appName" binding:"required"`
Deployment *string `json:"deployment" binding:"required"`
DownloadUrl *string `json:"downloadUrl" binding:"required"`
Description *string `json:"description" binding:"required"`
Version *string `json:"version" binding:"required"`
Size *int64 `json:"size" binding:"required"`
Hash *string `json:"hash" binding:"required"`
Expand Down Expand Up @@ -114,6 +115,7 @@ func (App) CreateBundle(ctx *gin.Context) {
Size: createBundleReq.Size,
Hash: createBundleReq.Hash,
Download: createBundleReq.DownloadUrl,
Description: createBundleReq.Description,
Active: utils.CreateInt(0),
Installed: utils.CreateInt(0),
Failed: utils.CreateInt(0),
Expand Down
4 changes: 3 additions & 1 deletion request/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type Client struct{}
type updateInfo struct {
DownloadUrl string `json:"download_url"`
// Description string `json:"description"`
Description string `json:"description"`
IsAvailable bool `json:"is_available"`
IsDisabled bool `json:"is_disabled"`
TargetBinaryRange string `json:"target_binary_range"`
Expand Down Expand Up @@ -62,6 +62,7 @@ func (Client) CheckUpdate(ctx *gin.Context) {
label := strconv.Itoa(*packag.Id)
updateInfoRedis.Label = label
updateInfoRedis.DownloadUrl = config.ResourceUrl + *packag.Download
updateInfoRedis.Description = *packag.Description
}
}
deploymentVersionNew := model.DeploymentVersion{}.GetNewVersionByKeyDeploymentId(*deployment.Id)
Expand All @@ -79,6 +80,7 @@ func (Client) CheckUpdate(ctx *gin.Context) {
updateInfo.IsMandatory = true
updateInfo.Label = updateInfoRedis.Label
updateInfo.DownloadUrl = updateInfoRedis.DownloadUrl
updateInfo.Description = updateInfoRedis.Description
} else if updateInfoRedis.NewVersion != "" && appVersion != updateInfoRedis.NewVersion && utils.FormatVersionStr(appVersion) < utils.FormatVersionStr(updateInfoRedis.NewVersion) {
updateInfo.TargetBinaryRange = updateInfoRedis.NewVersion
updateInfo.UpdateAppVersion = true
Expand Down