Переглянути джерело

导出数据,发送邮件通用接口

Jianghan 1 рік тому
батько
коміт
0e21fada2f

+ 4 - 3
api/biService.api

@@ -95,6 +95,7 @@ type (
 		Content string `json:"content"`
 		Mails   string `json:"mails"`
 		Query   string `json:"query"`
+		Stype   string `json:"stype"`
 	}
 )
 
@@ -153,8 +154,8 @@ service biService-api {
 	@handler infoOperate
 	post /biService/infoOperate (OperateReq) returns (biResp)
 
-	@doc "数据导出(通用)"
-	@handler exportDataByDb
-	post /biService/exportDataByDb (ExportByDbReq) returns (biResp)
+	@doc "数据导出(通用),发邮件"
+	@handler sendMail
+	post /biService/sendMail (ExportByDbReq) returns (biResp)
 }
 

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

@@ -62,11 +62,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/biService/drawClue",
 				Handler: DrawClueHandler(serverCtx),
 			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/biService/exportDataByDb",
-				Handler: exportDataByDbHandler(serverCtx),
-			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/biService/getInfoId",
@@ -92,6 +87,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/biService/resEmpower",
 				Handler: ResEmpowerHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/sendMail",
+				Handler: sendMailHandler(serverCtx),
+			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/biService/sqlManage",

+ 3 - 3
api/internal/handler/exportDataByDbHandler.go → api/internal/handler/sendmailhandler.go

@@ -9,7 +9,7 @@ import (
 	"github.com/zeromicro/go-zero/rest/httpx"
 )
 
