model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAlga

func AddAlga(obj Alga) (interface{}, error)

func AddAnnotation

func AddAnnotation(obj Anno) (interface{}, error)

func AddRiver

func AddRiver(obj River) error

func AddUser

func AddUser(obj Operator) error

func BindToAlga

func BindToAlga(algaName string, id primitive.ObjectID) error

BindToAlga 根据藻类名称绑定对应藻类图像

func BindToRiver

func BindToRiver(riverName string, id primitive.ObjectID) error

func BindToUser

func BindToUser(userEmail string, id primitive.ObjectID) error

BindToUser 根据用户邮箱绑定对应用户

func ChangePassword

func ChangePassword(email string, newPassword string) error

func CheckAdmin

func CheckAdmin(email string) bool

func CheckAuth

func CheckAuth(email, password string) bool

func DeleteUser

func DeleteUser(email string) error

func UpdateUser

func UpdateUser(obj Operator) error

Types

type Alga

type Alga struct {
	Name  string `json:"name" binding:"required"`
	Src   string `json:"src" binding:"required"`
	River string `json:"river" binding:"required"`
}

func GetData

func GetData() []Alga

func SearchAlga

func SearchAlga(key string) []Alga

type Anno

type Anno struct {
	User        string `json:"user" binding:"required"`
	Alga        string `json:"alga" binding:"required"`
	Description string `json:"description" binding:"required"`
	Format      string `json:"format" binding:"required"`
	Url         string `json:"url" binding:"required"`
}

type Annotation

type Annotation struct {
	Description string `json:"description" binding:"required"`
	Format      string `json:"format" binding:"required"`
	Url         string `json:"url" binding:"required"`
	CreateAt    string `json:"createAt" binding:"-"`
	UpdateAt    string `json:"updateAt" binding:"-"`
	Id          string `json:"id" binding:"-"`
}

func GetAnnotationByAlga

func GetAnnotationByAlga(algaName string) []Annotation

func GetAnnotationByUser

func GetAnnotationByUser(userEmail string) []Annotation

type Operator

type Operator struct {
	Name     string `json:"name" binding:"required"`
	Password string `json:"password" binding:"required"`
	Email    string `json:"email" binding:"required"`
	Access   int    `json:"access" binding:"-"`
	CreateAt string `json:"createAt" binding:"-"`
}

func GetUser

func GetUser(email string) Operator

func GetUsers

func GetUsers() []Operator

type River

type River struct {
	Name    string `json:"name" binding:"required"`
	Address string `json:"address" binding:"required"`
}

func GetRivers

func GetRivers() []River

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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