Documentation
¶
Overview ¶
Package userwrite 为个人资料和管理员用户写接口接入公共执行协议。 Package userwrite connects profile and administrator user writes to the shared execution contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler 保存用户写接口需要的公共执行和审计依赖。 Handler stores shared execution and audit dependencies for user write endpoints.
func NewHandler ¶
func NewHandler(executionService *executionapp.Service, auditRepo *audit.Repository) *Handler
NewHandler 创建用户写处理器。 NewHandler creates a user write handler.
func (*Handler) CreateCLIToken ¶ added in v1.2.0
CreateCLIToken 由管理员签发带名称的 CLI 令牌,原文只在首次成功时返回。 CreateCLIToken issues a named CLI token for an administrator and returns plaintext only on first success. @Tags admin @Accept json @Produce json @Param request body admin.CreateCLITokenRequest true "签发 CLI 令牌请求" @Success 200 {object} admin.CreateCLITokenResponse @Router /api/v1/admin/cli-tokens [post]
func (*Handler) CreateUser ¶
CreateUser 创建用户,密码只用于业务写入和不可逆请求摘要。 CreateUser creates a user and uses the password only for the business write and irreversible request digest.
func (*Handler) DeleteUser ¶
DeleteUser 删除非当前用户,CLI/API 调用必须先取得一次性确认编号。 DeleteUser deletes a user other than the current actor and requires one-time confirmation for CLI/API calls.
func (*Handler) RevokeCLIToken ¶ added in v1.2.0
RevokeCLIToken 由管理员吊销指定 CLI 令牌。 RevokeCLIToken lets an administrator revoke a CLI token. @Tags admin @Produce json @Param id path int true "Token ID" @Success 200 {object} admin.RevokeCLITokenResponse @Router /api/v1/admin/cli-tokens/{id}/revoke [post]
func (*Handler) UpdateProfile ¶
UpdateProfile 更新当前登录用户的个人资料,并为 CLI/API 调用记录公共执行。 UpdateProfile updates the current user profile and records shared execution for CLI/API calls.
func (*Handler) UpdateUser ¶
UpdateUser 更新用户字段,布尔字段通过指针保留“未提供”和 false 的差异。 UpdateUser updates user fields while pointer booleans preserve the difference between omitted and false.