12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package test
- import (
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient"
- "context"
- "github.com/zeromicro/go-zero/zrpc"
- "log"
- "testing"
- "time"
- )
- func Test_CommonPhrasesAddOrEdit(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
- TestSystem := knowledgeclient.NewKnowledge(zrpc.MustNewClient(c.TestConf))
- req := &knowledgeclient.CommonPhrasesAddReq{}
- req.AppId = "10000"
- req.EntId = 14929
- req.Content = "排序看一下"
- req.EntUserId = 4315
- //req.Id = 32
- req.Classify = "排序"
- res, err := TestSystem.CommonPhrasesAdd(ctx, req)
- log.Println("res ", res)
- log.Println("err ", err)
- }
- func Test_CommonPhrasesInfo(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
- TestSystem := knowledgeclient.NewKnowledge(zrpc.MustNewClient(c.TestConf))
- req := &knowledgeclient.CommonPhrasesInfoReq{}
- req.Id = 2
- res, err := TestSystem.CommonPhrasesInfo(ctx, req)
- log.Println("res ", res)
- log.Println("err ", err)
- }
- func Test_CommonPhrasesDel(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
- TestSystem := knowledgeclient.NewKnowledge(zrpc.MustNewClient(c.TestConf))
- req := &knowledgeclient.CommonPhrasesInfoReq{}
- req.Id = 32
- res, err := TestSystem.CommonPhrasesDel(ctx, req)
- log.Println("res ", res)
- log.Println("err ", err)
- }
- func Test_CommonPhrasesList(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
- TestSystem := knowledgeclient.NewKnowledge(zrpc.MustNewClient(c.TestConf))
- req := &knowledgeclient.CommonPhrasesListReq{}
- req.PageIndex = 1
- req.EntId = 14929
- req.AppId = "10000"
- req.PageSize = 10
- res, err := TestSystem.CommonPhrasesList(ctx, req)
- log.Println("res ", res)
- log.Println("err ", err)
- }
- func Test_CommonPhrasesQuery(t *testing.T) {
- ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
- TestSystem := knowledgeclient.NewKnowledge(zrpc.MustNewClient(c.TestConf))
- req := &knowledgeclient.CommonPhraseQueryReq{}
- req.EntId = 14929
- req.AppId = "10000"
- req.Query = "test"
- res, err := TestSystem.CommonPhraseQuery(ctx, req)
- log.Println("res ", res)
- log.Println("err ", err)
- }
|