资产增加标签的功能

This commit is contained in:
dushixiang
2021-01-04 21:29:37 +08:00
parent 5457f8f4dd
commit c362d9b98a
8 changed files with 94 additions and 31 deletions

View File

@ -114,3 +114,11 @@ func AssetTcpingEndpoint(c echo.Context) (err error) {
model.UpdateAssetById(&asset, item.ID)
return Success(c, active)
}
func AssetTagsEndpoint(c echo.Context) (err error) {
var items []string
if items, err = model.FindAssetTags(); err != nil {
return err
}
return Success(c, items)
}

View File

@ -57,6 +57,8 @@ func SetupRoutes() *echo.Echo {
assets.GET("/:id", AssetGetEndpoint)
}
e.GET("/tags", AssetTagsEndpoint)
commands := e.Group("/commands")
{
commands.GET("/paging", CommandPagingEndpoint)
@ -94,6 +96,16 @@ func SetupRoutes() *echo.Echo {
sessions.GET("/:id", SessionGetEndpoint)
}
//tags := e.Group("/tags")
//{
// tags.POST("", TagAllEndpoint)
// tags.GET("/paging", TagPagingEndpoint)
// tags.POST("", TagCreateEndpoint)
// tags.PUT("/:id", TagUpdateEndpoint)
// tags.DELETE("/:id", TagDeleteEndpoint)
// tags.GET("/:id", TagGetEndpoint)
//}
e.GET("/properties", PropertyGetEndpoint)
e.PUT("/properties", PropertyUpdateEndpoint)