mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
623 B
Go
24 lines
623 B
Go
//
|
|
// Copyright (C) 2024 veypi <i@veypi.com>
|
|
// 2025-03-04 16:08:06
|
|
// Distributed under terms of the MIT license.
|
|
//
|
|
|
|
package user
|
|
|
|
import (
|
|
"github.com/veypi/vbase/auth"
|
|
"github.com/veypi/vigo"
|
|
)
|
|
|
|
var Router = vigo.NewRouter()
|
|
|
|
func init() {
|
|
Router.Get("/", "用户列表", auth.VBaseAuth.Perm("user:read"), list)
|
|
Router.Post("/", "创建用户", auth.VBaseAuth.Perm("user:admin"), create)
|
|
Router.Get("/{user_id}", "获取用户详情", get)
|
|
Router.Patch("/{user_id}", "更新用户", patch)
|
|
Router.Delete("/{user_id}", "删除用户", del)
|
|
Router.Patch("/{user_id}/status", "更新用户状态", updateStatus)
|
|
}
|