|
@@ -27,6 +27,8 @@ type ChartSaveLibReq struct {
|
|
|
EdbInfoDataList []*AddEdbDataReq
|
|
|
ChartEdbMapping []*data_manage.ChartEdbMapping
|
|
|
EdbInfoCalculateMapping []*data_manage.EdbInfoCalculateMapping
|
|
|
+ CreatorInfo *system.Admin
|
|
|
+ UploaderInfo *system.Admin
|
|
|
}
|
|
|
|
|
|
type ChartSaveLibResp struct {
|
|
@@ -51,7 +53,7 @@ type DeleteChartReq struct {
|
|
|
}
|
|
|
|
|
|
|
|
|
-func UploadChart(chartInfoId int, description string) (err error, errMsg string) {
|
|
|
+func UploadChart(chartInfoId int, description string, uploaderInfo *system.Admin) (err error, errMsg string) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
go alarm_msg.SendAlarmMsg(fmt.Sprintf("上传图表至社区失败:Err:%v,ErrMsg:%s", err, errMsg), 3)
|
|
@@ -100,6 +102,7 @@ func UploadChart(chartInfoId int, description string) (err error, errMsg string)
|
|
|
err = fmt.Errorf("获取指标详情失败,Err:" + err.Error())
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
req := new(ChartSaveLibReq)
|
|
|
req.ChartInfo = chartInfo
|
|
|
req.ChartEdbMapping = chartMappingList
|
|
@@ -108,6 +111,13 @@ func UploadChart(chartInfoId int, description string) (err error, errMsg string)
|
|
|
req.EdbInfoCalculateMapping = edbMappingList
|
|
|
req.Description = description
|
|
|
|
|
|
+
|
|
|
+ creatorInfo, _ := system.GetSysAdminById(chartInfo.SysUserId)
|
|
|
+ if creatorInfo != nil {
|
|
|
+ req.CreatorInfo = creatorInfo
|
|
|
+ }
|
|
|
+
|
|
|
+ req.UploaderInfo = uploaderInfo
|
|
|
|
|
|
reqJson, err := json.Marshal(req)
|
|
|
if err != nil {
|