helper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

helper 包介绍

helper 包包含了示例代码用到的一些核心函数.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleCreateUserRequest

func ExampleCreateUserRequest() *apiv1.CreateUserRequest

ExampleCreateUserRequest 创建一个示例的 CreateUserRequest 对象 返回一个指针类型的 CreateUserRequest,其中包含随机生成的用户名、固定密码、昵称、邮箱和随机生成的手机号

func GeneratePhoneNumber

func GeneratePhoneNumber() string

GeneratePhoneNumber 随机生成一个符合中国大陆手机格式的号码 手机号码规则:以 1 开头,第二位为 3-9,接下来是 9 位随机数字,总共 11 位

func MustWithAdminToken

func MustWithAdminToken(ctx context.Context, client apiv1.MiniBlogClient) context.Context

MustWithAdminToken 使用管理员 Token 创建带有授权信息的上下文 参数: - ctx: 上下文对象 - client: MiniBlogClient 客户端,用于调用登录接口 返回: - 一个附加了管理员 Token 的上下文对象

Types

This section is empty.

Jump to

Keyboard shortcuts

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