patch

package
v0.0.0-...-6ed9cba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ModulePriorityPatch = 9905 // 游戏-热更新

Variables

This section is empty.

Functions

func ApplyPatch

func ApplyPatch(recordID uint) error

ApplyPatch 应用补丁包

Types

type FileChange

type FileChange struct {
	Path       string `json:"path"`        // 文件路径
	ChangeType string `json:"change_type"` // 变更类型 (A:新增, M:修改, D:删除)
	Checksum   string `json:"checksum"`    // 文件校验和
	Size       int64  `json:"size"`        // 文件大小
}

FileChange 文件变更

type PatchConfig

type PatchConfig struct {
	PatchPath          string `json:"patch_path"`          // 补丁路径
	ZipPath            string `json:"zip_path"`            // ZIP存放路径
	Branch             string `json:"branch"`              // 分支
	Platform           string `json:"platform"`            // 平台
	DefaultOldVersion  string `json:"default_old_version"` // 默认旧版本号
	DefaultNewVersion  string `json:"default_new_version"` // 默认新版本号
	DefaultDescription string `json:"default_description"` // 默认补丁描述
	ConfigPath         string `json:"config_path"`         // 配置文件路径
}

PatchConfig 补丁配置

type PatchRecord

type PatchRecord struct {
	ID          uint           `gorm:"primaryKey" json:"id"`
	OldVersion  string         `gorm:"size:50" json:"old_version"`
	NewVersion  string         `gorm:"size:50" json:"new_version"`
	Version     string         `gorm:"size:50;not null" json:"version"`
	Branch      string         `gorm:"size:20;default:'trunk'" json:"branch"`
	Platform    string         `gorm:"size:20;default:'android'" json:"platform"`
	PatchFile   string         `gorm:"size:255;not null" json:"patch_file"`
	Size        int64          `gorm:"not null" json:"size"`
	FileCount   int            `gorm:"default:0" json:"file_count"`
	Status      int            `gorm:"default:0" json:"status"`
	Description string         `gorm:"type:text" json:"description"`
	CreatedAt   time.Time      `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"autoUpdateTime" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"index" json:"-"`
}

func GeneratePatch

func GeneratePatch(oldVersion, newVersion, description, branch, platform string) (*PatchRecord, error)

GeneratePatch 生成补丁包

func GetPatchRecords

func GetPatchRecords(limit, page int) ([]PatchRecord, int, error)

GetPatchRecords 获取补丁记录列表

func (PatchRecord) TableName

func (PatchRecord) TableName() string

type PatchRecordResp

type PatchRecordResp struct {
	ID          uint      `json:"id" gorm:"primaryKey"`
	OldVersion  string    `json:"old_version"` // 旧版本号
	NewVersion  string    `json:"new_version"` // 新版本号
	Version     string    `json:"version"`     // 版本组合
	Branch      string    `json:"branch"`      // 分支
	Platform    string    `json:"platform"`    // 平台
	PatchFile   string    `json:"patch_file"`  // 补丁文件路径
	Size        int64     `json:"size"`        // 文件大小
	FileCount   int       `json:"file_count"`  // 变更文件数量
	Status      int       `json:"status"`      // 状态: 0-待应用, 1-已应用, 2-应用失败
	Description string    `json:"description"` // 补丁描述
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

PatchRecordResp 补丁记录

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL