model

package
v0.0.0-...-1c981be Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTodo

func CreateTodo(todo *Todo) error

创建TODO

func UpdateTodoById

func UpdateTodoById(id int, todo *Todo) error

根据id更新TODO

Types

type Todo

type Todo struct {
	gorm.Model
	Done    bool
	Content string
}

func DeleteTodoById

func DeleteTodoById(id int) (Todo, error)

根据id删除TODO

func DoneTodoById

func DoneTodoById(id int, done bool) (Todo, error)

根据id更新TODO完成状态

func GetTodoById

func GetTodoById(id int) (Todo, error)

根据id获取TODO

func GetTodos

func GetTodos() ([]Todo, error)

获取所有TODO

Jump to

Keyboard shortcuts

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