wangshan 3 年之前
父節點
當前提交
c82af16b3e

+ 28 - 0
api/internal/handler/onekeyactionhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"app.yhyue.com/moapp/jyInfo/api/internal/logic"
+	"app.yhyue.com/moapp/jyInfo/api/internal/svc"
+	"app.yhyue.com/moapp/jyInfo/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func oneKeyActionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.MyPublishCommonReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewOneKeyActionLogic(r.Context(), svcCtx)
+		resp, err := l.OneKeyAction(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 5 - 0
api/internal/handler/routes.go

@@ -102,6 +102,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jyinfo/manage/organFrozen",
 				Handler: organFrozenHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jyinfo/manage/oneKeyAction",
+				Handler: oneKeyActionHandler(serverCtx),
+			},
 		},
 	)
 }

+ 2 - 2
api/internal/logic/assprojecctlogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -27,7 +27,7 @@ func NewAssProjecctLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AssPr
 }
 
 func (l *AssProjecctLogic) AssProjecct(req *types.AssProjecctReq) (resp *types.CommonRes, err error) {
-	assProject, err0 := l.svcCtx.Consumer.InfoRelated(l.ctx, &consumer.UserIdReq{
+	assProject, err0 := l.svcCtx.Consumer.InfoRelated(l.ctx, &consumerclient.UserIdReq{
 		UserId:  req.UserId,
 		Match:   req.Match,
 		AppId:   req.AppId,

+ 2 - 2
api/internal/logic/delmypublishlogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -27,7 +27,7 @@ func NewDelMyPublishLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelM
 }
 
 func (l *DelMyPublishLogic) DelMyPublish(req *types.MyPublishCommonReq) (resp *types.CommonRes, err error) {
-	publishDetial, err0 := l.svcCtx.Consumer.InfoChange(l.ctx, &consumer.InfoDetailReq{
+	publishDetial, err0 := l.svcCtx.Consumer.InfoChange(l.ctx, &consumerclient.InfoDetailReq{
 		UserId:  req.UserId,
 		MsgId:   req.MsgId,
 		AppId:   req.AppId,

+ 1 - 1
api/internal/logic/getindustrylogic.go

@@ -3,7 +3,7 @@ package logic
 import (
 	"app.yhyue.com/moapp/jyInfo/api/internal/svc"
 	"app.yhyue.com/moapp/jyInfo/api/internal/types"
-	common2 "app.yhyue.com/moapp/jyInfo/rpc/common/type/common"
+	common2 "app.yhyue.com/moapp/jyInfo/rpc/common/commonclient"
 	"app.yhyue.com/moapp/jybase/common"
 	"context"
 	"fmt"

+ 3 - 3
api/internal/logic/getprovincelogic.go

@@ -1,10 +1,10 @@
 package logic
 
 import (
-	"context"
 	"app.yhyue.com/moapp/jyInfo/api/internal/svc"
 	"app.yhyue.com/moapp/jyInfo/api/internal/types"
-	"app.yhyue.com/moapp/jyInfo/rpc/common/common"
+	"app.yhyue.com/moapp/jyInfo/rpc/common/commonclient"
+	"context"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -24,7 +24,7 @@ func NewGetProvinceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPr
 }
 
 func (l *GetProvinceLogic) GetProvince() (resp *types.CommonRes, err error) {
-	r, err := l.svcCtx.Common.AreaInfo(l.ctx, &common.ProjectReq{
+	r, err := l.svcCtx.Common.AreaInfo(l.ctx, &commonclient.ProjectReq{
 		AppId: "10000",
 	})
 	if err == nil {

+ 2 - 2
api/internal/logic/infodetaillogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/manager/type/manager"
+	"app.yhyue.com/moapp/jyInfo/rpc/manager/managerclient"
 	"context"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -27,7 +27,7 @@ func NewInfoDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoDe
 }
 
 func (l *InfoDetailLogic) InfoDetail(req *types.ReviewCommonReq) (resp *types.CommonRes, err error) {
-	infoDetail, err0 := l.svcCtx.Manager.InfoDetail(l.ctx, &manager.InfoDetailReq{
+	infoDetail, err0 := l.svcCtx.Manager.InfoDetail(l.ctx, &managerclient.InfoDetailReq{
 		MsgId: req.MsgId,
 		Type:  req.Type,
 		AppId: req.AppId,

+ 2 - 2
api/internal/logic/infoexaminelogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/manager/type/manager"
+	"app.yhyue.com/moapp/jyInfo/rpc/manager/managerclient"
 	"context"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -27,7 +27,7 @@ func NewInfoExamineLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoE
 }
 
 func (l *InfoExamineLogic) InfoExamine(req *types.InfoExamineReq) (resp *types.CommonRes, err error) {
-	infoExam, err0 := l.svcCtx.Manager.InfoExamine(l.ctx, &manager.InfoExamineReq{
+	infoExam, err0 := l.svcCtx.Manager.InfoExamine(l.ctx, &managerclient.InfoExamineReq{
 		AppId:        req.AppId,
 		MsgId:        req.MsgId,
 		ReviewStatus: req.ReviewStatus,

+ 2 - 2
api/internal/logic/infofiledellogic.go

@@ -3,7 +3,7 @@ package logic
 import (
 	"app.yhyue.com/moapp/jyInfo/api/internal/svc"
 	"app.yhyue.com/moapp/jyInfo/api/internal/types"
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"app.yhyue.com/moapp/jybase/common"
 	"context"
 	"github.com/zeromicro/go-zero/core/logx"
@@ -24,7 +24,7 @@ func NewInfoFileDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoF
 }
 
 func (l *InfoFileDelLogic) InfoFileDel(req *types.InfoFileDelReq) (resp *types.CommonRes, err error) {
-	res, err0 := l.svcCtx.Consumer.InfoFileDel(l.ctx, &consumer.InfoFileDelReq{
+	res, err0 := l.svcCtx.Consumer.InfoFileDel(l.ctx, &consumerclient.InfoFileDelReq{
 		Fid:   req.FileId,
 		Fname: req.FileName,
 	})

+ 2 - 2
api/internal/logic/infolistlogic.go

@@ -1,8 +1,8 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyInfo/rpc/manager/managerclient"
 	"context"
-	"app.yhyue.com/moapp/jyInfo/rpc/manager/type/manager"
 
 	"app.yhyue.com/moapp/jybase/common"
 
@@ -27,7 +27,7 @@ func NewInfoListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoList
 }
 
 func (l *InfoListLogic) InfoList(req *types.InfoListReq) (resp *types.CommonRes, err error) {
-	infolist, err0 := l.svcCtx.Manager.InfoList(l.ctx, &manager.InfoListReq{
+	infolist, err0 := l.svcCtx.Manager.InfoList(l.ctx, &managerclient.InfoListReq{
 		Phone:          req.Phone,
 		MsgType:        common.Int64All(req.MsgType),
 		PhoneType:      common.Int64All(req.PhoneType),

+ 2 - 2
api/internal/logic/mypublishdetaillogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 	"log"
 
@@ -28,7 +28,7 @@ func NewMyPublishDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *M
 }
 
 func (l *MyPublishDetailLogic) MyPublishDetail(req *types.MyPublishCommonReq) (resp *types.CommonRes, err error) {
-	publishDetial, err0 := l.svcCtx.Consumer.InfoChange(l.ctx, &consumer.InfoDetailReq{
+	publishDetial, err0 := l.svcCtx.Consumer.InfoChange(l.ctx, &consumerclient.InfoDetailReq{
 		UserId:  req.UserId,
 		MsgId:   req.MsgId,
 		Type:    common.Int64All(req.Type),

+ 2 - 2
api/internal/logic/mypublishlistlogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -27,7 +27,7 @@ func NewMyPublishListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MyP
 }
 
 func (l *MyPublishListLogic) MyPublishList(req *types.MyPublishListReq) (resp *types.CommonRes, err error) {
-	pubList, err0 := l.svcCtx.Consumer.MyPublishList(l.ctx, &consumer.MyPublishListReq{
+	pubList, err0 := l.svcCtx.Consumer.MyPublishList(l.ctx, &consumerclient.MyPublishListReq{
 		UserId:       req.UserId,
 		AppId:        req.AppId,
 		Match:        req.Match,

+ 30 - 0
api/internal/logic/onekeyactionlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"app.yhyue.com/moapp/jyInfo/api/internal/svc"
+	"app.yhyue.com/moapp/jyInfo/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type OneKeyActionLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewOneKeyActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OneKeyActionLogic {
+	return &OneKeyActionLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *OneKeyActionLogic) OneKeyAction(req *types.MyPublishCommonReq) (resp *types.CommonRes, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 2 - 2
api/internal/logic/organfrozenlogic.go

@@ -1,8 +1,8 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyInfo/rpc/manager/managerclient"
 	"context"
-	"app.yhyue.com/moapp/jyInfo/rpc/manager/type/manager"
 
 	"app.yhyue.com/moapp/jybase/common"
 
@@ -27,7 +27,7 @@ func NewOrganFrozenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Organ
 }
 
 func (l *OrganFrozenLogic) OrganFrozen(req *types.CommonReq) (resp *types.CommonRes, err error) {
-	organ, err0 := l.svcCtx.Manager.InstitutionsFreeze(l.ctx, &manager.InstitutionsFreezeReq{
+	organ, err0 := l.svcCtx.Manager.InstitutionsFreeze(l.ctx, &managerclient.InstitutionsFreezeReq{
 		AppId: req.AppId,
 		EntId: req.EntId,
 	})

+ 2 - 2
api/internal/logic/pubinfocountlogic.go

@@ -1,8 +1,8 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
 
 	"app.yhyue.com/moapp/jybase/common"
 
@@ -27,7 +27,7 @@ func NewPubInfoCountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PubI
 }
 
 func (l *PubInfoCountLogic) PubInfoCount(req *types.CommonReq) (resp *types.CommonRes, err error) {
-	pubCount, err0 := l.svcCtx.Consumer.InfoByUserId(l.ctx, &consumer.UserIdReq{
+	pubCount, err0 := l.svcCtx.Consumer.InfoByUserId(l.ctx, &consumerclient.UserIdReq{
 		UserId: req.UserId,
 		AppId:  req.AppId,
 		Match:  req.Match,

+ 3 - 3
api/internal/logic/pubinfologic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 	"net/http"
 
@@ -62,11 +62,11 @@ func (l *PubInfoLogic) PubInfo(req *types.PubInfoReq) (resp *types.CommonRes, er
 	//		attach[common.InterfaceToStr(n+1)] = v.Data
 	//	}
 	//}
-	var contact consumer.Contact
+	var contact consumerclient.Contact
 	contact.Person = req.Contact.Person
 	contact.Phone = req.Contact.Phone
 	contact.Overt = req.Contact.Overt
-	pubinfo, err1 := l.svcCtx.Consumer.PublishInfo(l.ctx, &consumer.PublishInfoReq{
+	pubinfo, err1 := l.svcCtx.Consumer.PublishInfo(l.ctx, &consumerclient.PublishInfoReq{
 		UserId:    req.UserId,
 		EntId:     req.EntId,
 		Title:     req.Title,

+ 3 - 3
api/internal/logic/pubsupplyinfologic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 	"net/http"
 
@@ -30,11 +30,11 @@ func NewPubSupplyInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *h
 }
 
 func (l *PubSupplyInfoLogic) PubSupplyInfo(req *types.PubInfoReq) (resp *types.CommonRes, err error) {
-	var contact consumer.Contact
+	var contact consumerclient.Contact
 	contact.Person = req.Contact.Person
 	contact.Phone = req.Contact.Phone
 	contact.Overt = req.Contact.Overt
-	pubinfo, err1 := l.svcCtx.Consumer.PublishInfo(l.ctx, &consumer.PublishInfoReq{
+	pubinfo, err1 := l.svcCtx.Consumer.PublishInfo(l.ctx, &consumerclient.PublishInfoReq{
 		UserId:    req.UserId,
 		EntId:     req.EntId,
 		Title:     req.Title,

+ 2 - 2
api/internal/logic/reviewstatuslogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -27,7 +27,7 @@ func NewReviewStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Revi
 }
 
 func (l *ReviewStatusLogic) ReviewStatus(req *types.ReviewCommonReq) (resp *types.CommonRes, err error) {
-	status, err0 := l.svcCtx.Consumer.StatusQuery(l.ctx, &consumer.StatusReq{
+	status, err0 := l.svcCtx.Consumer.StatusQuery(l.ctx, &consumerclient.StatusReq{
 		MsgId: req.MsgId,
 		Type:  req.Type,
 	})

+ 2 - 2
api/internal/logic/supplyinfodetaillogic.go

@@ -1,8 +1,8 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
 
 	"app.yhyue.com/moapp/jybase/common"
 
@@ -27,7 +27,7 @@ func NewSupplyInfoDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
 }
 
 func (l *SupplyInfoDetailLogic) SupplyInfoDetail(req *types.SupplyInfoDetailReq) (resp *types.CommonRes, err error) {
-	supply, err0 := l.svcCtx.Consumer.SupplyInfoDetail(l.ctx, &consumer.StatusReq{
+	supply, err0 := l.svcCtx.Consumer.SupplyInfoDetail(l.ctx, &consumerclient.StatusReq{
 		MsgId: req.MsgId,
 		Type:  req.MsgType,
 	})

+ 2 - 2
api/internal/logic/supplysearchlogic.go

@@ -1,8 +1,8 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
 
 	"app.yhyue.com/moapp/jybase/common"
 
@@ -27,7 +27,7 @@ func NewSupplySearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Supp
 }
 
 func (l *SupplySearchLogic) SupplySearch(req *types.PubSupplyInfoReq) (resp *types.CommonRes, err error) {
-	supplySearch, err0 := l.svcCtx.Consumer.SupplyInfoSearch(l.ctx, &consumer.SupplyInfoSearchReq{
+	supplySearch, err0 := l.svcCtx.Consumer.SupplyInfoSearch(l.ctx, &consumerclient.SupplyInfoSearchReq{
 		Keywords:   req.Keywords,
 		SearchType: req.SearchType,
 		Province:   req.Province,

+ 2 - 2
api/internal/logic/uploadlogic.go

@@ -1,7 +1,7 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
 	"context"
 	"io/ioutil"
 	"log"
@@ -35,7 +35,7 @@ func (l *UploadLogic) Upload(req *types.UploadReq) (resp *types.CommonRes, err e
 	file, fileheader, _ := l.r.FormFile("file")
 	bt, _ := ioutil.ReadAll(file)
 	t1 := time.Now()
-	upload, err0 := l.svcCtx.Consumer.InfoFileUpload(l.ctx, &consumer.InfoFileUploadReq{
+	upload, err0 := l.svcCtx.Consumer.InfoFileUpload(l.ctx, &consumerclient.InfoFileUploadReq{
 		FileName: fileheader.Filename,
 		File:     bt,
 		FileSize: fileheader.Size,

+ 11 - 11
api/internal/svc/servicecontext.go

@@ -1,25 +1,25 @@
 package svc
 
 import (
-	"github.com/zeromicro/go-zero/zrpc"
 	"app.yhyue.com/moapp/jyInfo/api/internal/config"
-	"app.yhyue.com/moapp/jyInfo/rpc/common/common"
-	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumer"
-	"app.yhyue.com/moapp/jyInfo/rpc/manager/manager"
+	"app.yhyue.com/moapp/jyInfo/rpc/common/commonclient"
+	"app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
+	"app.yhyue.com/moapp/jyInfo/rpc/manager/managerclient"
+	"github.com/zeromicro/go-zero/zrpc"
 )
 
 type ServiceContext struct {
 	Config   config.Config
-	Common   common.Common
-	Manager  manager.Manager
-	Consumer consumer.Consumer
+	Common   commonclient.CommonClient
+	Manager  managerclient.ManagerClient
+	Consumer consumerclient.ConsumerClient
 }
 
 func NewServiceContext(c config.Config) *ServiceContext {
 	return &ServiceContext{
-		Config:  c,
-		Common:  common.NewCommon(zrpc.MustNewClient(c.Common)),
-		Manager: manager.NewManager(zrpc.MustNewClient(c.Manager)),
-		Consumer: consumer.NewConsumer(zrpc.MustNewClient(c.Consumer)),
+		Config:   c,
+		Common:   commonclient.NewCommonClient(zrpc.MustNewClient(c.Common)),
+		Manager:  managerclient.NewManagerClient(zrpc.MustNewClient(c.Manager)),
+		Consumer: consumerclient.NewConsumerClient(zrpc.MustNewClient(c.Consumer)),
 	}
 }

+ 1 - 1
api/internal/types/types.go

@@ -43,7 +43,7 @@ type MyPublishListReq struct {
 type MyPublishCommonReq struct {
 	MsgId   string `json:"msgId"`
 	UserId  string `json:"userId"`
-	Type    int64  `json:"type"`
+	Type    int64  `json:"type"` //处理信息类型:([前端用户:]0:获取发布信息详情(默认);1:删除发布的信息;)(()[管理后台:]1:管理后台一键敏感词过滤;1:管理后台一键发布)
 	MsgType int64  `json:"msgType,optional"`
 	AppId   string `json:"appId"`
 }

+ 1 - 1
api/jyinfo.api

@@ -39,7 +39,7 @@ type (
 	myPublishCommonReq {
 		MsgId   string `json:"msgId"`
 		UserId  string `json:"userId"`
-		Type    int64  `json:"type"`//处理信息类型:([前端用户:]0:获取发布信息详情(默认);1:删除发布的信息;)(()[管理后台:]1:管理后台一键敏感词过滤;1:管理后台一键发布)
+		Type    int64  `json:"type"` //处理信息类型:([前端用户:]0:获取发布信息详情(默认);1:删除发布的信息;)(()[管理后台:]1:管理后台一键敏感词过滤;1:管理后台一键发布)
 		MsgType int64  `json:"msgType,optional"`
 		AppId   string `json:"appId"`
 	}