utils

package
v0.0.0-...-e830d1d Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

README

orm二次重构

Documentation

Overview

__author__ : stray_camel

__description__ : 继承使用gorm构造orm对象 __REFERENCES__: __date__: 2021-03-16

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalysisMsg

func AnalysisMsg(c *client.QQClient, ele []message.IMessageElement) (isAt bool, com, content string)

AnalysisMsg 参数-客户端-消息列表 返回-是否@触发-指令-内容

func DownloadImg

func DownloadImg(filename, url string) error

文件下载

func EqualFolds

func EqualFolds(s string, sArray []string) bool

字符按-数组匹配

func FetchCommandNum

func FetchCommandNum() string

项目启动时-分发递增得command

func GetDateViaWeekNum

func GetDateViaWeekNum(weekNum int) (res string)

通过数字获取当周指定周数的日期 0-1-2-3-4-5-6-7:分别对用当周和周一到周日

func PathExists

func PathExists(path string) bool

检查文件是否存在

func ReadFile

func ReadFile(path string) []byte

ReadFile 读取文件 读取失败返回 nil

func RemakrFormat

func RemakrFormat(s string) string

func Text2ImgHandler

func Text2ImgHandler(text string) (filePath string, err error)

Text2ImgHandler 文本转图片

Types

type CamelOrm

type CamelOrm struct {
	Orm *gorm.DB
}
var Orm *CamelOrm

func GetOrm

func GetOrm() *CamelOrm

触发

func (*CamelOrm) Execute

func (r *CamelOrm) Execute(sql string, params interface{}) int64

Execute 处理数据

func (*CamelOrm) Execute_batch

func (r *CamelOrm) Execute_batch(baseSql, sql string, orderParamsList [][]interface{}) (lines int)

Execute_batch 批量处理数据

func (*CamelOrm) Fetch_data_sql

func (r *CamelOrm) Fetch_data_sql(sql string, resStruct interface{}, params interface{}) (res *gorm.DB)

type Info

type Info struct {
	Keys    []string
	Remark  string `json:"remark"`
	Command string `json:"com"`
}

指令信息

func (*Info) Key

func (r *Info) Key() []string

获取指令匹配项

Jump to

Keyboard shortcuts

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