-func exportDataByDbHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+func sendMailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 	return func(w http.ResponseWriter, r *http.Request) {
 		var req types.ExportByDbReq
 		if err := httpx.Parse(r, &req); err != nil {
@@ -17,8 +17,8 @@ func exportDataByDbHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 			return
 		}
 
-		l := logic.NewExportDataByDbLogic(r.Context(), svcCtx)
-		resp, err := l.ExportDataByDb(&req)
+		l := logic.NewSendMailLogic(r.Context(), svcCtx)
+		resp, err := l.SendMail(&req)
 		if err != nil {
 			httpx.ErrorCtx(r.Context(), w, err)
 		} else {

+ 5 - 5
api/internal/logic/exportDataByDbLogic.go → api/internal/logic/sendmaillogic.go

@@ -10,28 +10,28 @@ import (
 	"github.com/zeromicro/go-zero/core/logx"
 )
 
-type ExportDataByDbLogic struct {
+type SendMailLogic struct {
 	logx.Logger
 	ctx    context.Context
 	svcCtx *svc.ServiceContext
 }
 
-func NewExportDataByDbLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExportDataByDbLogic {
-	return &ExportDataByDbLogic{
+func NewSendMailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendMailLogic {
+	return &SendMailLogic{
 		Logger: logx.WithContext(ctx),
 		ctx:    ctx,
 		svcCtx: svcCtx,
 	}
 }
 
-func (l *ExportDataByDbLogic) ExportDataByDb(req *types.ExportByDbReq) (resp *types.BiResp, err error) {
-	// todo: add your logic here and delete this line
+func (l *SendMailLogic) SendMail(req *types.ExportByDbReq) (resp *types.BiResp, err error) {
 	res, err := l.svcCtx.BiServiceRpc.ExportDataByDb(l.ctx, &biservice.ExportByDbReq{
 		Token:   req.Token,
 		Title:   req.Title,
 		Content: req.Content,
 		Mails:   req.Mails,
 		Query:   req.Query,
+		Stype:   req.Stype,
 	})
 	return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg}, err
 }

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

@@ -37,6 +37,7 @@ type ExportByDbReq struct {
 	Content string `json:"content"`
 	Mails   string `json:"mails"`
 	Query   string `json:"query"`
+	Stype   string `json:"stype"`
 }
 
 type ExportReq struct {

+ 1 - 0
rpc/biService.proto

@@ -147,6 +147,7 @@ message ExportByDbReq {
 	string content = 3;
 	string mails = 4;
 	string query = 5;
+	string stype = 6;
 }
 service BiService {
 	rpc myDataAsset (MyDataAssetReq) returns (MyDataAssetResp); //我的数据资产

+ 1 - 0
rpc/internal/logic/exportdatabydblogic.go

@@ -53,6 +53,7 @@ func (l *ExportDataByDbLogic) ExportDataByDb(in *pb.ExportByDbReq) (*pb.BiReply,
 		Content: in.Content,
 		Mails:   in.Mails,
 		Query:   in.Query,
+		Stype:   in.Stype,
 	}).ExportDataByDb()
 	return &pb.BiReply{
 		ErrorCode: 0,

+ 52 - 42
rpc/pb/biService.pb.go

@@ -1536,6 +1536,7 @@ type ExportByDbReq struct {
 	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
 	Mails   string `protobuf:"bytes,4,opt,name=mails,proto3" json:"mails,omitempty"`
 	Query   string `protobuf:"bytes,5,opt,name=query,proto3" json:"query,omitempty"`
+	Stype   string `protobuf:"bytes,6,opt,name=stype,proto3" json:"stype,omitempty"`
 }
 
 func (x *ExportByDbReq) Reset() {
@@ -1605,6 +1606,13 @@ func (x *ExportByDbReq) GetQuery() string {
 	return ""
 }
 
+func (x *ExportByDbReq) GetStype() string {
+	if x != nil {
+		return x.Stype
+	}
+	return ""
+}
+
 var File_biService_proto protoreflect.FileDescriptor
 
 var file_biService_proto_rawDesc = []byte{
@@ -1778,7 +1786,7 @@ var file_biService_proto_rawDesc = []byte{
 	0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x65,
 	0x77, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x65, 0x77, 0x49, 0x64,
 	0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
-	0x74, 0x79, 0x70, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42,
+	0x74, 0x79, 0x70, 0x65, 0x22, 0x97, 0x01, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42,
 	0x79, 0x44, 0x62, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05,
 	0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74,
@@ -1786,51 +1794,53 @@ var file_biService_proto_rawDesc = []byte{
 	0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05,
 	0x6d, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x61, 0x69,
 	0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x32, 0xb1, 0x05, 0x0a, 0x09, 0x42, 0x69, 0x53,
-	0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x6d, 0x79, 0x44, 0x61, 0x74, 0x61,
-	0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x4d, 0x79, 0x44, 0x61, 0x74, 0x61, 0x41, 0x73,
-	0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x4d, 0x79, 0x44, 0x61, 0x74, 0x61, 0x41,
-	0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x61, 0x64, 0x64, 0x50,
-	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a,
-	0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a,
-	0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x09, 0x67, 0x65, 0x74, 0x49, 0x6e,
-	0x66, 0x6f, 0x49, 0x64, 0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
-	0x74, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x64, 0x72, 0x61, 0x77, 0x43, 0x6c, 0x75, 0x65,
-	0x12, 0x0c, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x43, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f,
+	0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x70,
+	0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x79, 0x70, 0x65, 0x32, 0xb1,
+	0x05, 0x0a, 0x09, 0x42, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x0b,
+	0x6d, 0x79, 0x44, 0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x4d, 0x79,
+	0x44, 0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x4d,
+	0x79, 0x44, 0x61, 0x74, 0x61, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d,
+	0x0a, 0x0a, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x2e, 0x41,
+	0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41,
+	0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a,
+	0x09, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x0e, 0x2e, 0x41, 0x64, 0x64,
+	0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x47, 0x65, 0x74,
+	0x49, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x64, 0x72,
+	0x61, 0x77, 0x43, 0x6c, 0x75, 0x65, 0x12, 0x0c, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x43, 0x6c, 0x75,
+	0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+	0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x08, 0x2e,
+	0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x07, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x35, 0x0a, 0x0e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c,
+	0x75, 0x65, 0x12, 0x12, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43,
+	0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a,
+	0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x65, 0x49,
+	0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0e, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f,
+	0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f,
+	0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x65, 0x41, 0x64,
+	0x64, 0x12, 0x0b, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f,
 	0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x19, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x08, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65,
-	0x71, 0x1a, 0x07, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x0e, 0x64, 0x69,
-	0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x2e, 0x44,
-	0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71,
-	0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x2d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12,
+	0x2f, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x74, 0x12,
 	0x0e, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a,
 	0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x27, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x65, 0x41, 0x64, 0x64, 0x12, 0x0b, 0x2e, 0x43, 0x6c,
-	0x75, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x72,
-	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x0c, 0x63, 0x6c, 0x75,
-	0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x74, 0x12, 0x0e, 0x2e, 0x43, 0x6c, 0x75, 0x65,
-	0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65,
-	0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x75,
-	0x74, 0x6f, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x08, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52,
-	0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52,
-	0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x71, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65,
-	0x12, 0x0d, 0x2e, 0x53, 0x71, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a,
-	0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x06, 0x6d, 0x79, 0x49,
-	0x6e, 0x66, 0x6f, 0x12, 0x0a, 0x2e, 0x4d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a,
-	0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x0d, 0x61, 0x6c, 0x6c,
-	0x49, 0x6e, 0x66, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70,
+	0x12, 0x27, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x08,
+	0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x49,
+	0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x71, 0x6c,
+	0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x12, 0x0d, 0x2e, 0x53, 0x71, 0x6c, 0x4d, 0x61, 0x6e, 0x61,
+	0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
+	0x1e, 0x0a, 0x06, 0x6d, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0a, 0x2e, 0x4d, 0x79, 0x49, 0x6e,
+	0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
+	0x25, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74,
+	0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42,
+	0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x6f,
+	0x6a, 0x65, 0x63, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70,
 	0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79,
-	0x12, 0x28, 0x0a, 0x10, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x78,
-	0x70, 0x6f, 0x72, 0x74, 0x12, 0x0a, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71,
-	0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, 0x0b, 0x69, 0x6e,
-	0x66, 0x6f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x2e, 0x4f, 0x70, 0x65, 0x72,
-	0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79,
-	0x12, 0x2a, 0x0a, 0x0e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79,
-	0x44, 0x62, 0x12, 0x0e, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x62, 0x52,
-	0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x06, 0x5a, 0x04,
-	0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x12, 0x24, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12,
+	0x0b, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42,
+	0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x0e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74,
+	0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x44, 0x62, 0x12, 0x0e, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72,
+	0x74, 0x42, 0x79, 0x44, 0x62, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e, 0x42, 0x69, 0x52, 0x65, 0x70,
+	0x6c, 0x79, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x33,
 }
 
 var (

+ 6 - 1
service/exprot.go

@@ -33,6 +33,7 @@ type ExportByDbReq struct {
 	Content string
 	Mails   string
 	Query   string
+	Stype   string
 }
 
 // 全量项目导出
@@ -258,9 +259,13 @@ func (e *ExportByDbReq) ExportDataByDb() []byte {
 	if len(pathArr) > 0 {
 		pathstr := compressFiles(pathArr, timeStr)
 		state := sendMailA(e.Title, e.Mails, e.Content, pathstr)
+		stype := e.Stype
+		if stype == "" {
+			stype = "public"
+		}
 		BiService.Insert("export_record", map[string]interface{}{
 			"positionId": "0",
-			"type":       "public",
+			"type":       stype,
 			"excelPath":  strings.Join(pathArr, ","),
 			"zipPath":    pathstr,
 			"sendState":  state,