master
李光春 2 years ago
parent 8f98d88385
commit f12adde0c0

4
.gitignore vendored

@ -6,6 +6,4 @@
*.log
git.sh
gomod.sh
/test/
/service/*/*_test.go
/utils/*/*_test.go
/*/*_test.go

@ -1,9 +1,9 @@
package dingdanxia
import (
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/golog"
"go.dtapp.net/library/gomongo"
"go.dtapp.net/library/gorequest"
"gorm.io/gorm"
)

@ -2,7 +2,7 @@ package dingdanxia
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -1,14 +1,14 @@
package dingdanxia
import (
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
gomongo2 "go.dtapp.net/library/gomongo"
gorequest "go.dtapp.net/library/gorequest"
"net/http"
)
// 日志
type mongoZap struct {
RequestTime gomongo.BsonTime `json:"request_time" bson:"request_time"` //【请求】时间
RequestTime gomongo2.BsonTime `json:"request_time" bson:"request_time"` //【请求】时间
RequestUri string `json:"request_uri" bson:"request_uri"` //【请求】链接
RequestUrl string `json:"request_url" bson:"request_url"` //【请求】链接
RequestApi string `json:"request_api" bson:"request_api"` //【请求】接口
@ -19,7 +19,7 @@ type mongoZap struct {
ResponseStatusCode int `json:"response_status_code" bson:"response_status_code"` //【返回】状态码
ResponseBody map[string]interface{} `json:"response_body" bson:"response_body"` //【返回】内容
ResponseContentLength int64 `json:"response_content_length" bson:"response_content_length"` //【返回】大小
ResponseTime gomongo.BsonTime `json:"response_time" bson:"response_time"` //【返回】时间
ResponseTime gomongo2.BsonTime `json:"response_time" bson:"response_time"` //【返回】时间
}
func (m *mongoZap) Database() string {
@ -32,17 +32,17 @@ func (m *mongoZap) TableName() string {
func (app *App) mongoLog(request gorequest.Response) {
_, _ = app.mongo.Model(&mongoZap{}).InsertOne(mongoZap{
RequestTime: gomongo.BsonTime(request.RequestTime), //【请求】时间
RequestUri: request.RequestUri, //【请求】链接
RequestUrl: gorequest.UriParse(request.RequestUri).Url, //【请求】链接
RequestApi: gorequest.UriParse(request.RequestUri).Path, //【请求】接口
RequestMethod: request.RequestMethod, //【请求】方式
RequestParams: request.RequestParams, //【请求】参数
RequestHeader: request.RequestHeader, //【请求】头部
ResponseHeader: request.ResponseHeader, //【返回】头部
ResponseStatusCode: request.ResponseStatusCode, //【返回】状态码
ResponseBody: gomongo.JsonDecodeNoError(request.ResponseBody), //【返回】内容
ResponseContentLength: request.ResponseContentLength, //【返回】大小
ResponseTime: gomongo.BsonTime(request.ResponseTime), //【返回】时间
RequestTime: gomongo2.BsonTime(request.RequestTime), //【请求】时间
RequestUri: request.RequestUri, //【请求】链接
RequestUrl: gorequest.UriParse(request.RequestUri).Url, //【请求】链接
RequestApi: gorequest.UriParse(request.RequestUri).Path, //【请求】接口
RequestMethod: request.RequestMethod, //【请求】方式
RequestParams: request.RequestParams, //【请求】参数
RequestHeader: request.RequestHeader, //【请求】头部
ResponseHeader: request.ResponseHeader, //【返回】头部
ResponseStatusCode: request.ResponseStatusCode, //【返回】状态码
ResponseBody: gomongo2.JsonDecodeNoError(request.ResponseBody), //【返回】内容
ResponseContentLength: request.ResponseContentLength, //【返回】大小
ResponseTime: gomongo2.BsonTime(request.ResponseTime), //【返回】时间
})
}

@ -1,9 +1,9 @@
package dingdanxia
import (
"go.dtapp.net/library/utils/gojson"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gojson"
golog "go.dtapp.net/library/golog"
gorequest "go.dtapp.net/library/gorequest"
"gorm.io/datatypes"
)

@ -2,7 +2,7 @@ package dingdanxia
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package dingdanxia
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package dingdanxia
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package dingdanxia
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -1,8 +1,8 @@
package dingtalk
import (
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/golog"
"go.dtapp.net/library/gorequest"
"gorm.io/gorm"
)

@ -1,9 +1,9 @@
package dingtalk
import (
"go.dtapp.net/library/utils/gojson"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gojson"
golog "go.dtapp.net/library/golog"
gorequest "go.dtapp.net/library/gorequest"
"gorm.io/datatypes"
)

@ -3,7 +3,7 @@ package dingtalk
import (
"encoding/json"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
"time"
)

@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"github.com/mvdan/xurls"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
"regexp"
"strings"

@ -2,8 +2,8 @@ package douyin
import (
"errors"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/golog"
"go.dtapp.net/library/gorequest"
"gorm.io/gorm"
"net/http"
"strings"

@ -1,9 +1,9 @@
package douyin
import (
"go.dtapp.net/library/utils/gojson"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gojson"
golog "go.dtapp.net/library/golog"
gorequest "go.dtapp.net/library/gorequest"
"gorm.io/datatypes"
)

@ -2,7 +2,7 @@ package eastiot
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package eastiot
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package eastiot
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package eastiot
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -2,7 +2,7 @@ package eastiot
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -1,9 +1,9 @@
package eastiot
import (
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/golog"
"go.dtapp.net/library/gomongo"
"go.dtapp.net/library/gorequest"
"gorm.io/gorm"
"time"
)

@ -2,7 +2,7 @@ package eastiot
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -1,14 +1,14 @@
package eastiot
import (
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
gomongo2 "go.dtapp.net/library/gomongo"
gorequest "go.dtapp.net/library/gorequest"
"net/http"
)
// 日志
type mongoZap struct {
RequestTime gomongo.BsonTime `json:"request_time" bson:"request_time"` //【请求】时间
RequestTime gomongo2.BsonTime `json:"request_time" bson:"request_time"` //【请求】时间
RequestUri string `json:"request_uri" bson:"request_uri"` //【请求】链接
RequestUrl string `json:"request_url" bson:"request_url"` //【请求】链接
RequestApi string `json:"request_api" bson:"request_api"` //【请求】接口
@ -19,7 +19,7 @@ type mongoZap struct {
ResponseStatusCode int `json:"response_status_code" bson:"response_status_code"` //【返回】状态码
ResponseBody map[string]interface{} `json:"response_body" bson:"response_body"` //【返回】内容
ResponseContentLength int64 `json:"response_content_length" bson:"response_content_length"` //【返回】大小
ResponseTime gomongo.BsonTime `json:"response_time" bson:"response_time"` //【返回】时间
ResponseTime gomongo2.BsonTime `json:"response_time" bson:"response_time"` //【返回】时间
}
func (m *mongoZap) Database() string {
@ -32,17 +32,17 @@ func (m *mongoZap) TableName() string {
func (app *App) mongoLog(request gorequest.Response) {
_, _ = app.mongo.Model(&mongoZap{}).InsertOne(mongoZap{
RequestTime: gomongo.BsonTime(request.RequestTime), //【请求】时间
RequestUri: request.RequestUri, //【请求】链接
RequestUrl: gorequest.UriParse(request.RequestUri).Url, //【请求】链接
RequestApi: gorequest.UriParse(request.RequestUri).Path, //【请求】接口
RequestMethod: request.RequestMethod, //【请求】方式
RequestParams: request.RequestParams, //【请求】参数
RequestHeader: request.RequestHeader, //【请求】头部
ResponseHeader: request.ResponseHeader, //【返回】头部
ResponseStatusCode: request.ResponseStatusCode, //【返回】状态码
ResponseBody: gomongo.JsonDecodeNoError(request.ResponseBody), //【返回】内容
ResponseContentLength: request.ResponseContentLength, //【返回】大小
ResponseTime: gomongo.BsonTime(request.ResponseTime), //【返回】时间
RequestTime: gomongo2.BsonTime(request.RequestTime), //【请求】时间
RequestUri: request.RequestUri, //【请求】链接
RequestUrl: gorequest.UriParse(request.RequestUri).Url, //【请求】链接
RequestApi: gorequest.UriParse(request.RequestUri).Path, //【请求】接口
RequestMethod: request.RequestMethod, //【请求】方式
RequestParams: request.RequestParams, //【请求】参数
RequestHeader: request.RequestHeader, //【请求】头部
ResponseHeader: request.ResponseHeader, //【返回】头部
ResponseStatusCode: request.ResponseStatusCode, //【返回】状态码
ResponseBody: gomongo2.JsonDecodeNoError(request.ResponseBody), //【返回】内容
ResponseContentLength: request.ResponseContentLength, //【返回】大小
ResponseTime: gomongo2.BsonTime(request.ResponseTime), //【返回】时间
})
}

@ -1,9 +1,9 @@
package eastiot
import (
"go.dtapp.net/library/utils/gojson"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gojson"
golog "go.dtapp.net/library/golog"
gorequest "go.dtapp.net/library/gorequest"
"gorm.io/datatypes"
)

@ -3,7 +3,7 @@ package eastiot
import (
"encoding/json"
"fmt"
"go.dtapp.net/library/utils/gomd5"
"go.dtapp.net/library/gomd5"
"sort"
"strconv"
)

@ -2,10 +2,10 @@ package ejiaofei
import (
"fmt"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gomd5"
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/golog"
"go.dtapp.net/library/gomd5"
"go.dtapp.net/library/gomongo"
"go.dtapp.net/library/gorequest"
"gorm.io/gorm"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -1,14 +1,14 @@
package leshuazf
package ejiaofei
import (
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
gomongo2 "go.dtapp.net/library/gomongo"
gorequest "go.dtapp.net/library/gorequest"
"net/http"
)
// 日志
type mongoZap struct {
RequestTime gomongo.BsonTime `json:"request_time" bson:"request_time"` //【请求】时间
RequestTime gomongo2.BsonTime `json:"request_time" bson:"request_time"` //【请求】时间
RequestUri string `json:"request_uri" bson:"request_uri"` //【请求】链接
RequestUrl string `json:"request_url" bson:"request_url"` //【请求】链接
RequestApi string `json:"request_api" bson:"request_api"` //【请求】接口
@ -18,8 +18,9 @@ type mongoZap struct {
ResponseHeader http.Header `json:"response_header" bson:"response_header"` //【返回】头部
ResponseStatusCode int `json:"response_status_code" bson:"response_status_code"` //【返回】状态码
ResponseBody map[string]interface{} `json:"response_body" bson:"response_body"` //【返回】内容
ResponseXml string `json:"response_xml" bson:"response_xml"` //【返回】内容
ResponseContentLength int64 `json:"response_content_length" bson:"response_content_length"` //【返回】大小
ResponseTime gomongo.BsonTime `json:"response_time" bson:"response_time"` //【返回】时间
ResponseTime gomongo2.BsonTime `json:"response_time" bson:"response_time"` //【返回】时间
}
func (m *mongoZap) Database() string {
@ -27,12 +28,12 @@ func (m *mongoZap) Database() string {
}
func (m *mongoZap) TableName() string {
return "leshuazf"
return "ejiaofei"
}
func (app *App) mongoLog(request gorequest.Response) {
_, _ = app.mongo.Model(&mongoZap{}).InsertOne(mongoZap{
RequestTime: gomongo.BsonTime(request.RequestTime), //【请求】时间
RequestTime: gomongo2.BsonTime(request.RequestTime), //【请求】时间
RequestUri: request.RequestUri, //【请求】链接
RequestUrl: gorequest.UriParse(request.RequestUri).Url, //【请求】链接
RequestApi: gorequest.UriParse(request.RequestUri).Path, //【请求】接口
@ -41,8 +42,9 @@ func (app *App) mongoLog(request gorequest.Response) {
RequestHeader: request.RequestHeader, //【请求】头部
ResponseHeader: request.ResponseHeader, //【返回】头部
ResponseStatusCode: request.ResponseStatusCode, //【返回】状态码
ResponseBody: gomongo.JsonDecodeNoError(request.ResponseBody), //【返回】内容
ResponseBody: gomongo2.XmlDecodeNoError(request.ResponseBody), //【返回】内容
ResponseXml: string(request.ResponseBody), //【返回】内容
ResponseContentLength: request.ResponseContentLength, //【返回】大小
ResponseTime: gomongo.BsonTime(request.ResponseTime), //【返回】时间
ResponseTime: gomongo2.BsonTime(request.ResponseTime), //【返回】时间
})
}

@ -1,10 +1,10 @@
package ejiaofei
import (
"go.dtapp.net/library/utils/gojson"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gomongo"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gojson"
golog "go.dtapp.net/library/golog"
"go.dtapp.net/library/gomongo"
gorequest "go.dtapp.net/library/gorequest"
"gorm.io/datatypes"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -3,7 +3,7 @@ package ejiaofei
import (
"encoding/xml"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net/http"
)

@ -1,8 +1,8 @@
package feishu
import (
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/golog"
"go.dtapp.net/library/gorequest"
"gorm.io/gorm"
)

@ -1,9 +1,9 @@
package feishu
import (
"go.dtapp.net/library/utils/gojson"
"go.dtapp.net/library/utils/golog"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gojson"
golog "go.dtapp.net/library/golog"
gorequest "go.dtapp.net/library/gorequest"
"gorm.io/datatypes"
)

@ -3,7 +3,7 @@ package feishu
import (
"encoding/json"
"fmt"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
)
type WebhookSendResponse struct {

@ -20,16 +20,20 @@ require (
github.com/nilorg/sdk v0.0.0-20210429091026-95b6cdc95c84
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/qiniu/go-sdk/v7 v7.12.1
github.com/robfig/cron/v3 v3.0.1
github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda
github.com/shopspring/decimal v1.3.1
github.com/sirupsen/logrus v1.8.1
github.com/tencentyun/cos-go-sdk-v5 v0.7.35
github.com/upyun/go-sdk/v3 v3.0.2
go.etcd.io/etcd/api/v3 v3.5.4
go.etcd.io/etcd/client/v3 v3.5.4
go.mongodb.org/mongo-driver v1.9.1
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/text v0.3.7
google.golang.org/grpc v1.46.2
google.golang.org/protobuf v1.28.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gorm.io/datatypes v1.0.6
gorm.io/driver/mysql v1.3.3
@ -85,7 +89,6 @@ require (
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
@ -94,8 +97,6 @@ require (
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
google.golang.org/genproto v0.0.0-20220526192754-51939a95c655 // indirect
google.golang.org/grpc v1.46.2 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect

@ -340,6 +340,8 @@ github.com/qiniu/dyn v1.3.0/go.mod h1:E8oERcm8TtwJiZvkQPbcAh0RL8jO1G0VXJMW3FAWdk
github.com/qiniu/go-sdk/v7 v7.12.1 h1:FZG5dhs2MZBV/mHVhmHnsgsQ+j1gSE0RqIoA2WwEDwY=
github.com/qiniu/go-sdk/v7 v7.12.1/go.mod h1:btsaOc8CA3hdVloULfFdDgDc+g4f3TDZEFsDY0BLE+w=
github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=

@ -2,7 +2,7 @@ package gobase64
import (
"encoding/base64"
"go.dtapp.net/library/utils/gophp"
"go.dtapp.net/library/gophp"
)
// Encode base64编码

@ -2,7 +2,7 @@ package godecimal
import (
"fmt"
"go.dtapp.net/library/utils/gostring"
"go.dtapp.net/library/gostring"
"math"
"strconv"
)

@ -1,7 +1,7 @@
package goenv
import (
"go.dtapp.net/library/utils/gostring"
"go.dtapp.net/library/gostring"
"os"
"strings"
)

@ -1,9 +1,9 @@
package goip
import (
"go.dtapp.net/library/utils/goip/ip2region"
v4 "go.dtapp.net/library/utils/goip/v4"
v6 "go.dtapp.net/library/utils/goip/v6"
"go.dtapp.net/library/goip/ip2region"
"go.dtapp.net/library/goip/v4"
"go.dtapp.net/library/goip/v6"
"log"
"strings"
)

@ -2,7 +2,7 @@ package goip
import (
"encoding/json"
"go.dtapp.net/library/utils/gorequest"
"go.dtapp.net/library/gorequest"
"net"
)

@ -3,7 +3,7 @@ package ip2region
import (
_ "embed"
"errors"
"go.dtapp.net/library/utils/gostring"
"go.dtapp.net/library/gostring"
"io/ioutil"
"log"
"os"

@ -4,7 +4,7 @@ import (
_ "embed"
"encoding/binary"
"errors"
"go.dtapp.net/library/utils/gostring"
"go.dtapp.net/library/gostring"
"golang.org/x/text/encoding/simplifiedchinese"
"io/ioutil"
"log"

@ -4,7 +4,7 @@ import (
_ "embed"
"encoding/binary"
"errors"
"go.dtapp.net/library/utils/gostring"
"go.dtapp.net/library/gostring"
"io/ioutil"
"log"
"math/big"

@ -2,7 +2,7 @@ package gojobs
import (
"fmt"
"go.dtapp.net/library/utils/goip"
"go.dtapp.net/library/goip"
)
var ip string

@ -2,7 +2,7 @@ package gojobs
import (
"context"
"go.dtapp.net/library/utils/gojobs/pb"
pb2 "go.dtapp.net/library/gojobs/pb"
"google.golang.org/grpc"
"log"
)
@ -15,7 +15,7 @@ type CronConfig struct {
// Cron 定时任务
type Cron struct {
CronConfig // 配置
Pub pb.PubSubClient // 订阅
Pub pb2.PubSubClient // 订阅
Conn *grpc.ClientConn // 链接信息
}
@ -39,13 +39,13 @@ func NewCron(config *CronConfig) *Cron {
}
// 新建一个客户端
c.Pub = pb.NewPubSubClient(c.Conn)
c.Pub = pb2.NewPubSubClient(c.Conn)
return c
}
// Send 发送
func (c *Cron) Send(in *pb.PublishRequest) (*pb.PublishResponse, error) {
func (c *Cron) Send(in *pb2.PublishRequest) (*pb2.PublishResponse, error) {
log.Printf("[定时任务]{广播开始}编号:%s 类型:%s ip%s\n", in.GetId(), in.GetValue(), in.GetIp())
stream, err := c.Pub.Publish(context.Background(), in)
if err != nil {

@ -4,7 +4,7 @@ import (
"context"
"errors"
"fmt"
"go.dtapp.net/library/utils/goip"
"go.dtapp.net/library/goip"
"go.etcd.io/etcd/client/v3"
"log"
"time"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save