xversion

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause-Clear Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(c *Version) error

存储数据信息

c	存储的 versionAPP版本 表内容

func Delete

func Delete(id uint) error

查询数据信息

id	查询的 versionAPP版本 表主键ID

func Maps added in v0.2.62

func Maps() (map[int]string, map[int]string)

获取版本信息的字典详情

func Regedit

func Regedit(c *Config)

配置项注入

c	待注入的配置项信息

Types

type Config

type Config struct {
	DB        *gorm.DB       // 数据库连接
	Type      map[int]string // APP说明 1-默认
	Dervice   map[int]string // APP所属平台 1-安卓 2-IOS 3-华为 4-微信小程序
	TableName string         // 表名
}

配置项

type Version

type Version struct {
	Id            uint   `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement;not null;comment:主键ID" form:"id" json:"id"` // 主键ID
	Type          int    `gorm:"column:type;type:int;comment:所属APP" form:"type" json:"type"`                                     // 所属APP
	Dervice       int    `gorm:"column:dervice;type:int;comment:所属设备端" form:"dervice" json:"dervice"`                            // 所属设备端
	ClientVersion string ``                                                                                                      // 客户端的版本号
	/* 128-byte string literal not displayed */
	ClientNum uint `` // 客户端内部版本号,随每次发布递增
	/* 144-byte string literal not displayed */
	UpdateNote string `gorm:"column:update_note;type:text;not null;comment:更新说明" form:"update_note" json:"update_note"`    // 更新说明
	AppLink    string `gorm:"column:app_link;type:varchar(255);not null;comment:app的下载地址" form:"app_link" json:"app_link"` // app的下载地址
	MinVersion string `gorm:"column:min_version;type:varchar(20);comment:最小更新版本号" form:"min_version" json:"min_version"`   // 最小更新版本号
	MinNum     uint   `gorm:"column:min_num;type:int unsigned;comment:最小客户端内部版本号" form:"min_num" json:"min_num"`           // 最小客户端内部版本号
	Ext        string `gorm:"column:ext;type:text;comment:该版本对应的附加属性配置,JSON存储" form:"ext" json:"ext"`                      // 该版本对应的附加属性配置,JSON存储
	CreatedAt  string `gorm:"column:created_at;type:datetime;comment:创建时间" form:"created_at" json:"created_at"`            // 创建时间
	UpdatedAt  string `gorm:"column:updated_at;type:datetime;comment:最后更新时间" form:"updated_at" json:"updated_at"`          // 最后更新时间
	HasUpdate  bool   `gorm:"-" json:"has_update" form:"-"`                                                                // 是否需要更新
	HasForce   bool   `gorm:"-" json:"has_force" form:"-"`                                                                 // 是否强制更新
}

APP版本

func CheckNum

func CheckNum(typ, der int, num uint) (*Version, error)

检测当前APP是否需要更新

typ	所属APP
der	所属设备端
num	客户端内部版本号,随每次发布递增【Build版本号】

func Info

func Info(id uint) (*Version, error)

查询数据信息

id	查询的 versionAPP版本 表主键ID

func List

func List(offset, limit int) (int64, []Version, error)

查询数据信息

offset	跳过条数
limit	查询条数

func (*Version) TableName

func (c *Version) TableName() string

返回所属表名信息

Jump to

Keyboard shortcuts

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