model

package
v0.0.0-...-475886a Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAlga

func AddAlga(obj Alga) (primitive.ObjectID, error)

func AddAnnotation

func AddAnnotation(id primitive.ObjectID, obj Annotation) error

func AddRiver

func AddRiver(obj River) (primitive.ObjectID, error)

func AddTag

func AddTag(obj Tag) error

func AddUser

func AddUser(obj Operator) error

func BindToRiver

func BindToRiver(rId primitive.ObjectID, aId primitive.ObjectID) error

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 DeleteAnnotation

func DeleteAnnotation(id primitive.ObjectID, annotation Annotation) error

func DeleteTag

func DeleteTag(name string, resouceName string) error

func DeleteUser

func DeleteUser(email string) error

func RiverBindToUser

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

RiverBindToUser 根据用户邮箱绑定数据集对应用户

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"`
	Annotations []Annotation `json:"annotations" binding:"-"`
}

Alga 藻类图片元数据

func GetAlgaData

func GetAlgaData(id primitive.ObjectID) *Alga

func SearchAlga

func SearchAlga(id primitive.ObjectID, key string) []Alga

type AlgaUpload

type AlgaUpload struct {
	RiverId string `json:"riverId" binding:"required"`
	Alga    Alga   `json:"alga" binding:"required"`
}

AlgaUpload 上传藻类图片时使用,将图片与数据集关联

type AlgaWithId

type AlgaWithId struct {
	Id          string       `json:"id" binding:"-"`
	Name        string       `json:"name" binding:"required"`
	Src         string       `json:"src" binding:"required"`
	Annotations []Annotation `json:"annotations" binding:"-"`
}

func GetAllAlga

func GetAllAlga(rId string) []*AlgaWithId

type Anno

type Anno struct {
	AlgaId       string    `json:"algaId" binding:"required"`
	Description  string    `json:"description"`
	Tag          Tag       `json:"tag" binding:"required"`
	Segmentation []float64 `json:"segmentation" binding:"required"`
}

Anno 将标注数据与藻类图片关联时使用

type Annotation

type Annotation struct {
	Description string `json:"description"`
	CreateAt    string `json:"createAt" binding:"-"`
	UpdateAt    string `json:"updateAt" binding:"-"`
	// 坐标点
	Segmentation []float64 `json:"segmentation" binding:"required"`
	Tag          *Tag      `json:"tag" binding:"required"`
}

Annotation 标注数据

func DataBaseAnnoToModelAnno

func DataBaseAnnoToModelAnno(annotations []database.Annotation) []Annotation

func GetAnnotations

func GetAnnotations(id primitive.ObjectID) []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:"-"`
	// 用户拥有的数据集,即river
	DataSet []string `json:"dataSet" 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"`
	Algae   []string `json:"algae" binding:"-"`
}

River 在本系统为数据集概念,algae 为藻类图片集

func GetRiverByID

func GetRiverByID(id string) *River

func GetRivers

func GetRivers(userEmail string) []River

type RiverAdd

type RiverAdd struct {
	River     River  `json:"river" binding:"required"`
	UserEmail string `json:"userEmail" binding:"required"`
}

type RiverWithId

type RiverWithId struct {
	Id      string   `json:"id" binding:"required"`
	Name    string   `json:"name" binding:"required"`
	Address string   `json:"address" binding:"required"`
	Algae   []string `json:"algae" binding:"-"`
}

func GetRiversWithoutAlgae

func GetRiversWithoutAlgae(userEmail string) []RiverWithId

func SearchRiverByKeyWithoutAlgae

func SearchRiverByKeyWithoutAlgae(userEmail string, keyword string) []RiverWithId

SearchRiverByKeyWithoutAlgae 根据关键字搜索河流

type Tag

type Tag struct {
	Name         string `json:"name" binding:"required"`
	ResourceName string `json:"resourceName" binding:"required"`
}

Tag 标签

func GetTags

func GetTags() []Tag

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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