Compare commits
No commits in common. "v1" and "v1.13.0" have entirely different histories.
35
config.go
35
config.go
|
@ -141,39 +141,4 @@ type (
|
||||||
FileName string `json:"fileName,optional"` //文件名称。
|
FileName string `json:"fileName,optional"` //文件名称。
|
||||||
FileType string `json:"fileType,optional"` //文件类型。
|
FileType string `json:"fileType,optional"` //文件类型。
|
||||||
}
|
}
|
||||||
|
|
||||||
FinanceBank struct {
|
|
||||||
Keyword string `json:"keyword"`
|
|
||||||
BankName string `json:"bankName"` // 模糊查询 (bankName,branchName, branchCode, code)
|
|
||||||
Province string `json:"province"`
|
|
||||||
City string `json:"city"`
|
|
||||||
Code string `json:"code"`
|
|
||||||
IsDesc bool `json:"isDesc"` // 是否倒序查询(id)
|
|
||||||
}
|
|
||||||
|
|
||||||
financeBankRequest struct {
|
|
||||||
Keyword string `json:"keyword"`
|
|
||||||
BankName string `json:"bankName"` // 模糊查询 (bankName,branchName, branchCode, code)
|
|
||||||
Province string `json:"province"`
|
|
||||||
City string `json:"city"`
|
|
||||||
Code string `json:"code"`
|
|
||||||
Page uint32 `json:"page"`
|
|
||||||
PageSize uint32 `json:"pageSize"`
|
|
||||||
IsDesc bool `json:"isDesc"` // 是否倒序查询(id)
|
|
||||||
}
|
|
||||||
|
|
||||||
FinanceBankResp struct {
|
|
||||||
Banks []BankItem `json:"banks"`
|
|
||||||
Total uint32 `json:"total"` // 模糊查询 (bankName,branchName, branchCode, code)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
BankItem struct {
|
|
||||||
BranchCode string `json:"branchCode"`
|
|
||||||
Province string `json:"province"`
|
|
||||||
City string `json:"city"`
|
|
||||||
BranchName string `json:"branchName"`
|
|
||||||
Code string `json:"code"`
|
|
||||||
BankName string `json:"bankName"`
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
6
const.go
6
const.go
|
@ -53,9 +53,3 @@ const (
|
||||||
Http RequestWay = iota + 1
|
Http RequestWay = iota + 1
|
||||||
Rpc
|
Rpc
|
||||||
)
|
)
|
||||||
|
|
||||||
const financeUrl = "https://financeouter.22233.cn"
|
|
||||||
|
|
||||||
const (
|
|
||||||
financeBanks = "/outer/v1/dingtalk/payment/banks"
|
|
||||||
)
|
|
||||||
|
|
7
go.mod
7
go.mod
|
@ -1,14 +1,10 @@
|
||||||
module gitea.cdlsxd.cn/self-tools/l_msg_api
|
module gitea.cdlsxd.cn/self-tools/l_msg_api
|
||||||
|
|
||||||
go 1.22.10
|
go 1.22.2
|
||||||
|
|
||||||
toolchain go1.23.6
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gitea.cdlsxd.cn/rzy_tools/request v1.0.0
|
|
||||||
github.com/valyala/fasthttp v1.59.0
|
github.com/valyala/fasthttp v1.59.0
|
||||||
google.golang.org/grpc v1.71.1
|
google.golang.org/grpc v1.71.1
|
||||||
google.golang.org/protobuf v1.36.4
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
@ -16,6 +12,7 @@ require (
|
||||||
golang.org/x/sys v0.30.0 // indirect
|
golang.org/x/sys v0.30.0 // indirect
|
||||||
golang.org/x/text v0.22.0 // indirect
|
golang.org/x/text v0.22.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
|
||||||
|
google.golang.org/protobuf v1.36.4 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
|
@ -7,7 +7,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func FastHttpPost(url string, header map[string]string, body []byte, timeout int) ([]byte, error) {
|
func FastHttpPost(url string, header map[string]string, body []byte, timeout int) ([]byte, error) {
|
||||||
|
|
||||||
req := fasthttp.AcquireRequest()
|
req := fasthttp.AcquireRequest()
|
||||||
defer fasthttp.ReleaseRequest(req) // 用完需要释放资源
|
defer fasthttp.ReleaseRequest(req) // 用完需要释放资源
|
||||||
|
|
||||||
|
|
26
msg.go
26
msg.go
|
@ -4,8 +4,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"gitea.cdlsxd.cn/rzy_tools/request"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type MessageCenter struct {
|
type MessageCenter struct {
|
||||||
|
@ -128,27 +126,3 @@ func (m *MessageCenter) OAComment(ctx context.Context, outTradeNo, text, comment
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// OAComment OA评论,CommentUserId为空则默认审核发起人评论
|
|
||||||
func (m *MessageCenter) FinanceBankList(ctx context.Context, financeBank *FinanceBank, page uint32, pageSize uint32) (data FinanceBankResp, err error) {
|
|
||||||
|
|
||||||
res, err := m.OtherSend(ctx, &request.Request{
|
|
||||||
Method: "GET",
|
|
||||||
Url: fmt.Sprintf("%s%s", financeUrl, financeBanks),
|
|
||||||
Params: mapInterfaceToMapString(structToMap(financeBankRequest{
|
|
||||||
Keyword: financeBank.Keyword,
|
|
||||||
BankName: financeBank.BankName,
|
|
||||||
Province: financeBank.Province,
|
|
||||||
City: financeBank.City,
|
|
||||||
Code: financeBank.Code,
|
|
||||||
Page: page,
|
|
||||||
PageSize: pageSize,
|
|
||||||
IsDesc: financeBank.IsDesc,
|
|
||||||
})),
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
err = json.Unmarshal(res.Content, &data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
90
paramset.go
90
paramset.go
|
@ -4,12 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.cdlsxd.cn/rzy_tools/request"
|
|
||||||
"gitea.cdlsxd.cn/self-tools/l_msg_api/cache"
|
"gitea.cdlsxd.cn/self-tools/l_msg_api/cache"
|
||||||
"gitea.cdlsxd.cn/self-tools/l_msg_api/httpclient"
|
"gitea.cdlsxd.cn/self-tools/l_msg_api/httpclient"
|
||||||
"reflect"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (m *MessageCenter) parseOACreateParam(formModel *FormsData) (out []byte) {
|
func (m *MessageCenter) parseOACreateParam(formModel *FormsData) (out []byte) {
|
||||||
|
@ -42,19 +39,17 @@ func (m *MessageCenter) parseSendBlackBoardParam(title, content string, receiver
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MessageCenter) getAccessToken() (string, error) {
|
func (m *MessageCenter) getAccessToken() (string, error) {
|
||||||
|
if tokenInterface, exist := cache.InstanceCacheMap().Get(m.ClientKey); exist {
|
||||||
|
return tokenInterface.(string), nil
|
||||||
|
}
|
||||||
var data accessTokenResponse
|
var data accessTokenResponse
|
||||||
if tokenInstance, exist := cache.InstanceCacheMap().Get(m.ClientKey); exist {
|
|
||||||
data = tokenInstance.(accessTokenResponse)
|
|
||||||
if int64(data.AccessExpire) >= time.Now().Unix() {
|
|
||||||
return data.AccessToken, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var authParam, _ = json.Marshal(map[string]string{"client_key": m.ClientKey, "client_secret": m.ClientSecret})
|
var authParam, _ = json.Marshal(map[string]string{"client_key": m.ClientKey, "client_secret": m.ClientSecret})
|
||||||
err := m.accessPost(accessToken, authParam, &data)
|
err := m.accessPost(accessToken, authParam, &data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
cache.InstanceCacheMap().Put(m.ClientKey, data)
|
cache.InstanceCacheMap().Put(m.ClientKey, data.AccessToken)
|
||||||
return data.AccessToken, err
|
return data.AccessToken, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +58,7 @@ func (m *MessageCenter) send(ctx context.Context, path requestPathIndex, data []
|
||||||
case Rpc:
|
case Rpc:
|
||||||
//return m.rpc(ctx, requestAddr, data, resReflect)
|
//return m.rpc(ctx, requestAddr, data, resReflect)
|
||||||
default:
|
default:
|
||||||
requestAddr := requestPath[path][Http]
|
requestAddr := requestPath[path][m.option.RequestWay]
|
||||||
return m.post(ctx, requestAddr, data, resReflect)
|
return m.post(ctx, requestAddr, data, resReflect)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -93,22 +88,16 @@ func (m *MessageCenter) post(ctx context.Context, path string, data []byte, resR
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("未知的返回格式:%s", string(dataByte))
|
return fmt.Errorf("未知的返回格式:%s", string(dataByte))
|
||||||
}
|
}
|
||||||
if err = json.Unmarshal(dataByte, resReflect); err != nil {
|
if err = json.Unmarshal(dataByte, &resReflect); err != nil {
|
||||||
return fmt.Errorf("未知的返回格式:%s", string(dataByte))
|
return fmt.Errorf("未知的返回格式:%s", string(dataByte))
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MessageCenter) OtherSend(ctx context.Context, request *request.Request) (res request.Response, err error) {
|
|
||||||
res, err = request.Send()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MessageCenter) accessPost(path requestPathIndex, data []byte, resReflect interface{}) (err error) {
|
func (m *MessageCenter) accessPost(path requestPathIndex, data []byte, resReflect interface{}) (err error) {
|
||||||
pathStr := requestPath[path][Http]
|
|
||||||
var body responseBody
|
var body responseBody
|
||||||
res, err := httpclient.FastHttpPost(fmt.Sprintf("%s%s", m.Host, pathStr), m.header, data, timeOut)
|
res, err := httpclient.FastHttpPost(fmt.Sprintf("%s%s", m.Host, path), m.header, data, timeOut)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -139,66 +128,3 @@ func (m *MessageCenter) setHeader() (err error) {
|
||||||
m.header = map[string]string{"Authorization": token, "content-type": "application/json; charset=utf-8"}
|
m.header = map[string]string{"Authorization": token, "content-type": "application/json; charset=utf-8"}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// StructToMap 将一个struct转换为map[string]interface{}
|
|
||||||
func structToMap(obj interface{}) map[string]interface{} {
|
|
||||||
// 获取obj的类型
|
|
||||||
val := reflect.ValueOf(obj)
|
|
||||||
if val.Kind() == reflect.Ptr {
|
|
||||||
val = val.Elem()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 确保obj是一个struct
|
|
||||||
if val.Kind() != reflect.Struct {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建一个map来保存结果
|
|
||||||
data := make(map[string]interface{})
|
|
||||||
|
|
||||||
// 遍历struct的字段
|
|
||||||
for i := 0; i < val.NumField(); i++ {
|
|
||||||
// 获取字段的类型和值
|
|
||||||
valueField := val.Field(i)
|
|
||||||
typeField := val.Type().Field(i)
|
|
||||||
jsonTag := typeField.Tag.Get("json")
|
|
||||||
if idx := strings.Index(jsonTag, ","); idx != -1 {
|
|
||||||
// 如果有逗号,则取逗号之前的部分
|
|
||||||
jsonTag = jsonTag[:idx]
|
|
||||||
}
|
|
||||||
// 忽略未导出的字段(字段名首字母小写)
|
|
||||||
if !typeField.IsExported() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将字段名和值添加到map中
|
|
||||||
data[jsonTag] = valueField.Interface()
|
|
||||||
}
|
|
||||||
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
|
|
||||||
// MapInterfaceToMapString map[string]interface{} to map[string]string
|
|
||||||
func mapInterfaceToMapString(inputMap map[string]interface{}) map[string]string {
|
|
||||||
var mapString = make(map[string]string)
|
|
||||||
for key, value := range inputMap {
|
|
||||||
mapString[key] = fmt.Sprintf("%v", value)
|
|
||||||
}
|
|
||||||
return mapString
|
|
||||||
}
|
|
||||||
|
|
||||||
// ChunkSlice 将一个切片分割成多个子切片,每个子切片最多包含 maxSize 个元素
|
|
||||||
func ChunkSlice[T any](slice []T, maxSize int) [][]T {
|
|
||||||
var chunks [][]T
|
|
||||||
length := len(slice)
|
|
||||||
|
|
||||||
for i := 0; i < length; i += maxSize {
|
|
||||||
end := i + maxSize
|
|
||||||
if end > length {
|
|
||||||
end = length
|
|
||||||
}
|
|
||||||
chunks = append(chunks, slice[i:end])
|
|
||||||
}
|
|
||||||
|
|
||||||
return chunks
|
|
||||||
}
|
|
||||||
|
|
3473
protoc/msg/msg.pb.go
3473
protoc/msg/msg.pb.go
File diff suppressed because it is too large
Load Diff
|
@ -1,577 +0,0 @@
|
||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
|
||||||
// - protoc v3.6.1
|
|
||||||
// source: msg/msg.proto
|
|
||||||
|
|
||||||
package msg
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.64.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion9
|
|
||||||
|
|
||||||
const (
|
|
||||||
Msg_Oauth_FullMethodName = "/msg.Msg/oauth"
|
|
||||||
Msg_CenterSend_FullMethodName = "/msg.Msg/centerSend"
|
|
||||||
Msg_SmsSend_FullMethodName = "/msg.Msg/smsSend"
|
|
||||||
Msg_DingTalkBlackBoardSend_FullMethodName = "/msg.Msg/dingTalkBlackBoardSend"
|
|
||||||
Msg_WxBizSend_FullMethodName = "/msg.Msg/wxBizSend"
|
|
||||||
Msg_CallInfo_FullMethodName = "/msg.Msg/callInfo"
|
|
||||||
Msg_CallCaptcha_FullMethodName = "/msg.Msg/callCaptcha"
|
|
||||||
Msg_DingOACreate_FullMethodName = "/msg.Msg/dingOACreate"
|
|
||||||
Msg_DingOAUpdate_FullMethodName = "/msg.Msg/dingOAUpdate"
|
|
||||||
Msg_DingOAComment_FullMethodName = "/msg.Msg/dingOAComment"
|
|
||||||
Msg_DingOAGet_FullMethodName = "/msg.Msg/dingOAGet"
|
|
||||||
Msg_FinanceNotify_FullMethodName = "/msg.Msg/FinanceNotify"
|
|
||||||
Msg_HsSmsSend_FullMethodName = "/msg.Msg/hsSmsSend"
|
|
||||||
)
|
|
||||||
|
|
||||||
// MsgClient is the client API for Msg service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type MsgClient interface {
|
|
||||||
Oauth(ctx context.Context, in *OauthReq, opts ...grpc.CallOption) (*OauthResp, error)
|
|
||||||
CenterSend(ctx context.Context, in *CenterSendReq, opts ...grpc.CallOption) (*MsgCenterResp, error)
|
|
||||||
SmsSend(ctx context.Context, in *SmsSendReq, opts ...grpc.CallOption) (*SmsSendRes, error)
|
|
||||||
DingTalkBlackBoardSend(ctx context.Context, in *DingTalkBlackBoardSendReq, opts ...grpc.CallOption) (*BaseRes, error)
|
|
||||||
WxBizSend(ctx context.Context, in *WxBizSendReq, opts ...grpc.CallOption) (*BaseRes, error)
|
|
||||||
CallInfo(ctx context.Context, in *CallInfoReq, opts ...grpc.CallOption) (*BaseRes, error)
|
|
||||||
CallCaptcha(ctx context.Context, in *CallCaptchaReq, opts ...grpc.CallOption) (*BaseRes, error)
|
|
||||||
DingOACreate(ctx context.Context, in *DingOACreateReq, opts ...grpc.CallOption) (*DingOACreateResp, error)
|
|
||||||
DingOAUpdate(ctx context.Context, in *DingOAUpdateReq, opts ...grpc.CallOption) (*DingOAUpdateResp, error)
|
|
||||||
DingOAComment(ctx context.Context, in *DingOACommentReq, opts ...grpc.CallOption) (*DingOACommentResp, error)
|
|
||||||
DingOAGet(ctx context.Context, in *DingOAGetReq, opts ...grpc.CallOption) (*DingOAGetResp, error)
|
|
||||||
FinanceNotify(ctx context.Context, in *PaymentCallbackData, opts ...grpc.CallOption) (*PaymentCallbackRes, error)
|
|
||||||
HsSmsSend(ctx context.Context, in *HsSmsSendReq, opts ...grpc.CallOption) (*HsSmsSendRes, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type msgClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
|
||||||
return &msgClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) Oauth(ctx context.Context, in *OauthReq, opts ...grpc.CallOption) (*OauthResp, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(OauthResp)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_Oauth_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) CenterSend(ctx context.Context, in *CenterSendReq, opts ...grpc.CallOption) (*MsgCenterResp, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(MsgCenterResp)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_CenterSend_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) SmsSend(ctx context.Context, in *SmsSendReq, opts ...grpc.CallOption) (*SmsSendRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(SmsSendRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_SmsSend_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) DingTalkBlackBoardSend(ctx context.Context, in *DingTalkBlackBoardSendReq, opts ...grpc.CallOption) (*BaseRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(BaseRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_DingTalkBlackBoardSend_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) WxBizSend(ctx context.Context, in *WxBizSendReq, opts ...grpc.CallOption) (*BaseRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(BaseRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_WxBizSend_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) CallInfo(ctx context.Context, in *CallInfoReq, opts ...grpc.CallOption) (*BaseRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(BaseRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_CallInfo_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) CallCaptcha(ctx context.Context, in *CallCaptchaReq, opts ...grpc.CallOption) (*BaseRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(BaseRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_CallCaptcha_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) DingOACreate(ctx context.Context, in *DingOACreateReq, opts ...grpc.CallOption) (*DingOACreateResp, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DingOACreateResp)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_DingOACreate_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) DingOAUpdate(ctx context.Context, in *DingOAUpdateReq, opts ...grpc.CallOption) (*DingOAUpdateResp, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DingOAUpdateResp)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_DingOAUpdate_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) DingOAComment(ctx context.Context, in *DingOACommentReq, opts ...grpc.CallOption) (*DingOACommentResp, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DingOACommentResp)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_DingOAComment_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) DingOAGet(ctx context.Context, in *DingOAGetReq, opts ...grpc.CallOption) (*DingOAGetResp, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DingOAGetResp)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_DingOAGet_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) FinanceNotify(ctx context.Context, in *PaymentCallbackData, opts ...grpc.CallOption) (*PaymentCallbackRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(PaymentCallbackRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_FinanceNotify_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *msgClient) HsSmsSend(ctx context.Context, in *HsSmsSendReq, opts ...grpc.CallOption) (*HsSmsSendRes, error) {
|
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(HsSmsSendRes)
|
|
||||||
err := c.cc.Invoke(ctx, Msg_HsSmsSend_FullMethodName, in, out, cOpts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgServer is the server API for Msg service.
|
|
||||||
// All implementations must embed UnimplementedMsgServer
|
|
||||||
// for forward compatibility.
|
|
||||||
type MsgServer interface {
|
|
||||||
Oauth(context.Context, *OauthReq) (*OauthResp, error)
|
|
||||||
CenterSend(context.Context, *CenterSendReq) (*MsgCenterResp, error)
|
|
||||||
SmsSend(context.Context, *SmsSendReq) (*SmsSendRes, error)
|
|
||||||
DingTalkBlackBoardSend(context.Context, *DingTalkBlackBoardSendReq) (*BaseRes, error)
|
|
||||||
WxBizSend(context.Context, *WxBizSendReq) (*BaseRes, error)
|
|
||||||
CallInfo(context.Context, *CallInfoReq) (*BaseRes, error)
|
|
||||||
CallCaptcha(context.Context, *CallCaptchaReq) (*BaseRes, error)
|
|
||||||
DingOACreate(context.Context, *DingOACreateReq) (*DingOACreateResp, error)
|
|
||||||
DingOAUpdate(context.Context, *DingOAUpdateReq) (*DingOAUpdateResp, error)
|
|
||||||
DingOAComment(context.Context, *DingOACommentReq) (*DingOACommentResp, error)
|
|
||||||
DingOAGet(context.Context, *DingOAGetReq) (*DingOAGetResp, error)
|
|
||||||
FinanceNotify(context.Context, *PaymentCallbackData) (*PaymentCallbackRes, error)
|
|
||||||
HsSmsSend(context.Context, *HsSmsSendReq) (*HsSmsSendRes, error)
|
|
||||||
mustEmbedUnimplementedMsgServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedMsgServer must be embedded to have
|
|
||||||
// forward compatible implementations.
|
|
||||||
//
|
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
||||||
// pointer dereference when methods are called.
|
|
||||||
type UnimplementedMsgServer struct{}
|
|
||||||
|
|
||||||
func (UnimplementedMsgServer) Oauth(context.Context, *OauthReq) (*OauthResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Oauth not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) CenterSend(context.Context, *CenterSendReq) (*MsgCenterResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CenterSend not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) SmsSend(context.Context, *SmsSendReq) (*SmsSendRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SmsSend not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) DingTalkBlackBoardSend(context.Context, *DingTalkBlackBoardSendReq) (*BaseRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DingTalkBlackBoardSend not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) WxBizSend(context.Context, *WxBizSendReq) (*BaseRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method WxBizSend not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) CallInfo(context.Context, *CallInfoReq) (*BaseRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CallInfo not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) CallCaptcha(context.Context, *CallCaptchaReq) (*BaseRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CallCaptcha not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) DingOACreate(context.Context, *DingOACreateReq) (*DingOACreateResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DingOACreate not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) DingOAUpdate(context.Context, *DingOAUpdateReq) (*DingOAUpdateResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DingOAUpdate not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) DingOAComment(context.Context, *DingOACommentReq) (*DingOACommentResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DingOAComment not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) DingOAGet(context.Context, *DingOAGetReq) (*DingOAGetResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DingOAGet not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) FinanceNotify(context.Context, *PaymentCallbackData) (*PaymentCallbackRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method FinanceNotify not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) HsSmsSend(context.Context, *HsSmsSendReq) (*HsSmsSendRes, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method HsSmsSend not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
|
||||||
func (UnimplementedMsgServer) testEmbeddedByValue() {}
|
|
||||||
|
|
||||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to MsgServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeMsgServer interface {
|
|
||||||
mustEmbedUnimplementedMsgServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
|
||||||
// If the following call pancis, it indicates UnimplementedMsgServer was
|
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
||||||
t.testEmbeddedByValue()
|
|
||||||
}
|
|
||||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_Oauth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(OauthReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).Oauth(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_Oauth_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).Oauth(ctx, req.(*OauthReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_CenterSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(CenterSendReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).CenterSend(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_CenterSend_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).CenterSend(ctx, req.(*CenterSendReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_SmsSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(SmsSendReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).SmsSend(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_SmsSend_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).SmsSend(ctx, req.(*SmsSendReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_DingTalkBlackBoardSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DingTalkBlackBoardSendReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).DingTalkBlackBoardSend(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_DingTalkBlackBoardSend_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).DingTalkBlackBoardSend(ctx, req.(*DingTalkBlackBoardSendReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_WxBizSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(WxBizSendReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).WxBizSend(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_WxBizSend_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).WxBizSend(ctx, req.(*WxBizSendReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_CallInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(CallInfoReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).CallInfo(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_CallInfo_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).CallInfo(ctx, req.(*CallInfoReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_CallCaptcha_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(CallCaptchaReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).CallCaptcha(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_CallCaptcha_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).CallCaptcha(ctx, req.(*CallCaptchaReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_DingOACreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DingOACreateReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).DingOACreate(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_DingOACreate_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).DingOACreate(ctx, req.(*DingOACreateReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_DingOAUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DingOAUpdateReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).DingOAUpdate(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_DingOAUpdate_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).DingOAUpdate(ctx, req.(*DingOAUpdateReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_DingOAComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DingOACommentReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).DingOAComment(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_DingOAComment_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).DingOAComment(ctx, req.(*DingOACommentReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_DingOAGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DingOAGetReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).DingOAGet(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_DingOAGet_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).DingOAGet(ctx, req.(*DingOAGetReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_FinanceNotify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PaymentCallbackData)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).FinanceNotify(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_FinanceNotify_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).FinanceNotify(ctx, req.(*PaymentCallbackData))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Msg_HsSmsSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(HsSmsSendReq)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(MsgServer).HsSmsSend(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: Msg_HsSmsSend_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(MsgServer).HsSmsSend(ctx, req.(*HsSmsSendReq))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Msg_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "msg.Msg",
|
|
||||||
HandlerType: (*MsgServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "oauth",
|
|
||||||
Handler: _Msg_Oauth_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "centerSend",
|
|
||||||
Handler: _Msg_CenterSend_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "smsSend",
|
|
||||||
Handler: _Msg_SmsSend_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "dingTalkBlackBoardSend",
|
|
||||||
Handler: _Msg_DingTalkBlackBoardSend_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "wxBizSend",
|
|
||||||
Handler: _Msg_WxBizSend_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "callInfo",
|
|
||||||
Handler: _Msg_CallInfo_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "callCaptcha",
|
|
||||||
Handler: _Msg_CallCaptcha_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "dingOACreate",
|
|
||||||
Handler: _Msg_DingOACreate_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "dingOAUpdate",
|
|
||||||
Handler: _Msg_DingOAUpdate_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "dingOAComment",
|
|
||||||
Handler: _Msg_DingOAComment_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "dingOAGet",
|
|
||||||
Handler: _Msg_DingOAGet_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "FinanceNotify",
|
|
||||||
Handler: _Msg_FinanceNotify_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "hsSmsSend",
|
|
||||||
Handler: _Msg_HsSmsSend_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "msg/msg.proto",
|
|
||||||
}
|
|
|
@ -10,27 +10,21 @@ import (
|
||||||
const (
|
const (
|
||||||
ClientKey = "ymt"
|
ClientKey = "ymt"
|
||||||
ClientSecret = "ymt"
|
ClientSecret = "ymt"
|
||||||
serverHost = "http://121.199.38.107:8000"
|
serverHost = "http://120.55.12.245:8200"
|
||||||
local = "http://127.0.0.1:8001"
|
local = "http://127.0.0.1:8001"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSms(t *testing.T) {
|
func TestSms(t *testing.T) {
|
||||||
msg, err := l_msg_api.NewMessageCenter(serverHost, ClientKey, ClientSecret, "sms", "sms")
|
msg, err := l_msg_api.NewMessageCenter(serverHost, ClientKey, ClientSecret, "smssass", "sasssms")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := msg.SendSms(context.TODO(), []string{"15082245107"}, `{"content": "测试"}`)
|
res, err := msg.SendSms([]string{"15082245107"}, `{"content": "测试"}`)
|
||||||
fmt.Println(res, err)
|
fmt.Println(res, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccess(t *testing.T) {
|
|
||||||
msg, _ := l_msg_api.NewMessageCenter(serverHost, ClientKey, ClientSecret, "sms", "sms")
|
|
||||||
msg2, _ := l_msg_api.NewMessageCenter(serverHost, ClientKey, ClientSecret, "sms", "sms")
|
|
||||||
fmt.Println(msg, msg2)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOaCreate(t *testing.T) {
|
func TestOaCreate(t *testing.T) {
|
||||||
msg, err := l_msg_api.NewMessageCenter(local, ClientKey, ClientSecret, "sw_oa", "sw_oa_purchase")
|
msg, err := l_msg_api.NewMessageCenter(local, ClientKey, ClientSecret, "sw_oa", "sw_oa_purchase")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -44,7 +38,7 @@ func TestOaCreate(t *testing.T) {
|
||||||
{Name: "采购总金额", Value: "11.22"},
|
{Name: "采购总金额", Value: "11.22"},
|
||||||
{Name: "预计到货时间", Value: "2025-03-21"},
|
{Name: "预计到货时间", Value: "2025-03-21"},
|
||||||
}
|
}
|
||||||
res, err := msg.OACreate(context.TODO(), "17101201090101570", "cxvxvxcgfgfvxvxv", &l_msg_api.FormsData{
|
res, err := msg.OACreate("17101201090101570", "cxvxvxcgfgfvxvxv", &l_msg_api.FormsData{
|
||||||
FormComponentValues: form,
|
FormComponentValues: form,
|
||||||
Finance: &l_msg_api.Finance{
|
Finance: &l_msg_api.Finance{
|
||||||
Amount: "11.22",
|
Amount: "11.22",
|
||||||
|
@ -74,7 +68,7 @@ func TestOaComment(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
res, err := msg.OAComment(context.TODO(), "P24110515152043136-20250318181554", "sdk测试", "", nil)
|
res, err := msg.OAComment("P24110515152043136-20250318181554", "sdk测试", "", nil)
|
||||||
fmt.Println(res, err)
|
fmt.Println(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,15 +76,3 @@ func TestContext(*testing.T) {
|
||||||
c := context.Background()
|
c := context.Background()
|
||||||
c.Done()
|
c.Done()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFinanceBankList(t *testing.T) {
|
|
||||||
c := context.Background()
|
|
||||||
msg, err := l_msg_api.NewMessageCenter(serverHost, ClientKey, ClientSecret, "sw_oa", "sw_oa_purchase")
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
res, err := msg.FinanceBankList(c, &l_msg_api.FinanceBank{
|
|
||||||
Keyword: "招商",
|
|
||||||
}, 1, 50)
|
|
||||||
t.Log(res, err)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue