auth service
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
type DeliverTokenByRPCService struct {
|
||||
ctx context.Context
|
||||
} // NewDeliverTokenByRPCService new DeliverTokenByRPCService
|
||||
func NewDeliverTokenByRPCService(ctx context.Context) *DeliverTokenByRPCService {
|
||||
return &DeliverTokenByRPCService{ctx: ctx}
|
||||
}
|
||||
|
||||
// Run create note info
|
||||
func (s *DeliverTokenByRPCService) Run(req *auth.DeliverTokenReq) (resp *auth.DeliveryResp, err error) {
|
||||
// Finish your business logic.
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
func TestDeliverTokenByRPC_Run(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s := NewDeliverTokenByRPCService(ctx)
|
||||
// init req and assert value
|
||||
|
||||
req := &auth.DeliverTokenReq{}
|
||||
resp, err := s.Run(req)
|
||||
t.Logf("err: %v", err)
|
||||
t.Logf("resp: %v", resp)
|
||||
|
||||
// todo: edit your unit test
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
type VerifyTokenByRPCService struct {
|
||||
ctx context.Context
|
||||
} // NewVerifyTokenByRPCService new VerifyTokenByRPCService
|
||||
func NewVerifyTokenByRPCService(ctx context.Context) *VerifyTokenByRPCService {
|
||||
return &VerifyTokenByRPCService{ctx: ctx}
|
||||
}
|
||||
|
||||
// Run create note info
|
||||
func (s *VerifyTokenByRPCService) Run(req *auth.VerifyTokenReq) (resp *auth.VerifyResp, err error) {
|
||||
// Finish your business logic.
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
auth "github.com/suyiiyii/hertz101/app/auth/kitex_gen/auth"
|
||||
)
|
||||
|
||||
func TestVerifyTokenByRPC_Run(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s := NewVerifyTokenByRPCService(ctx)
|
||||
// init req and assert value
|
||||
|
||||
req := &auth.VerifyTokenReq{}
|
||||
resp, err := s.Run(req)
|
||||
t.Logf("err: %v", err)
|
||||
t.Logf("resp: %v", resp)
|
||||
|
||||
// todo: edit your unit test
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user