Compare commits
No commits in common. "93065cb890223ed859156d2cf85658855e5728b2" and "0436c7ee398917248583b7c22f93a123c0f0acad" have entirely different histories.
93065cb890
...
0436c7ee39
@ -1,44 +0,0 @@
|
|||||||
package filter
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
appconfig "github.com/exhibition-main/internal/config"
|
|
||||||
"reflect"
|
|
||||||
)
|
|
||||||
|
|
||||||
import (
|
|
||||||
"dubbo.apache.org/dubbo-go/v3/common/extension"
|
|
||||||
"dubbo.apache.org/dubbo-go/v3/filter"
|
|
||||||
"dubbo.apache.org/dubbo-go/v3/protocol"
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
extension.SetFilter("fonDomainFilter", NewDomainFonFilter)
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDomainFonFilter() filter.Filter {
|
|
||||||
return &DomainFonFilter{}
|
|
||||||
}
|
|
||||||
|
|
||||||
type DomainFonFilter struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *DomainFonFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
|
|
||||||
if len(invocation.Arguments()) > 0 {
|
|
||||||
req := invocation.Arguments()[0]
|
|
||||||
pp := reflect.ValueOf(req)
|
|
||||||
field := pp.Elem().FieldByName("Domain")
|
|
||||||
|
|
||||||
if field.IsValid() {
|
|
||||||
if field.IsZero() {
|
|
||||||
field.SetString(appconfig.Data.System.Domain)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return invoker.Invoke(ctx, invocation)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *DomainFonFilter) OnResponse(ctx context.Context, result protocol.Result, invoker protocol.Invoker, protocol protocol.Invocation) protocol.Result {
|
|
||||||
return result
|
|
||||||
}
|
|
@ -2,7 +2,6 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/exhibition-main/api/account"
|
"github.com/exhibition-main/api/account"
|
||||||
appconfig "github.com/exhibition-main/internal/config"
|
|
||||||
"github.com/exhibition-main/internal/msg"
|
"github.com/exhibition-main/internal/msg"
|
||||||
"github.com/exhibition-main/internal/response"
|
"github.com/exhibition-main/internal/response"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@ -18,10 +17,10 @@ func OnlySend(c *gin.Context) {
|
|||||||
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
req.Domain = appconfig.Data.System.Domain
|
//req.Domain = appconfig.Data.System.Domain
|
||||||
req.Scope = "exhibition"
|
//req.Scope = "exhibition"
|
||||||
|
|
||||||
res, err := AccountProvider.OnlySendMsg(c, &req)
|
res, err := AccountProvider.SendMsg(c, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
||||||
return
|
return
|
||||||
@ -40,9 +39,9 @@ func OnlyCheck(c *gin.Context) {
|
|||||||
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
//
|
||||||
req.Domain = appconfig.Data.System.Domain
|
//req.Domain = appconfig.Data.System.Domain
|
||||||
req.Scope = "exhibition"
|
//req.Scope = "exhibition"
|
||||||
|
|
||||||
res, err := AccountProvider.OnlyCheckMsg(c, &req)
|
res, err := AccountProvider.OnlyCheckMsg(c, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user