- update request

- update ip
master
李光春 1 year ago
parent c77bfce263
commit 1602f17a51

@ -1,3 +1,8 @@
## v2022-12-19
- requestupdate ua
- ipupdate data
## v2022-06-10
- lock优化

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.54"
return "1.0.55"
}

@ -1,48 +0,0 @@
package goheader
import (
"encoding/json"
"net/url"
"strconv"
)
type Headers map[string]interface{}
func NewHeaders() Headers {
P := make(Headers)
return P
}
func (p Headers) Set(key string, value interface{}) {
p[key] = value
}
func (p Headers) SetHeaders(headers Headers) {
for key, value := range headers {
p[key] = value
}
}
func (p Headers) GetQuery() string {
u := url.Values{}
for k, v := range p {
u.Set(k, GetHeadersString(v))
}
return u.Encode()
}
func GetHeadersString(i interface{}) string {
switch v := i.(type) {
case string:
return v
case []byte:
return string(v)
case int:
return strconv.Itoa(v)
case bool:
return strconv.FormatBool(v)
default:
bytes, _ := json.Marshal(v)
return string(bytes)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 MiB

After

Width:  |  Height:  |  Size: 65 MiB

Binary file not shown.

@ -1,21 +0,0 @@
package gomac
import (
"net"
)
func GetMacAddrs() (macAddrs []string) {
netInterfaces, err := net.Interfaces()
if err != nil {
return macAddrs
}
for _, netInterface := range netInterfaces {
macAddr := netInterface.HardwareAddr.String()
if len(macAddr) == 0 {
continue
}
macAddrs = append(macAddrs, macAddr)
}
return macAddrs
}

@ -1,20 +0,0 @@
package jobs
import (
"github.com/dtapps/go-library/utils/gotime"
"gorm.io/gorm"
"log"
)
// Check 任务检查
func (app *App) Check(tx *gorm.DB, vs []Task) {
if app.MainService > 0 && len(vs) > 0 {
for _, v := range vs {
diffInSecondWithAbs := gotime.Current().DiffInSecondWithAbs(gotime.SetCurrentParse(v.UpdatedAt).Time)
if diffInSecondWithAbs >= v.Frequency*3 {
log.Printf("每隔%v秒任务%v相差%v秒\n", v.Frequency, v.Id, diffInSecondWithAbs)
tx.Where("task_id = ?", v.Id).Where("run_id = ?", v.RunId).Delete(&TaskLogRun{}) // 删除
}
}
}
}

@ -1,70 +0,0 @@
package jobs
import (
"fmt"
"net/http"
)
const (
CodeAbnormal = 0 // 异常
CodeError = http.StatusInternalServerError // 失败
CodeSuccess = http.StatusOK // 成功
CodeEnd = http.StatusCreated // 结束
)
// 每隔n秒执行一次
const specSeconds = "*/%d * * * * *"
// GetSpecSeconds 每隔n秒执行一次
var GetSpecSeconds = func(n int64) string {
if n < 0 && n > 59 {
return ""
}
return fmt.Sprintf(specSeconds, n)
}
// GetFrequencySeconds 每隔n秒执行一次
var GetFrequencySeconds = func(n int64) int64 {
if n < 0 && n > 59 {
return -1
}
return n
}
// 每隔n分钟执行一次
const specMinutes = "0 */%d * * * *"
// GetSpecMinutes 每隔n分钟执行一次
var GetSpecMinutes = func(n int64) string {
if n < 0 && n > 59 {
return ""
}
return fmt.Sprintf(specMinutes, n)
}
// GetFrequencyMinutes 每隔n分钟执行一次
var GetFrequencyMinutes = func(n int64) int64 {
if n < 0 && n > 59 {
return -1
}
return n * 60
}
// 每天n点执行一次
const specHour = "0 0 */%d * * *"
// GetSpecHour 每天n点执行一次
var GetSpecHour = func(n int64) string {
if n < 0 && n > 23 {
return ""
}
return fmt.Sprintf(specHour, n)
}
// GetFrequencyHour 每天n点执行一次
var GetFrequencyHour = func(n int64) int64 {
if n < 0 && n > 23 {
return -1
}
return n * 60 * 60
}

@ -1,19 +0,0 @@
package jobs
import (
"github.com/dtapps/go-library/utils/goip"
"gorm.io/gorm"
)
// RefreshIp 刷新Ip
func (app *App) RefreshIp(tx *gorm.DB) {
xip := goip.GetOutsideIp()
if app.OutsideIp == "" || app.OutsideIp == "0.0.0.0" {
return
}
if app.OutsideIp == xip {
return
}
tx.Where("ips = ?", app.OutsideIp).Delete(&TaskIp{}) // 删除
app.OutsideIp = xip
}

@ -1,358 +0,0 @@
package jobs
import (
"github.com/dtapps/go-library/utils/dorm"
"github.com/dtapps/go-library/utils/gojson"
"github.com/dtapps/go-library/utils/gotime"
"github.com/dtapps/go-library/utils/only"
"gorm.io/gorm"
"log"
)
type App struct {
RunVersion int `json:"run_version"` // 运行版本
Os string `json:"os"` // 系统类型
Arch string `json:"arch"` // 系统架构
MaxProCs int `json:"max_pro_cs"` // CPU核数
Version string `json:"version"` // GO版本
MacAddrS string `json:"mac_addr_s"` // Mac地址
InsideIp string `json:"inside_ip"` // 内网ip
OutsideIp string `json:"outside_ip"` // 外网ip
MainService int `json:"main_service"` // 主要服务
Db *gorm.DB // 数据库
Redis *dorm.RedisClient // 缓存数据库服务
}
// Add 添加任务
func (app *App) Add(tx *gorm.DB, Type string, params interface{}, frequency int64) *gorm.DB {
return tx.Create(&Task{
Status: TASK_IN,
Params: gojson.JsonEncodeNoError(params),
StatusDesc: "首次添加任务",
Frequency: frequency,
RunId: only.GetUuId(),
Type: Type,
CreatedIp: app.OutsideIp,
UpdatedIp: app.OutsideIp,
CreatedAt: gotime.Current().Format(),
UpdatedAt: gotime.Current().Format(),
})
}
// AddCustomId 添加任务
func (app *App) AddCustomId(tx *gorm.DB, Type string, params interface{}, frequency int64, customId string) *gorm.DB {
query := app.TaskCustomIdTake(tx, Type, customId)
if query.Id != 0 {
return tx
}
return tx.Create(&Task{
Status: TASK_IN,
Params: gojson.JsonEncodeNoError(params),
StatusDesc: "首次添加任务",
Frequency: frequency,
RunId: only.GetUuId(),
CustomId: customId,
Type: Type,
CreatedIp: app.OutsideIp,
UpdatedIp: app.OutsideIp,
CreatedAt: gotime.Current().Format(),
UpdatedAt: gotime.Current().Format(),
})
}
// AddCustomIdMaxNumber 添加任务并设置最大数量
func (app *App) AddCustomIdMaxNumber(tx *gorm.DB, Type string, params interface{}, frequency int64, customId string, maxNumber int64) *gorm.DB {
query := app.TaskCustomIdTakeStatus(tx, Type, customId, TASK_IN)
if query.Id != 0 {
return tx
}
return tx.Create(&Task{
Status: TASK_IN,
Params: gojson.JsonEncodeNoError(params),
StatusDesc: "首次添加任务",
Frequency: frequency,
MaxNumber: maxNumber,
RunId: only.GetUuId(),
CustomId: customId,
Type: Type,
CreatedIp: app.OutsideIp,
UpdatedIp: app.OutsideIp,
CreatedAt: gotime.Current().Format(),
UpdatedAt: gotime.Current().Format(),
})
}
type TaskParams = Task
// AddInOrder 添加订单可执行任务
func (app *App) AddInOrder(tx *gorm.DB, Type string, params interface{}, frequency int64) *gorm.DB {
var param TaskParams
param.Type = Type
param.Frequency = frequency
param.ParamsType = ParamsOrderType
return app.AddIn(tx, param, params)
}
// AddInOrderCustomId 添加订单可执行任务
func (app *App) AddInOrderCustomId(tx *gorm.DB, Type string, params interface{}, frequency int64, customId string) *gorm.DB {
query := app.TaskCustomIdTakeStatus(tx, Type, customId, TASK_IN)
if query.Id != 0 {
return tx
}
var param TaskParams
param.Type = Type
param.Frequency = frequency
param.CustomId = customId
param.ParamsType = ParamsOrderType
return app.AddIn(tx, param, params)
}
// AddInOrderCustomIdSpecifyIp 添加订单可执行任务
func (app *App) AddInOrderCustomIdSpecifyIp(tx *gorm.DB, Type string, params interface{}, frequency int64, customId, specifyIp string) *gorm.DB {
query := app.TaskCustomIdTakeStatus(tx, Type, customId, TASK_IN)
if query.Id != 0 {
return tx
}
var param TaskParams
param.Type = Type
param.Frequency = frequency
param.CustomId = customId
param.SpecifyIp = specifyIp
param.ParamsType = ParamsOrderType
return app.AddIn(tx, param, params)
}
// AddInMerchantGoldenBean 添加商家金豆可执行任务
func (app *App) AddInMerchantGoldenBean(tx *gorm.DB, Type string, params interface{}, frequency int64) *gorm.DB {
var param TaskParams
param.Type = Type
param.Frequency = frequency
param.ParamsType = ParamsMerchantGoldenBeanType
return app.AddIn(tx, param, params)
}
// AddInTeamInv 添加团队邀请可执行任务
func (app *App) AddInTeamInv(tx *gorm.DB, Type string, params interface{}, frequency int64) *gorm.DB {
var param TaskParams
param.Type = Type
param.Frequency = frequency
param.ParamsType = ParamsTeamInvType
return app.AddIn(tx, param, params)
}
// AddInUserShareInvitation 邀请好友
func (app *App) AddInUserShareInvitation(tx *gorm.DB, Type string, params interface{}, frequency int64) *gorm.DB {
var param TaskParams
param.Type = Type
param.Frequency = frequency
return app.AddIn(tx, param, params)
}
// AddInNewService 添加企业自定义可执行任务
func (app *App) AddInNewService(tx *gorm.DB, Type string, params interface{}, frequency int64) *gorm.DB {
var param TaskParams
param.Type = Type
param.Frequency = frequency
param.ParamsType = ParamsNewServiceType
return app.AddIn(tx, param, params)
}
// AddInOrderCustomIdObservation 添加观察接口任务
func (app *App) AddInOrderCustomIdObservation(tx *gorm.DB, Type string, customId string) *gorm.DB {
query := app.TaskCustomIdTakeStatus(tx, Type, customId, TASK_IN)
if query.Id != 0 {
return tx
}
var param TaskParams
param.Type = Type
param.Frequency = 3600
param.MaxNumber = 24 * 5 // 一个星期
param.CustomId = customId
param.ParamsType = ParamsOrderType
return app.AddIn(tx, param, ParamsOrderId{
OrderId: customId,
})
}
// AddInOrderCustomIdObservationClone 观察接口关闭
func (app *App) AddInOrderCustomIdObservationClone(tx *gorm.DB, Type string, customId string) *gorm.DB {
query := app.TaskCustomIdTakeStatus(tx, Type, customId, TASK_IN)
if query.Id == 0 {
return tx
}
return app.Edit(tx, query.Id).Select("status", "status_desc", "run_id", "updated_ip", "updated_at").
Updates(Task{
Status: TASK_SUCCESS,
StatusDesc: "已完成,停止观察",
RunId: only.GetUuId(),
UpdatedIp: app.OutsideIp,
UpdatedAt: gotime.Current().Format(),
})
}
// AddIn 添加可执行任务
// params.Type 任务类型
// params.Frequency 任务频率
// params.CustomId 自定义编号
// params 任务参数
func (app *App) AddIn(tx *gorm.DB, param TaskParams, params interface{}) *gorm.DB {
param.Status = TASK_IN
param.StatusDesc = "首次添加任务"
param.RunId = only.GetUuId()
param.Params = gojson.JsonEncodeNoError(params)
param.CreatedIp = app.OutsideIp
param.UpdatedIp = app.OutsideIp
param.CreatedAt = gotime.Current().Format()
param.UpdatedAt = gotime.Current().Format()
status := tx.Create(&param)
if status.RowsAffected == 0 {
log.Println("AddIn", status.Error)
}
return status
}
// AddWaitNewServiceNext 添加企业自定义下一步等待执行任务
func (app *App) AddWaitNewServiceNext(tx *gorm.DB, param TaskParams, params interface{}) *gorm.DB {
param.ParamsType = ParamsNewServiceNextType
return app.AddWait(tx, param, params)
}
// AddWait 添加等待执行任务
// params.Type 任务类型
// params.Frequency 任务频率
// params.CustomId 自定义编号
// params.CustomSequence 自定义顺序
// params 任务参数
func (app *App) AddWait(tx *gorm.DB, param TaskParams, params interface{}) *gorm.DB {
param.Status = TASK_WAIT
param.StatusDesc = "首次添加任务"
param.RunId = only.GetUuId()
param.Params = gojson.JsonEncodeNoError(params)
param.CreatedIp = app.OutsideIp
param.UpdatedIp = app.OutsideIp
param.CreatedAt = gotime.Current().Format()
param.UpdatedAt = gotime.Current().Format()
return tx.Create(&param)
}
// Edit 任务修改
func (app *App) Edit(tx *gorm.DB, id uint) *gorm.DB {
return tx.Model(&Task{}).Where("id = ?", id)
}
// UpdateFrequency 更新任务频率
func (app *App) UpdateFrequency(tx *gorm.DB, id uint, frequency int64) *gorm.DB {
return app.Edit(tx, id).
Updates(map[string]interface{}{
"frequency": frequency,
})
}
// Start 任务启动
func (app *App) Start(tx *gorm.DB, customId string, customSequence int64) *gorm.DB {
return tx.Model(&Task{}).
Where("custom_id = ?", customId).
Where("custom_sequence = ?", customSequence).
Where("status = ?", TASK_WAIT).
Select("status", "status_desc", "updated_ip", "updated_at").
Updates(Task{
Status: TASK_IN,
StatusDesc: "启动任务",
UpdatedIp: app.OutsideIp,
UpdatedAt: gotime.Current().Format(),
})
}
// RunAddLog 任务执行日志
func (app *App) RunAddLog(tx *gorm.DB, id uint, runId string) *gorm.DB {
return tx.Create(&TaskLogRun{
TaskId: id,
RunId: runId,
InsideIp: app.InsideIp,
OutsideIp: app.OutsideIp,
Os: app.Os,
Arch: app.Arch,
Gomaxprocs: app.MaxProCs,
GoVersion: app.Version,
MacAddrs: app.MacAddrS,
CreatedAt: gotime.Current().Format(),
})
}
// Run 任务执行
func (app *App) Run(tx *gorm.DB, info Task, status int, desc string) {
// 请求函数记录
statusCreate := tx.Create(&TaskLog{
TaskId: info.Id,
StatusCode: status,
Desc: desc,
Version: app.RunVersion,
CreatedAt: gotime.Current().Format(),
})
if statusCreate.RowsAffected == 0 {
log.Println("statusCreate", statusCreate.Error)
}
if status == 0 {
statusEdit := app.Edit(tx, info.Id).Select("run_id").Updates(Task{
RunId: only.GetUuId(),
})
if statusEdit.RowsAffected == 0 {
log.Println("statusEdit", statusEdit.Error)
}
return
}
// 任务
if status == CodeSuccess {
// 执行成功
statusEdit := app.Edit(tx, info.Id).Select("status_desc", "number", "run_id", "updated_ip", "updated_at", "result").Updates(Task{
StatusDesc: "执行成功",
Number: info.Number + 1,
RunId: only.GetUuId(),
UpdatedIp: app.OutsideIp,
UpdatedAt: gotime.Current().Format(),
Result: desc,
})
if statusEdit.RowsAffected == 0 {
log.Println("statusEdit", statusEdit.Error)
}
}
if status == CodeEnd {
// 执行成功、提前结束
statusEdit := app.Edit(tx, info.Id).Select("status", "status_desc", "number", "updated_ip", "updated_at", "result").Updates(Task{
Status: TASK_SUCCESS,
StatusDesc: "结束执行",
Number: info.Number + 1,
UpdatedIp: app.OutsideIp,
UpdatedAt: gotime.Current().Format(),
Result: desc,
})
if statusEdit.RowsAffected == 0 {
log.Println("statusEdit", statusEdit.Error)
}
}
if status == CodeError {
// 执行失败
statusEdit := app.Edit(tx, info.Id).Select("status_desc", "number", "run_id", "updated_ip", "updated_at", "result").Updates(Task{
StatusDesc: "执行失败",
Number: info.Number + 1,
RunId: only.GetUuId(),
UpdatedIp: app.OutsideIp,
UpdatedAt: gotime.Current().Format(),
Result: desc,
})
if statusEdit.RowsAffected == 0 {
log.Println("statusEdit", statusEdit.Error)
}
}
if info.MaxNumber != 0 {
if info.Number+1 >= info.MaxNumber {
// 关闭执行
statusEdit := app.Edit(tx, info.Id).Select("status").Updates(Task{
Status: TASK_TIMEOUT,
})
if statusEdit.RowsAffected == 0 {
log.Println("statusEdit", statusEdit.Error)
}
}
}
}

@ -1,35 +0,0 @@
package jobs
import (
"fmt"
"github.com/dtapps/go-library/utils/dorm"
"time"
)
// Lock 上锁
func (app *App) Lock(info Task, id any) string {
cacheName := fmt.Sprintf("cron:%v:%v", info.Type, id)
judgeCache := app.Redis.NewStringOperation().Get(cacheName).UnwrapOr("")
if judgeCache != "" {
return judgeCache
}
app.Redis.NewStringOperation().Set(cacheName, fmt.Sprintf("已在%v机器上锁成功", app.OutsideIp), dorm.WithExpire(time.Millisecond*time.Duration(info.Frequency)*3))
return ""
}
// Unlock Lock 解锁
func (app *App) Unlock(info Task, id any) {
cacheName := fmt.Sprintf("cron:%v:%v", info.Type, id)
app.Redis.NewStringOperation().Del(cacheName)
}
// LockForever 永远上锁
func (app *App) LockForever(info Task, id any) string {
cacheName := fmt.Sprintf("cron:%v:%v", info.Type, id)
judgeCache := app.Redis.NewStringOperation().Get(cacheName).UnwrapOr("")
if judgeCache != "" {
return judgeCache
}
app.Redis.NewStringOperation().Set(cacheName, fmt.Sprintf("已在%v机器永远上锁成功", app.OutsideIp))
return ""
}

@ -1,181 +0,0 @@
package jobs
import (
"gorm.io/gorm"
"log"
"strings"
)
const (
TASK_IN = "IN" // 任务运行
TASK_SUCCESS = "SUCCESS" // 任务完成
TASK_ERROR = "ERROR" // 任务异常
TASK_TIMEOUT = "TIMEOUT" // 任务超时
TASK_WAIT = "WAIT" // 任务等待
)
// Task 任务
type Task struct {
Id uint `gorm:"primaryKey" json:"id"` // 记录编号
Status string `json:"status"` // 状态码
Params string `json:"params"` // 参数
ParamsType string `json:"params_type"` // 参数类型
StatusDesc string `json:"status_desc"` // 状态描述
Frequency int64 `json:"frequency"` // 频率(秒单位)
Number int64 `json:"number"` // 当前次数
MaxNumber int64 `json:"max_number"` // 最大次数
RunId string `json:"run_id"` // 执行编号
CustomId string `json:"custom_id"` // 自定义编号
CustomSequence int64 `json:"custom_sequence"` // 自定义顺序
Type string `json:"type"` // 类型
CreatedIp string `json:"created_ip"` // 创建外网IP
SpecifyIp string `json:"specify_ip"` // 指定外网IP
UpdatedIp string `json:"updated_ip"` // 更新外网IP
Result string `json:"result"` // 结果
CreatedAt string `gorm:"type:text" json:"created_at"` // 创建时间
UpdatedAt string `gorm:"type:text" json:"updated_at"` // 更新时间
}
func (m *Task) TableName() string {
return "task"
}
// TaskTake 查询任务
func (app *App) TaskTake(tx *gorm.DB, customId string) (result Task) {
tx.Where("custom_id = ?", customId).Where("status = ?", TASK_IN).Take(&result)
return result
}
// TaskCustomIdTake 查询任务
func (app *App) TaskCustomIdTake(tx *gorm.DB, Type, customId string) (result Task) {
tx.Where("type = ?", Type).Where("custom_id = ?", customId).Take(&result)
return result
}
// TaskCustomIdTakeStatus 查询任务
func (app *App) TaskCustomIdTakeStatus(tx *gorm.DB, Type, customId, status string) (result Task) {
tx.Where("type = ?", Type).Where("custom_id = ?", customId).Where("status = ?", status).Take(&result)
return result
}
// TaskFind 查询任务
func (app *App) TaskFind(tx *gorm.DB, frequency int64) (results []Task) {
tx.Table("task").Select("task.*").Where("task.frequency = ?", frequency).Where("task.status = ?", TASK_IN).Where("task_ip.ips = ?", app.OutsideIp).Order("task.id asc").Joins("left join task_ip on task_ip.task_type = task.type").Find(&results)
return app.taskFindCheck(results)
}
// TaskFindAll 查询任务
func (app *App) TaskFindAll(tx *gorm.DB, frequency int64) (results []Task) {
tx.Where("frequency = ?", frequency).Where("status = ?", TASK_IN).Order("id asc").Find(&results)
return results
}
// 检查任务
func (app *App) taskFindCheck(lists []Task) (results []Task) {
for _, v := range lists {
if v.SpecifyIp == "" {
results = append(results, v)
} else {
if app.OutsideIp == v.SpecifyIp {
results = append(results, v)
}
}
}
return results
}
// TaskLog 任务日志
type TaskLog struct {
Id uint `gorm:"primaryKey" json:"id"` // 记录编号
TaskId uint `json:"task_id"` // 任务编号
StatusCode int `json:"status_code"` // 状态码
Desc string `json:"desc"` // 结果
Version int `json:"version"` // 版本
CreatedAt string `gorm:"type:text" json:"created_at"` // 创建时间
}
func (m *TaskLog) TableName() string {
return "task_log"
}
// TaskLogRun 任务执行日志
type TaskLogRun struct {
Id uint `gorm:"primaryKey" json:"id"` // 记录编号
TaskId uint `json:"task_id"` // 任务编号
RunId string `json:"run_id"` // 执行编号
OutsideIp string `json:"outside_ip"` // 外网ip
InsideIp string `json:"inside_ip"` // 内网ip
Os string `json:"os"` // 系统类型
Arch string `json:"arch"` // 系统架构
Gomaxprocs int `json:"gomaxprocs"` // CPU核数
GoVersion string `json:"go_version"` // GO版本
MacAddrs string `json:"mac_addrs"` // Mac地址
CreatedAt string `gorm:"type:text" json:"created_at"` // 创建时间
}
func (m *TaskLogRun) TableName() string {
return "task_log_run"
}
// TaskLogRunTake 查询任务执行日志
func (app *App) TaskLogRunTake(tx *gorm.DB, taskId uint, runId string) (result TaskLogRun) {
tx.Select("id", "os", "arch", "outside_ip", "created_at").Where("task_id = ?", taskId).Where("run_id = ?", runId).Take(&result)
return result
}
// TaskIp 任务Ip
type TaskIp struct {
Id int64
TaskType string `json:"task_type"` // 任务编号
Ips string `json:"ips"` // 任务IP
}
func (m *TaskIp) TableName() string {
return "task_ip"
}
func (app *App) TaskIpUpdate(tx *gorm.DB, taskType, ips string) *gorm.DB {
var query TaskIp
tx.Where("task_type = ?", taskType).Where("ips = ?", ips).Take(&query)
if query.Id != 0 {
return tx
}
updateStatus := tx.Create(&TaskIp{
TaskType: taskType,
Ips: ips,
})
if updateStatus.RowsAffected == 0 {
log.Println("任务更新失败:", updateStatus.Error)
}
return updateStatus
}
// TaskIpInit 实例任务ip
func (app *App) TaskIpInit(tx *gorm.DB, ips map[string]string) bool {
if app.OutsideIp == "" || app.OutsideIp == "0.0.0.0" {
return false
}
tx.Where("ips = ?", app.OutsideIp).Delete(&TaskIp{}) // 删除
for k, v := range ips {
if v == "" {
app.TaskIpUpdate(tx, k, app.OutsideIp)
} else {
find := strings.Contains(v, ",")
if find == true {
// 包含
parts := strings.Split(v, ",")
for _, vv := range parts {
if vv == app.OutsideIp {
app.TaskIpUpdate(tx, k, app.OutsideIp)
}
}
} else {
// 不包含
if v == app.OutsideIp {
app.TaskIpUpdate(tx, k, app.OutsideIp)
}
}
}
}
return true
}

@ -1,29 +0,0 @@
package jobs
var ParamsOrderType = "order"
// ParamsOrderId 订单任务
type ParamsOrderId struct {
OrderId string `json:"order_id,omitempty"`
}
var ParamsMerchantGoldenBeanType = "merchant.golden_bean"
var ParamsNewServiceType = "new_service"
// ParamsTaskId 企业自定义任务
type ParamsTaskId struct {
TaskId int64 `json:"task_id,omitempty"`
}
var ParamsNewServiceNextType = "new_service.next"
// ParamsTaskIdNext 企业自定义下一步任务
type ParamsTaskIdNext struct {
TaskId int64 `json:"task_id,omitempty"`
MerchantUserId int64 `json:"merchant_user_id,omitempty"`
CurrentNumber int `json:"current_number,omitempty"`
MaxNumber int `json:"max_number,omitempty"`
}
var ParamsTeamInvType = "team.inv"

@ -1,25 +0,0 @@
package jobs
func GetTypeApiPaySubmit(Type string) string {
return "api.pay.submit." + Type
}
func GetTypeWechatRefundsSubmit(Type string) string {
return "wechat.refunds.submit." + Type
}
func GetTypeWechatRefundsQuery(Type string) string {
return "wechat.refunds.query." + Type
}
func GetTypeGoldenBeansIssue(Type string) string {
return "golden_beans.issue." + Type
}
func GetTypeGoldenBeansRefunds(Type string) string {
return "golden_beans.refunds." + Type
}
func GetTypeCustomerAuto(Type string) string {
return "customer.auto." + Type
}

@ -1,3 +0,0 @@
package jobs
const Version = "1.0.16"
Loading…
Cancel
Save