help

package
v0.0.0-...-f9e7125 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success     = NewError(http.StatusOK, 0, "success")
	ServerError = NewError(http.StatusInternalServerError, 200500, "系统异常,请稍后重试!")
	NotFound    = NewError(http.StatusNotFound, 200404, http.StatusText(http.StatusNotFound))
)
View Source
var Appini string

Functions

func GetAppIni

func GetAppIni(source string) string

GetAppIni

@Description: 获取ini基本配置
@param source  数据来源
@return string

func GetHtmlDoc

func GetHtmlDoc(url string) *goquery.Document

* 获取html doc内容

func HttpGet

func HttpGet(httpUrl string, paramsMap map[string]string) string

get方式http请求

func HttpPost

func HttpPost(httpurl string, paramsMap map[string]interface{}) string

json 类型http请求

func OutError

func OutError(request *gin.Context, errMsg string)

func Output

func Output(msg interface{}, requeset *gin.Context)

func SendDingCommonMessage

func SendDingCommonMessage(message, AccessToken, Secret string)

func SendDingMessage

func SendDingMessage(message string)

func SetAppIniFile

func SetAppIniFile(source string) *ini.File

Types

type Body

type Body struct {
	Code   int         `json:"code"`
	Data   interface{} `json:"data"`
	ErrMsg string      `json:"errMsg"`
}

type Common

type Common struct {
}

func (*Common) CheckIdCard

func (c *Common) CheckIdCard(card string) bool

CheckIdCard 检验身份证

func (*Common) CheckMobile

func (c *Common) CheckMobile(phone string) bool

CheckMobile 检验手机号

func (*Common) ClusterConsumer

func (c *Common) ClusterConsumer(topics string, groupId string)

ClusterConsumer

@Description:
@receiver c
@param topics
@param groupId

func (*Common) GetCurrentDirectory

func (c *Common) GetCurrentDirectory() string

func (*Common) GetFormatTime

func (c *Common) GetFormatTime(timeString string) string

GetFormatTime

@Description:
@receiver c
@param timeString 时间字符串
@return string
@date ${DATE} ${TIME}

func (*Common) GetImageUrl

func (c *Common) GetImageUrl(imgUrl string) string

getImageUrl

@Description:  获取图片url
@receiver c

func (*Common) GetParentDirectory

func (c *Common) GetParentDirectory(dirctory string) string

func (*Common) GetTimeStamp

func (c *Common) GetTimeStamp(timeString string, format string) int

* 根据时间获取时间格式

func (*Common) InterFaceToString

func (c *Common) InterFaceToString(value interface{}) string

接口转字符

func (*Common) Log

func (c *Common) Log(Msg interface{}, logFileName string)

func (*Common) PushAsyncKafkaMessage

func (c *Common) PushAsyncKafkaMessage(topic string, message interface{})

异步发送kafka消息

func (*Common) PushSyncKafkaMessage

func (c *Common) PushSyncKafkaMessage(topic string, message interface{})

同步发送kafka消息

func (*Common) SetDefault

func (c *Common) SetDefault(typs reflect.Type, values reflect.Value)

设置系统默认值

func (*Common) StrPhoneRule

func (c *Common) StrPhoneRule(str string) string

提取字符串中的手机号

func (*Common) ToInt

func (c *Common) ToInt(val string) int64

func (*Common) ToUint

func (c *Common) ToUint(val string) uint64

字符串uint64

type Error

type Error struct {
	StatusCode int    `json:"-"`
	Code       int    `json:"code"`
	Msg        string `json:"msg"`
}

错误处理的结构体

func NewError

func NewError(statusCode, Code int, msg string) *Error

func OtherError

func OtherError(message string) *Error

func (*Error) Error

func (e *Error) Error() string

type HttpHelp

type HttpHelp struct {
}

func (*HttpHelp) DownImage

func (h *HttpHelp) DownImage(imgPath string, imgUrl string) string

type Tools

type Tools struct {
}

func (*Tools) GenerateMd5

func (t *Tools) GenerateMd5(str string) string

生成md5

Jump to

Keyboard shortcuts

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