BOKA

package module
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

BOKA

博卡API

配置文件

config/config.yaml
boka:
    custId: "*****"
    compId: "***"
    userName: "*****"
    passWord: "*****"
    source: "****"
    sec: 7200  #默认token过期时间

Documentation

Index

Constants

View Source
const ConfigFile = "./config/config.yaml"

Variables

View Source
var (
	CDCLASS  = []string{"合计", "员工总合计", "小计"}
	CUTCLASS = []string{"1001", "1002", "1003", "1004", "1005", "1011", "1012", "1013", "1014", "1015", "3008", "3009", "4001"}
)
View Source
var TOKEN = Token{}

Functions

func Async

func Async(times int, FuncName func())

Async

@Description: 定时器 开始执行一次,后根据延迟传入的秒数循环执行
@param times
@param FuncName

func Decimal

func Decimal(num float64) float64

Decimal

@Description: 保留两位小数
@param num
@return float64

func GetDate

func GetDate(params ...string) (startDate string, endDate string)

GetDate

@Description: 获取当月和上月日期  20230101 20230131
@param params 有值代表上月
@return startDate
@return endDate

func InitConf

func InitConf(path ...string)

Types

type Config

type Config struct {
	BoKa KaConfig `yaml:"boka" mapstructure:"boka" json:"boka"`
}
var (
	CONFIG *Config
)

type Items

type Items struct {
	UserID    string  // 会员卡号
	UserName  string  // 会员名字
	CardType  string  // 卡类型
	BillDate  string  // 消费日期
	ItemName  string  // 项目名字
	ItemID    string  // 项目 ID
	ItemAmt   float64 // 项目总金额
	ItemAmt3  float64 // 实际分得金额
	PayType   string  // 支付方式
	PayCode   string  // 支付方式ID
	EmpName   string  // 员工姓名
	EmpID     string  // 员工ID
	EmpMoney  float64 // 工资
	EmpType   string  // 员工职位
	Times     string  // 次数
	ShareRote string  // 分享比率
	Remark    string  // 备忘
	TypeID    string  // TypeIds["充值"] == 1 课程=2 消疗=3 项目=4 剪发=5
}

type KaConfig

type KaConfig struct {
	CustId   string `json:"custId" yaml:"custId" mapstructure:"custId" `
	CompId   string `json:"compId" yaml:"compId" mapstructure:"compId" `
	UserName string `json:"userName" yaml:"userName" mapstructure:"userName" `
	PassWord string `json:"passWord" yaml:"passWord" mapstructure:"passWord" `
	Source   string `json:"source" yaml:"source" mapstructure:"source" `
	Sec      int64  `mapstructure:"sec" json:"sec" yaml:"sec"`
}

type Token

type Token struct {
	Token string
	ID    string
	Expir int64
}

func (*Token) Get

func (T *Token) Get() (string, string)

func (*Token) Headers

func (T *Token) Headers() map[string]string

func (*Token) RequestToken

func (T *Token) RequestToken()

type UserData

type UserData struct {
	Raw   gjson.Result
	Emps  []string
	Items []Items
}

func KaRun

func KaRun(params ...string) UserData

func (*UserData) GetPerformanceData

func (U *UserData) GetPerformanceData(Params ...string)

GetPerformanceData

@Description:
@param Params startUser, endUser, startDate endDate

func (*UserData) GetUserType2

func (U *UserData) GetUserType2()

GetUserType2

@Description: 获取所有的员工
@receiver U

func (*UserData) Handler

func (U *UserData) Handler()

func (*UserData) In

func (U *UserData) In(words []string, word string) (right bool)

In

@Description:
@receiver U
@param word
@param words
@return right

Jump to

Keyboard shortcuts

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