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: 0

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