Documentation ¶
Index ¶
- func AddLabel(c *gin.Context, name, remark string) (uint, error)
- func AddLabeling(c *gin.Context, objectIDs, labelIDs []uint) ([]map[string]interface{}, error)
- func AddObject(c *gin.Context, appID, system, entity, identity string) (uint, error)
- func DeleteLabeling(c *gin.Context, objectIDs, labelIDs []uint) ([]map[string]interface{}, error)
- func GetLabelByID(c *gin.Context, labelID uint) (demoModels.Label, error)
- func GetLabelByName(c *gin.Context, name string) (demoModels.Label, error)
- func GetLabelingByLabelID(c *gin.Context, labelID uint) ([]demoModels.Object, error)
- func GetLabelingByObjectID(c *gin.Context, objectID uint) ([]demoModels.Label, error)
- func GetLabelsByIDs(c *gin.Context, labelIDs []uint) ([]demoModels.Label, error)
- func GetObjectByID(c *gin.Context, objectID uint) (demoModels.Object, error)
- func GetObjectsByIDs(c *gin.Context, objectIDs []uint) ([]demoModels.Object, error)
- func QueryLabel(c *gin.Context, labelID uint, name, remark string, pageNum, pageSize int, ...) (interface{}, error)
- func QueryObject(c *gin.Context, objectID uint, appID, system, entity, identity string, ...) (interface{}, error)
- func ReplaceLabeling(c *gin.Context, objectIDs, labelIDs []uint) ([]map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLabel ¶
AddLabel 新建标签 返回标签ID 如果标签名称已经存在,不会报错,直接返回已存在标签的ID 如果标签名称已存在,且传递了remark参数则会更新remark字段
func AddLabeling ¶
AddLabeling add associations for the objectIDs and LabelIDs
func AddObject ¶
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 ¶
DeleteLabeling delete associations for object ids and label ids
func GetLabelByID ¶
GetLabelByID 按标签ID查询标签
func GetLabelByName ¶
GetLabelByName 按标签名称查询标签
func GetLabelingByLabelID ¶
GetLabelingByLabelID 根据标签ID查询已关联的对象列表
func GetLabelingByObjectID ¶
GetLabelingByObjectID 根据对象ID查询已关联的标签列表
func GetLabelsByIDs ¶
GetLabelsByIDs 按标签ID列表批量查询标签
func GetObjectByID ¶
GetObjectByID return a object model by id and error
func GetObjectsByIDs ¶
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降序排列 多条记录的结果返回分页信息
Types ¶
This section is empty.