demo

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLabel

func AddLabel(c *gin.Context, name, remark string) (uint, error)

AddLabel 新建标签 返回标签ID 如果标签名称已经存在,不会报错,直接返回已存在标签的ID 如果标签名称已存在,且传递了remark参数则会更新remark字段

func AddLabeling

func AddLabeling(c *gin.Context, objectIDs, labelIDs []uint) ([]map[string]interface{}, error)

AddLabeling add associations for the objectIDs and LabelIDs

func AddObject

func AddObject(c *gin.Context, appID, system, entity, identity string) (uint, error)

AddObject insert an object to database return the object id if the object's fields value has existed, it will return the existed id

func DeleteLabeling

func DeleteLabeling(c *gin.Context, objectIDs, labelIDs []uint) ([]map[string]interface{}, error)

DeleteLabeling delete associations for object ids and label ids

func GetLabelByID

func GetLabelByID(c *gin.Context, labelID uint) (demoModels.Label, error)

GetLabelByID 按标签ID查询标签

func GetLabelByName

func GetLabelByName(c *gin.Context, name string) (demoModels.Label, error)

GetLabelByName 按标签名称查询标签

func GetLabelingByLabelID

func GetLabelingByLabelID(c *gin.Context, labelID uint) ([]demoModels.Object, error)

GetLabelingByLabelID 根据标签ID查询已关联的对象列表

func GetLabelingByObjectID

func GetLabelingByObjectID(c *gin.Context, objectID uint) ([]demoModels.Label, error)

GetLabelingByObjectID 根据对象ID查询已关联的标签列表

func GetLabelsByIDs

func GetLabelsByIDs(c *gin.Context, labelIDs []uint) ([]demoModels.Label, error)

GetLabelsByIDs 按标签ID列表批量查询标签

func GetObjectByID

func GetObjectByID(c *gin.Context, objectID uint) (demoModels.Object, error)

GetObjectByID return a object model by id and error

func GetObjectsByIDs

func GetObjectsByIDs(c *gin.Context, objectIDs []uint) ([]demoModels.Object, error)

GetObjectsByIDs return objects model list by ids and error

func QueryLabel

func QueryLabel(c *gin.Context, labelID uint, name, remark string, pageNum, pageSize int, order string) (interface{}, error)

QueryLabel 根据参数组合查询label 传labelID则只返回对应ID的label,其他参数不生效 offset为分页页码默认为1 limit为分页查询每页数量, -1可取消限制 order为排序方式 "字段 desc/asc" 默认按id降序排列 多条记录的结果返回分页信息

func QueryObject

func QueryObject(c *gin.Context, objectID uint, appID, system, entity, identity string, pageNum, pageSize int, order string) (interface{}, error)

QueryObject 根据参数组合查询object 传objectID则只返回对应ID的object,其他参数不生效 同时传appID,system,entity,identity参数过滤条件叠加生效 pageNum为分页查询页码 默认为1 pageSize为分页查询每页数量, -1可取消限制 order为排序方式 "字段 desc/asc" 默认按id降序排列 多条记录的结果返回分页信息

func ReplaceLabeling

func ReplaceLabeling(c *gin.Context, objectIDs, labelIDs []uint) ([]map[string]interface{}, error)

ReplaceLabeling replace old associations with new given objectIDs and LabelIDs

Types

This section is empty.

Jump to

Keyboard shortcuts

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