model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MErrExisted = "该数据已经存在"
	MErrDelete  = "该数据删除失败"
	MErrUpdate  = "该内容修改失败"
	MErrNotFind = "没有查询到数据"
)

Variables

This section is empty.

Functions

func AddAnnouncement

func AddAnnouncement(data *Announcement) error

func DeleteAnnouncement

func DeleteAnnouncement(data *Announcement) error

func InitDb

func InitDb(path string)

func UpdateAnnouncement

func UpdateAnnouncement(data *Announcement) error

Types

type Announcement

type Announcement struct {
	Id          int    `xorm:"not null pk autoincr INT(11)" json:"id,omitempty"`
	Title       string `xorm:"not null default '' comment('标题') VARCHAR(50)" json:"title,omitempty"`
	Content     string `xorm:"not null comment('内容') TEXT" json:"content,omitempty"`
	Url         string `xorm:"default '' comment('超链接') VARCHAR(150)" json:"url,omitempty"`
	CreateTime  int64  `xorm:"not null default 0 comment('创建时间') BIGINT(20)" json:"create_time,omitempty"`
	UpdateTime  int64  `xorm:"default 0 comment('更新时间') BIGINT(20)" json:"update_time,omitempty"`
	ExpiredTime int64  `xorm:"not null default 0 comment('过期时间(1为永远不过期)') BIGINT(20)" json:"expired_time,omitempty"`
}

func GetAnnouncementAll

func GetAnnouncementAll() (info []Announcement, err error)

func GetAnnouncementById

func GetAnnouncementById(id int) (info Announcement, errs error)

Jump to

Keyboard shortcuts

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