正在显示
25 个修改的文件
包含
508 行增加
和
136 行删除
| @@ -2,6 +2,8 @@ package chart | @@ -2,6 +2,8 @@ package chart | ||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "context" | 4 | "context" |
| 5 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/domain" | ||
| 6 | + "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/pkg/xerr" | ||
| 5 | 7 | ||
| 6 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/svc" | 8 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/svc" |
| 7 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/types" | 9 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/types" |
| @@ -24,7 +26,21 @@ func NewGetChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetChart | @@ -24,7 +26,21 @@ func NewGetChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetChart | ||
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | func (l *GetChartLogic) GetChart(req *types.ChartGetRequest) (resp *types.ChartGetResponse, err error) { | 28 | func (l *GetChartLogic) GetChart(req *types.ChartGetRequest) (resp *types.ChartGetResponse, err error) { |
| 27 | - // todo: add your logic here and delete this line | ||
| 28 | - | 29 | + var ( |
| 30 | + conn = l.svcCtx.DefaultDBConn() | ||
| 31 | + chart *domain.Chart | ||
| 32 | + chartSetting *domain.ChartSetting | ||
| 33 | + ) | ||
| 34 | + chart, err = l.svcCtx.ChartRepository.FindOne(l.ctx, conn, req.Id) | ||
| 35 | + if err != nil { | ||
| 36 | + return nil, xerr.NewErrMsgErr("图表不存在", err) | ||
| 37 | + } | ||
| 38 | + chartSetting, err = l.svcCtx.ChartSettingRepository.FindOne(l.ctx, conn, req.Id) | ||
| 39 | + if err != nil { | ||
| 40 | + return nil, xerr.NewErrMsgErr("图表配置不存在", err) | ||
| 41 | + } | ||
| 42 | + resp = &types.ChartGetResponse{ | ||
| 43 | + Chart: types.NewChartItemWithSetting(chart, chartSetting), | ||
| 44 | + } | ||
| 29 | return | 45 | return |
| 30 | } | 46 | } |
| @@ -30,20 +30,23 @@ func NewSaveChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveCha | @@ -30,20 +30,23 @@ func NewSaveChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveCha | ||
| 30 | 30 | ||
| 31 | func (l *SaveChartLogic) SaveChart(req *types.ChartSaveRequest) (resp *types.ChartSaveResponse, err error) { | 31 | func (l *SaveChartLogic) SaveChart(req *types.ChartSaveRequest) (resp *types.ChartSaveResponse, err error) { |
| 32 | var ( | 32 | var ( |
| 33 | - conn = l.svcCtx.DefaultDBConn() | ||
| 34 | - parentChart *domain.Chart | ||
| 35 | - tenantId = contextdata.GetTenantFromCtx(l.ctx) | 33 | + conn = l.svcCtx.DefaultDBConn() |
| 34 | + parentChart *domain.Chart | ||
| 35 | + chart *domain.Chart | ||
| 36 | + chartSetting *domain.ChartSetting | ||
| 37 | + tenantId = contextdata.GetTenantFromCtx(l.ctx) | ||
| 36 | ) | 38 | ) |
| 37 | if !domain.ChartTypeContain(req.Type) { | 39 | if !domain.ChartTypeContain(req.Type) { |
| 38 | return nil, xerr.NewErrMsgErr("未知类型:"+req.Type, err) | 40 | return nil, xerr.NewErrMsgErr("未知类型:"+req.Type, err) |
| 39 | } | 41 | } |
| 40 | - chart := &domain.Chart{ | ||
| 41 | - Name: req.Name, | ||
| 42 | - Type: req.Type, | ||
| 43 | - Pid: req.Pid, | ||
| 44 | - Sort: 1, | ||
| 45 | - Group: tool.Krand(10, tool.KC_RAND_KIND_UPPER), | ||
| 46 | - TenantId: tenantId, | 42 | + chart = &domain.Chart{ |
| 43 | + Name: req.Name, | ||
| 44 | + Type: req.Type, | ||
| 45 | + Pid: req.Pid, | ||
| 46 | + Sort: 1, | ||
| 47 | + Group: tool.Krand(10, tool.KC_RAND_KIND_UPPER), | ||
| 48 | + TenantId: tenantId, | ||
| 49 | + ChartType: req.ChartType, | ||
| 47 | } | 50 | } |
| 48 | if chart.Name == "" { | 51 | if chart.Name == "" { |
| 49 | chart.Name = chart.RandName() | 52 | chart.Name = chart.RandName() |
| @@ -62,12 +65,27 @@ func (l *SaveChartLogic) SaveChart(req *types.ChartSaveRequest) (resp *types.Cha | @@ -62,12 +65,27 @@ func (l *SaveChartLogic) SaveChart(req *types.ChartSaveRequest) (resp *types.Cha | ||
| 62 | if chart, err = l.svcCtx.ChartRepository.Insert(ctx, conn, chart); err != nil { | 65 | if chart, err = l.svcCtx.ChartRepository.Insert(ctx, conn, chart); err != nil { |
| 63 | return err | 66 | return err |
| 64 | } | 67 | } |
| 68 | + | ||
| 69 | + chartProperty := types.NewProperty(req.ChartProperty) | ||
| 70 | + chartSetting = &domain.ChartSetting{ | ||
| 71 | + ChartId: chart.Id, | ||
| 72 | + DataSourceId: chartProperty.GetFirstDataSourceId(), | ||
| 73 | + DataSourceIds: chartProperty.GetAllDataSourceId(), | ||
| 74 | + ChartType: chart.ChartType, | ||
| 75 | + Title: chartProperty.Title, | ||
| 76 | + TableAbility: chartProperty.TableAbility, | ||
| 77 | + Series: chartProperty.Series, | ||
| 78 | + TenantId: chart.TenantId, | ||
| 79 | + } | ||
| 80 | + if chartSetting, err = l.svcCtx.ChartSettingRepository.Insert(l.ctx, conn, chartSetting); err != nil { | ||
| 81 | + return err | ||
| 82 | + } | ||
| 65 | return nil | 83 | return nil |
| 66 | }, true); err != nil { | 84 | }, true); err != nil { |
| 67 | return nil, xerr.NewErrMsgErr("创建失败", err) | 85 | return nil, xerr.NewErrMsgErr("创建失败", err) |
| 68 | } | 86 | } |
| 69 | resp = &types.ChartSaveResponse{ | 87 | resp = &types.ChartSaveResponse{ |
| 70 | - Chart: types.NewChartItem(chart), | 88 | + Chart: types.NewChartItemWithSetting(chart, chartSetting), |
| 71 | } | 89 | } |
| 72 | return | 90 | return |
| 73 | } | 91 | } |
| @@ -26,7 +26,7 @@ func NewGetTableDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge | @@ -26,7 +26,7 @@ func NewGetTableDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge | ||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | func (l *GetTableDetailLogic) GetTableDetail(req *types.GetTableDetailRequest) (resp interface{}, err error) { | 28 | func (l *GetTableDetailLogic) GetTableDetail(req *types.GetTableDetailRequest) (resp interface{}, err error) { |
| 29 | - response, err := l.svcCtx.ByteMetadataService.TableInfo(l.ctx, &bytelib.TableInfoRequest{TableId: req.TableId}) | 29 | + response, err := l.svcCtx.ByteMetadataService.TableInfo(l.ctx, &bytelib.TableInfoRequest{TableId: req.TableId, Token: req.Token}) |
| 30 | if err != nil { | 30 | if err != nil { |
| 31 | logx.Error(err) | 31 | logx.Error(err) |
| 32 | return resp, xerr.NewErr(err) | 32 | return resp, xerr.NewErr(err) |
| @@ -30,6 +30,7 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM | @@ -30,6 +30,7 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM | ||
| 30 | var batchError errorx.BatchError | 30 | var batchError errorx.BatchError |
| 31 | fx.Parallel(func() { | 31 | fx.Parallel(func() { |
| 32 | list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{ | 32 | list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{ |
| 33 | + Token: req.Token, | ||
| 33 | TableTypes: []string{bytelib.MainTable, bytelib.SubTable, bytelib.SideTable}, | 34 | TableTypes: []string{bytelib.MainTable, bytelib.SubTable, bytelib.SideTable}, |
| 34 | Module: bytelib.ModuleDigitalCenter, | 35 | Module: bytelib.ModuleDigitalCenter, |
| 35 | }) | 36 | }) |
| @@ -39,6 +40,7 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM | @@ -39,6 +40,7 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM | ||
| 39 | result["导入模块"] = newList(list) | 40 | result["导入模块"] = newList(list) |
| 40 | }, func() { | 41 | }, func() { |
| 41 | list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{ | 42 | list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{ |
| 43 | + Token: req.Token, | ||
| 42 | TableTypes: []string{bytelib.SchemaTable}, | 44 | TableTypes: []string{bytelib.SchemaTable}, |
| 43 | Module: bytelib.ModuleQuerySetCenter, | 45 | Module: bytelib.ModuleQuerySetCenter, |
| 44 | }) | 46 | }) |
| @@ -48,6 +50,7 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM | @@ -48,6 +50,7 @@ func (l *SearchTableByModuleLogic) SearchTableByModule(req *types.SearchTableByM | ||
| 48 | result["拆解模块"] = newList(list) | 50 | result["拆解模块"] = newList(list) |
| 49 | }, func() { | 51 | }, func() { |
| 50 | list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{ | 52 | list, err := l.svcCtx.ByteMetadataService.ObjectTableSearch(l.ctx, bytelib.ObjectTableSearchRequest{ |
| 53 | + Token: req.Token, | ||
| 51 | TableTypes: []string{bytelib.CalculateItem, bytelib.CalculateSet}, | 54 | TableTypes: []string{bytelib.CalculateItem, bytelib.CalculateSet}, |
| 52 | Module: bytelib.ModuleCalculateCenter, | 55 | Module: bytelib.ModuleCalculateCenter, |
| 53 | }) | 56 | }) |
| @@ -27,6 +27,7 @@ func NewSearchTableDataLogic(ctx context.Context, svcCtx *svc.ServiceContext) *S | @@ -27,6 +27,7 @@ func NewSearchTableDataLogic(ctx context.Context, svcCtx *svc.ServiceContext) *S | ||
| 27 | 27 | ||
| 28 | func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest) (resp interface{}, err error) { | 28 | func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest) (resp interface{}, err error) { |
| 29 | tableDataPreviewRequest := &bytelib.TableDataPreviewRequest{ | 29 | tableDataPreviewRequest := &bytelib.TableDataPreviewRequest{ |
| 30 | + Token: req.Token, | ||
| 30 | ObjectType: bytelib.ObjectMetaTable, | 31 | ObjectType: bytelib.ObjectMetaTable, |
| 31 | ObjectId: int64(req.ObjectId), | 32 | ObjectId: int64(req.ObjectId), |
| 32 | Where: newWhere(req.Condition).WithPageSize(req.PageNumber, req.PageSize), | 33 | Where: newWhere(req.Condition).WithPageSize(req.PageNumber, req.PageSize), |
| @@ -27,6 +27,7 @@ func NewSearchTableFieldOptionalValuesLogic(ctx context.Context, svcCtx *svc.Ser | @@ -27,6 +27,7 @@ func NewSearchTableFieldOptionalValuesLogic(ctx context.Context, svcCtx *svc.Ser | ||
| 27 | 27 | ||
| 28 | func (l *SearchTableFieldOptionalValuesLogic) SearchTableFieldOptionalValues(req *types.SearchTableFieldOptionalValuesRequest) (resp *types.SearchTableFieldOptionalValuesResponse, err error) { | 28 | func (l *SearchTableFieldOptionalValuesLogic) SearchTableFieldOptionalValues(req *types.SearchTableFieldOptionalValuesRequest) (resp *types.SearchTableFieldOptionalValuesResponse, err error) { |
| 29 | fieldOptionalValuesRequest := &bytelib.TableFieldOptionalValuesRequest{ | 29 | fieldOptionalValuesRequest := &bytelib.TableFieldOptionalValuesRequest{ |
| 30 | + Token: req.Token, | ||
| 30 | ObjectType: bytelib.ObjectMetaTable, | 31 | ObjectType: bytelib.ObjectMetaTable, |
| 31 | ObjectId: req.ObjectId, | 32 | ObjectId: req.ObjectId, |
| 32 | Field: bytelib.Field{ | 33 | Field: bytelib.Field{ |
| @@ -15,11 +15,12 @@ import ( | @@ -15,11 +15,12 @@ import ( | ||
| 15 | ) | 15 | ) |
| 16 | 16 | ||
| 17 | type ServiceContext struct { | 17 | type ServiceContext struct { |
| 18 | - Config config.Config | ||
| 19 | - DB *gorm.DB | ||
| 20 | - Redis *redis.Redis | ||
| 21 | - RedisCache gzcache.GZCache | ||
| 22 | - ChartRepository domain.ChartRepository | 18 | + Config config.Config |
| 19 | + DB *gorm.DB | ||
| 20 | + Redis *redis.Redis | ||
| 21 | + RedisCache gzcache.GZCache | ||
| 22 | + ChartRepository domain.ChartRepository | ||
| 23 | + ChartSettingRepository domain.ChartSettingRepository | ||
| 23 | 24 | ||
| 24 | ByteMetadataService bytelib.ByteMetadataService | 25 | ByteMetadataService bytelib.ByteMetadataService |
| 25 | } | 26 | } |
| @@ -31,11 +32,12 @@ func NewServiceContext(c config.Config) *ServiceContext { | @@ -31,11 +32,12 @@ func NewServiceContext(c config.Config) *ServiceContext { | ||
| 31 | redis, _ := redis.NewRedis(redis.RedisConf{Host: c.Redis.Host, Pass: c.Redis.Pass, Type: "node"}) | 32 | redis, _ := redis.NewRedis(redis.RedisConf{Host: c.Redis.Host, Pass: c.Redis.Pass, Type: "node"}) |
| 32 | 33 | ||
| 33 | return &ServiceContext{ | 34 | return &ServiceContext{ |
| 34 | - Config: c, | ||
| 35 | - DB: db, | ||
| 36 | - RedisCache: redisCache, | ||
| 37 | - Redis: redis, | ||
| 38 | - ChartRepository: repository.NewChartRepository(cache.NewCachedRepository(mlCache)), | 35 | + Config: c, |
| 36 | + DB: db, | ||
| 37 | + RedisCache: redisCache, | ||
| 38 | + Redis: redis, | ||
| 39 | + ChartRepository: repository.NewChartRepository(cache.NewCachedRepository(mlCache)), | ||
| 40 | + ChartSettingRepository: repository.NewChartSettingRepository(cache.NewCachedRepository(mlCache)), | ||
| 39 | 41 | ||
| 40 | ByteMetadataService: bytelib.ByteMetadataService{ | 42 | ByteMetadataService: bytelib.ByteMetadataService{ |
| 41 | Service: gateway.NewService(c.ByteMetadata.Name, c.ByteMetadata.Host, c.ByteMetadata.Timeout), | 43 | Service: gateway.NewService(c.ByteMetadata.Name, c.ByteMetadata.Host, c.ByteMetadata.Timeout), |
| @@ -8,6 +8,36 @@ import ( | @@ -8,6 +8,36 @@ import ( | ||
| 8 | func NewChartItem(chart *domain.Chart) ChartItem { | 8 | func NewChartItem(chart *domain.Chart) ChartItem { |
| 9 | item := ChartItem{} | 9 | item := ChartItem{} |
| 10 | copier.Copy(&item, chart) | 10 | copier.Copy(&item, chart) |
| 11 | - //item.Charts = make([]ChartItem, 0) | ||
| 12 | return item | 11 | return item |
| 13 | } | 12 | } |
| 13 | + | ||
| 14 | +func NewChartItemWithProperty(chart *domain.Chart, property *ChartProperty) ChartItem { | ||
| 15 | + item := ChartItem{} | ||
| 16 | + copier.Copy(&item, chart) | ||
| 17 | + if property != nil { | ||
| 18 | + item.ChartProperty = property | ||
| 19 | + } | ||
| 20 | + return item | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +func NewChartItemWithSetting(chart *domain.Chart, chartSetting *domain.ChartSetting) ChartItem { | ||
| 24 | + item := ChartItem{} | ||
| 25 | + copier.Copy(&item, chart) | ||
| 26 | + if chartSetting != nil { | ||
| 27 | + property := NewPropertyItem(chartSetting.ChartProperty(chart.Cover)) | ||
| 28 | + item.ChartProperty = &property | ||
| 29 | + } | ||
| 30 | + return item | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +func NewProperty(property ChartProperty) domain.ChartProperty { | ||
| 34 | + chartProperty := domain.ChartProperty{} | ||
| 35 | + copier.Copy(&chartProperty, property) | ||
| 36 | + return chartProperty | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +func NewPropertyItem(property domain.ChartProperty) ChartProperty { | ||
| 40 | + chartProperty := ChartProperty{} | ||
| 41 | + copier.Copy(&chartProperty, property) | ||
| 42 | + return chartProperty | ||
| 43 | +} |
| @@ -10,9 +10,11 @@ type ChartGetResponse struct { | @@ -10,9 +10,11 @@ type ChartGetResponse struct { | ||
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | type ChartSaveRequest struct { | 12 | type ChartSaveRequest struct { |
| 13 | - Pid int64 `json:"pid,optional"` // 父级ID | ||
| 14 | - Type string `json:"type"` // 类型 report:报表 group:分组 chart:图表 | ||
| 15 | - Name string `json:"name,optional"` // 名称 | 13 | + Pid int64 `json:"pid,optional"` // 父级ID |
| 14 | + Type string `json:"type"` // 类型 report:报表 group:分组 chart:图表 | ||
| 15 | + Name string `json:"name,optional"` // 名称 | ||
| 16 | + ChartType string `json:"chartType"` // 图表类型 | ||
| 17 | + ChartProperty ChartProperty `json:"property"` // 图表属性 | ||
| 16 | } | 18 | } |
| 17 | 19 | ||
| 18 | type ChartSaveResponse struct { | 20 | type ChartSaveResponse struct { |
| @@ -27,7 +29,9 @@ type ChartDeleteResponse struct { | @@ -27,7 +29,9 @@ type ChartDeleteResponse struct { | ||
| 27 | } | 29 | } |
| 28 | 30 | ||
| 29 | type ChartUpdateRequest struct { | 31 | type ChartUpdateRequest struct { |
| 30 | - Id int64 `path:"id"` | 32 | + Id int64 `path:"id"` |
| 33 | + ChartType string `json:"chartType"` // 图表类型 | ||
| 34 | + ChartProperty ChartProperty `json:"property"` // 图表属性 | ||
| 31 | } | 35 | } |
| 32 | 36 | ||
| 33 | type ChartUpdateResponse struct { | 37 | type ChartUpdateResponse struct { |
| @@ -61,16 +65,16 @@ type ChartRenameResponse struct { | @@ -61,16 +65,16 @@ type ChartRenameResponse struct { | ||
| 61 | } | 65 | } |
| 62 | 66 | ||
| 63 | type ChartItem struct { | 67 | type ChartItem struct { |
| 64 | - Id int64 `json:"id,optional"` // ID | ||
| 65 | - Pid int64 `json:"pid,optional"` // 父级ID | ||
| 66 | - Type string `json:"type,optional"` // 类型 report:报表 group:分组 chart:图表 | ||
| 67 | - Sort int64 `json:"sort,optional"` // 排序 | ||
| 68 | - Name string `json:"name,optional"` // 名称 | ||
| 69 | - Charts []ChartItem `json:"charts,optional"` | 68 | + Id int64 `json:"id,optional"` // ID |
| 69 | + Pid int64 `json:"pid,optional"` // 父级ID | ||
| 70 | + Type string `json:"type,optional"` // 类型 report:报表 group:分组 chart:图表 | ||
| 71 | + Sort int64 `json:"sort,optional"` // 排序 | ||
| 72 | + Name string `json:"name,optional"` // 名称 | ||
| 73 | + ChartProperty *ChartProperty `json:"property,optional,omitempty"` //属性 | ||
| 70 | } | 74 | } |
| 71 | 75 | ||
| 72 | type ChartComponentSearchRequest struct { | 76 | type ChartComponentSearchRequest struct { |
| 73 | - Name string `json:"name"` | 77 | + Name string `json:"name,optional"` |
| 74 | } | 78 | } |
| 75 | 79 | ||
| 76 | type ChartComponentSearchResponse struct { | 80 | type ChartComponentSearchResponse struct { |
| @@ -85,13 +89,57 @@ type ChartComponentItem struct { | @@ -85,13 +89,57 @@ type ChartComponentItem struct { | ||
| 85 | Desc string `json:"desc,optional"` // 描述 | 89 | Desc string `json:"desc,optional"` // 描述 |
| 86 | } | 90 | } |
| 87 | 91 | ||
| 92 | +type ChartProperty struct { | ||
| 93 | + Title Title `json:"title,optional"` // 标题 | ||
| 94 | + TableAbility TableAbility `json:"table,optional"` // 表筛选功能 | ||
| 95 | + Series []Series `json:"series,optional"` // 系列(数据源) | ||
| 96 | + Cover string `json:"cover,optional"` // 封面 | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +type Title struct { | ||
| 100 | + TitleSwitch bool `json:"titleSwitch,optional"` // 组件标题开关 | ||
| 101 | + IntroduceSwitch bool `json:"introduceSwitch,optional"` // 组件说明开关 | ||
| 102 | + TitleType string `json:"titleType"` // 标题类型 | ||
| 103 | + Heading string `json:"heading,optional"` // 主标题 | ||
| 104 | + SubTitle string `json:"subTitle,optional"` // 副标题 | ||
| 105 | + ExplainType string `json:"explainType,optional,options=[text,file]"` // text file | ||
| 106 | + ExplainTxt string `json:"explainTxt,optional"` // 文字说明 | ||
| 107 | + FileUrl string `json:"fileUrl,optional"` // 组件图片/视频 | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | +type TableAbility struct { | ||
| 111 | + FilterSwitch bool `json:"filterSwitch,optional"` // 表筛选功能开关 | ||
| 112 | + DimensionList []Dimension `json:"dimensionList,optional"` // 维度列表 | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | +type Series struct { | ||
| 116 | + Name string `json:"name"` // 名称 (例如 指标1、指标2) | ||
| 117 | + SourceFrom string `json:"from,options=[ByteBank,User]"` // 数据源类型 ByteBank:字库 User:用户自定义 | ||
| 118 | + DataSourceId int64 `json:"dataSourceId,optional,omitempty"` // 数据源ID(from值为ByteBank时有值) | ||
| 119 | + CustomText string `json:"customText,optional,omitempty"` // 自定义数据文本(from值为User时有值) | ||
| 120 | + MatchExpressions []Expression `json:"matchExpressions,omitempty"` // 条件匹配表达式(总体指标) | ||
| 121 | +} | ||
| 122 | + | ||
| 123 | +type Expression struct { | ||
| 124 | + Operator string `json:"operator"` // 操作符号 <,>,==,<>,<=,>= | ||
| 125 | + CompareValue string `json:"compareValue"` // 比较值 | ||
| 126 | + ToValue string `json:"toValue"` // 显示值(转为) | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | +type Dimension struct { | ||
| 130 | + Name string `json:"name"` | ||
| 131 | + Value string `json:"value"` | ||
| 132 | +} | ||
| 133 | + | ||
| 88 | type SearchTableByModuleRequest struct { | 134 | type SearchTableByModuleRequest struct { |
| 135 | + Token string `header:"x-mmm-accesstoken"` | ||
| 89 | } | 136 | } |
| 90 | 137 | ||
| 91 | type SearchTableByModuleResponse struct { | 138 | type SearchTableByModuleResponse struct { |
| 92 | } | 139 | } |
| 93 | 140 | ||
| 94 | type SearchTableFieldOptionalValuesRequest struct { | 141 | type SearchTableFieldOptionalValuesRequest struct { |
| 142 | + Token string `header:"x-mmm-accesstoken"` | ||
| 95 | ObjectId int `json:"objectId"` // 对象ID | 143 | ObjectId int `json:"objectId"` // 对象ID |
| 96 | Field string `json:"field"` // 当前选择的字段 | 144 | Field string `json:"field"` // 当前选择的字段 |
| 97 | SqlName string `json:"sqlName"` // 字段SqlName | 145 | SqlName string `json:"sqlName"` // 字段SqlName |
| @@ -112,13 +160,15 @@ type Condition struct { | @@ -112,13 +160,15 @@ type Condition struct { | ||
| 112 | } | 160 | } |
| 113 | 161 | ||
| 114 | type GetTableDetailRequest struct { | 162 | type GetTableDetailRequest struct { |
| 115 | - TableId int `path:"tableId"` // 表ID | 163 | + Token string `header:"x-mmm-accesstoken"` |
| 164 | + TableId int `path:"tableId"` // 表ID | ||
| 116 | } | 165 | } |
| 117 | 166 | ||
| 118 | type GetTableDetailResponse struct { | 167 | type GetTableDetailResponse struct { |
| 119 | } | 168 | } |
| 120 | 169 | ||
| 121 | type SearchTableDataRequest struct { | 170 | type SearchTableDataRequest struct { |
| 171 | + Token string `header:"x-mmm-accesstoken"` | ||
| 122 | ObjectId int `json:"objectId"` // 对象ID | 172 | ObjectId int `json:"objectId"` // 对象ID |
| 123 | PageNumber int `json:"page,optional"` // 分页数 | 173 | PageNumber int `json:"page,optional"` // 分页数 |
| 124 | PageSize int `json:"size,optional"` // 页码 | 174 | PageSize int `json:"size,optional"` // 页码 |
| @@ -5,17 +5,18 @@ import ( | @@ -5,17 +5,18 @@ import ( | ||
| 5 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/domain" | 5 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/domain" |
| 6 | "gorm.io/gorm" | 6 | "gorm.io/gorm" |
| 7 | "gorm.io/plugin/soft_delete" | 7 | "gorm.io/plugin/soft_delete" |
| 8 | + "time" | ||
| 8 | ) | 9 | ) |
| 9 | 10 | ||
| 10 | type Chart struct { | 11 | type Chart struct { |
| 11 | - Id int64 // ID | ||
| 12 | - Pid int64 `gorm:"index:idx_chart_t_pid_sort"` // 父级ID | ||
| 13 | - Type string // 类型 | ||
| 14 | - Sort int `gorm:"index:idx_chart_t_pid_sort"` // 排序 | ||
| 15 | - Name string // 名称 | ||
| 16 | - Group string `gorm:"index:idx_chart_group"` // 分组 | ||
| 17 | - TenantId int64 `gorm:"index:idx_chart_t_pid_sort"` // 租户ID | ||
| 18 | - | 12 | + Id int64 // ID |
| 13 | + Pid int64 `gorm:"index:idx_chart_t_pid_sort"` // 父级ID | ||
| 14 | + Type string // 类型 | ||
| 15 | + Sort int `gorm:"index:idx_chart_t_pid_sort"` // 排序 | ||
| 16 | + Name string // 名称 | ||
| 17 | + Group string `gorm:"index:idx_chart_group"` // 分组 | ||
| 18 | + | ||
| 19 | + TenantId int64 `gorm:"index:idx_chart_t_pid_sort"` // 租户ID | ||
| 19 | CreatedAt int64 `json:",omitempty"` | 20 | CreatedAt int64 `json:",omitempty"` |
| 20 | UpdatedAt int64 `json:",omitempty"` | 21 | UpdatedAt int64 `json:",omitempty"` |
| 21 | DeletedAt int64 `json:",omitempty"` | 22 | DeletedAt int64 `json:",omitempty"` |
| @@ -28,13 +29,13 @@ func (m *Chart) TableName() string { | @@ -28,13 +29,13 @@ func (m *Chart) TableName() string { | ||
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | func (m *Chart) BeforeCreate(tx *gorm.DB) (err error) { | 31 | func (m *Chart) BeforeCreate(tx *gorm.DB) (err error) { |
| 31 | - // m.CreatedAt = time.Now().Unix() | ||
| 32 | - // m.UpdatedAt = time.Now().Unix() | 32 | + m.CreatedAt = time.Now().Unix() |
| 33 | + m.UpdatedAt = time.Now().Unix() | ||
| 33 | return | 34 | return |
| 34 | } | 35 | } |
| 35 | 36 | ||
| 36 | func (m *Chart) BeforeUpdate(tx *gorm.DB) (err error) { | 37 | func (m *Chart) BeforeUpdate(tx *gorm.DB) (err error) { |
| 37 | - // m.UpdatedAt = time.Now().Unix() | 38 | + m.UpdatedAt = time.Now().Unix() |
| 38 | return | 39 | return |
| 39 | } | 40 | } |
| 40 | 41 |
| @@ -4,19 +4,26 @@ import ( | @@ -4,19 +4,26 @@ import ( | ||
| 4 | "fmt" | 4 | "fmt" |
| 5 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/domain" | 5 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/interanl/pkg/domain" |
| 6 | "gorm.io/gorm" | 6 | "gorm.io/gorm" |
| 7 | + "gorm.io/plugin/soft_delete" | ||
| 8 | + "time" | ||
| 7 | ) | 9 | ) |
| 8 | 10 | ||
| 9 | type ChartSetting struct { | 11 | type ChartSetting struct { |
| 10 | - Id int64 // ID | ||
| 11 | - ChartId int64 // 图表ID | ||
| 12 | - Property string // 属性 | ||
| 13 | - Style string // 样式 | ||
| 14 | - Series string // 系列值-数据绑定 | ||
| 15 | - | ||
| 16 | - CreatedAt int64 `json:",omitempty"` | ||
| 17 | - UpdatedAt int64 `json:",omitempty"` | ||
| 18 | - DeletedAt int64 `json:",omitempty"` | ||
| 19 | - Version int `json:",omitempty"` | 12 | + Id int64 // ID |
| 13 | + ChartId int64 `gorm:"uniqueIndex:idx_chart_setting_chart_id"` // 图表ID | ||
| 14 | + DataSourceId int64 // (冗余)数据源ID,多个数据源取第一个源 | ||
| 15 | + DataSourceIds []int64 `gorm:"serializer:json"` | ||
| 16 | + ChartType string // (冗余)图表类型 (记录型表格:RecordTable-1 总体指标:MetricsCard-1 容器卡片:ContainerCard-1 四分图:QuarterChart-1) | ||
| 17 | + Title domain.Title `gorm:"serializer:json"` | ||
| 18 | + TableAbility domain.TableAbility `gorm:"serializer:json"` // 表格能力 | ||
| 19 | + Series []domain.Series `gorm:"serializer:json"` // 系列值-数据绑定 | ||
| 20 | + | ||
| 21 | + TenantId int64 `gorm:"index:idx_chart_setting_t_id"` // 租户ID | ||
| 22 | + CreatedAt int64 `json:",omitempty"` | ||
| 23 | + UpdatedAt int64 `json:",omitempty"` | ||
| 24 | + DeletedAt int64 `json:",omitempty"` | ||
| 25 | + Version int `json:",omitempty"` | ||
| 26 | + IsDel soft_delete.DeletedAt `gorm:"softDelete:flag,DeletedAtField:DeletedAt"` | ||
| 20 | } | 27 | } |
| 21 | 28 | ||
| 22 | func (m *ChartSetting) TableName() string { | 29 | func (m *ChartSetting) TableName() string { |
| @@ -24,21 +31,21 @@ func (m *ChartSetting) TableName() string { | @@ -24,21 +31,21 @@ func (m *ChartSetting) TableName() string { | ||
| 24 | } | 31 | } |
| 25 | 32 | ||
| 26 | func (m *ChartSetting) BeforeCreate(tx *gorm.DB) (err error) { | 33 | func (m *ChartSetting) BeforeCreate(tx *gorm.DB) (err error) { |
| 27 | - // m.CreatedAt = time.Now().Unix() | ||
| 28 | - // m.UpdatedAt = time.Now().Unix() | 34 | + m.CreatedAt = time.Now().Unix() |
| 35 | + m.UpdatedAt = time.Now().Unix() | ||
| 29 | return | 36 | return |
| 30 | } | 37 | } |
| 31 | 38 | ||
| 32 | func (m *ChartSetting) BeforeUpdate(tx *gorm.DB) (err error) { | 39 | func (m *ChartSetting) BeforeUpdate(tx *gorm.DB) (err error) { |
| 33 | - // m.UpdatedAt = time.Now().Unix() | 40 | + m.UpdatedAt = time.Now().Unix() |
| 34 | return | 41 | return |
| 35 | } | 42 | } |
| 36 | 43 | ||
| 37 | func (m *ChartSetting) CacheKeyFunc() string { | 44 | func (m *ChartSetting) CacheKeyFunc() string { |
| 38 | - if m.Id == 0 { | 45 | + if m.ChartId == 0 { |
| 39 | return "" | 46 | return "" |
| 40 | } | 47 | } |
| 41 | - return fmt.Sprintf("%v:cache:%v:id:%v", domain.ProjectName, m.TableName(), m.Id) | 48 | + return fmt.Sprintf("%v:cache:%v:id:%v", domain.ProjectName, m.TableName(), m.ChartId) |
| 42 | } | 49 | } |
| 43 | 50 | ||
| 44 | func (m *ChartSetting) CacheKeyFuncByObject(obj interface{}) string { | 51 | func (m *ChartSetting) CacheKeyFuncByObject(obj interface{}) string { |
| @@ -97,7 +97,7 @@ func (repository *ChartSettingRepository) FindOne(ctx context.Context, conn tran | @@ -97,7 +97,7 @@ func (repository *ChartSettingRepository) FindOne(ctx context.Context, conn tran | ||
| 97 | m = new(models.ChartSetting) | 97 | m = new(models.ChartSetting) |
| 98 | ) | 98 | ) |
| 99 | queryFunc := func() (interface{}, error) { | 99 | queryFunc := func() (interface{}, error) { |
| 100 | - tx = tx.Model(m).Where("id = ?", id).First(m) | 100 | + tx = tx.Model(m).Where("chart_id = ?", id).First(m) |
| 101 | if errors.Is(tx.Error, gorm.ErrRecordNotFound) { | 101 | if errors.Is(tx.Error, gorm.ErrRecordNotFound) { |
| 102 | return nil, domain.ErrNotFound | 102 | return nil, domain.ErrNotFound |
| 103 | } | 103 | } |
| @@ -10,13 +10,15 @@ import ( | @@ -10,13 +10,15 @@ import ( | ||
| 10 | ) | 10 | ) |
| 11 | 11 | ||
| 12 | type Chart struct { | 12 | type Chart struct { |
| 13 | - Id int64 // ID | ||
| 14 | - Pid int64 // 父级ID | ||
| 15 | - Type string // 类型 | ||
| 16 | - Sort int // 排序 | ||
| 17 | - Name string // 名称 | ||
| 18 | - Group string // 分组 | ||
| 19 | - TenantId int64 // 租户ID | 13 | + Id int64 // ID |
| 14 | + Pid int64 // 父级ID | ||
| 15 | + Type string // 类型 | ||
| 16 | + Sort int // 排序 | ||
| 17 | + Name string // 名称 | ||
| 18 | + Group string // 分组 | ||
| 19 | + TenantId int64 // 租户ID | ||
| 20 | + Cover string // 封面 | ||
| 21 | + ChartType string // 图表类型 (记录型表格:RecordTable-1 总体指标:MetricsCard-1 容器卡片:ContainerCard-1 四分图:QuarterChart-1) | ||
| 20 | 22 | ||
| 21 | CreatedAt int64 `json:",omitempty"` | 23 | CreatedAt int64 `json:",omitempty"` |
| 22 | UpdatedAt int64 `json:",omitempty"` | 24 | UpdatedAt int64 `json:",omitempty"` |
| 1 | package domain | 1 | package domain |
| 2 | 2 | ||
| 3 | var ( | 3 | var ( |
| 4 | - RecordTable1 = "RecordTable1" | ||
| 5 | - MetricsCard1 = "MetricsCard1" | ||
| 6 | - ContainerCard1 = "ContainerCard1" | ||
| 7 | - QuarterChart1 = "QuarterChart1" | 4 | + RecordTable1 = "RecordTable" |
| 5 | + MetricsCard1 = "MetricsCard" | ||
| 6 | + ContainerCard1 = "ContainerCard" | ||
| 7 | + QuarterChart1 = "QuarterChart" | ||
| 8 | ) | 8 | ) |
| 9 | 9 | ||
| 10 | type ChartProperty struct { | 10 | type ChartProperty struct { |
| 11 | - Title *Title `json:"title,optional"` // 标题 | ||
| 12 | - FilterRule *FilterRule `json:"filterRule,optional"` // 过滤规则 | ||
| 13 | - Series []*Series `json:"series,optional"` // 系列 | ||
| 14 | - Cover string `json:"cover,optional"` // 封面 | 11 | + Title Title `json:"title,optional"` // 标题 |
| 12 | + TableAbility TableAbility `json:"table,optional"` // 表筛选功能 | ||
| 13 | + Series []Series `json:"series,optional"` // 系列(数据源) | ||
| 14 | + Cover string `json:"cover,optional"` // 封面 | ||
| 15 | 15 | ||
| 16 | //XAxis interface{} `json:"xAxis"` // X轴 | 16 | //XAxis interface{} `json:"xAxis"` // X轴 |
| 17 | //YAxis interface{} `json:"yAxis"` // Y轴 | 17 | //YAxis interface{} `json:"yAxis"` // Y轴 |
| 18 | } | 18 | } |
| 19 | - | ||
| 20 | -type Series struct { | ||
| 21 | - Type string `json:"type"` // 图表类型 (记录型表格:RecordTable1 总体指标:MetricsCard1 容器卡片:ContainerCard1 四分图:QuarterChart1) | ||
| 22 | - Name string `json:"name"` // 名称 | ||
| 23 | - Data interface{} `json:"data"` // 保存配置的时候置空 | ||
| 24 | - Config *DataConfig `json:"config"` // 配置 | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | type Title struct { | 19 | type Title struct { |
| 28 | - MainTitle *TitleInfo `json:"main,optional"` // 主标题 | ||
| 29 | - SubTitle *TitleInfo `json:"sub,optional"` // 副标题 | 20 | + TitleSwitch bool `json:"titleSwitch,optional"` // 组件标题开关 |
| 21 | + IntroduceSwitch bool `json:"introduceSwitch,optional"` // 组件说明开关 | ||
| 22 | + TitleType string `json:"titleType"` // 标题类型 | ||
| 23 | + Heading string `json:"heading,optional"` // 主标题 | ||
| 24 | + SubTitle string `json:"subTitle,optional"` // 副标题 | ||
| 25 | + ExplainType string `json:"explainType,optional,options=[text,file]"` // text file | ||
| 26 | + ExplainTxt string `json:"explainTxt,optional"` // 文字说明 | ||
| 27 | + FileUrl string `json:"fileUrl,optional"` // 组件图片/视频 | ||
| 30 | } | 28 | } |
| 31 | 29 | ||
| 32 | -type TitleInfo struct { | ||
| 33 | - Content string `json:"content,optional"` // 标题内容 | ||
| 34 | - Description *Description `json:"description,optional"` // 描述 | 30 | +type TableAbility struct { |
| 31 | + FilterSwitch bool `json:"filterSwitch,optional"` // 表筛选功能开关 | ||
| 32 | + DimensionList []Dimension `json:"dimensionList,optional"` // 维度列表 | ||
| 35 | } | 33 | } |
| 36 | 34 | ||
| 37 | -type Description struct { | ||
| 38 | - Type string `json:"type"` // text:文字 attachment:附件 | ||
| 39 | - Remark string `json:"remark,optional"` // 备注说明 | ||
| 40 | - Attachment *File `json:"attachment,optional"` // 附件 | ||
| 41 | -} | ||
| 42 | - | ||
| 43 | -type File struct { | ||
| 44 | - FileName string `json:"name"` | ||
| 45 | - Url string `json:"url"` | ||
| 46 | -} | ||
| 47 | - | ||
| 48 | -type FilterRule struct { | ||
| 49 | - FilterItems []*FilterItem `json:"items"` | 35 | +type Series struct { |
| 36 | + // Type string `json:"type"` // 图表类型 (记录型表格:RecordTable-1 总体指标:MetricsCard-1 容器卡片:ContainerCard-1 四分图:QuarterChart-1) | ||
| 37 | + Name string `json:"name"` // 名称 (例如 指标1、指标2) | ||
| 38 | + SourceFrom string `json:"from,options=[ByteBank,User]"` // 数据源类型 ByteBank:字库 User:用户自定义 | ||
| 39 | + DataSourceId int64 `json:"dataSourceId,optional,omitempty"` // 数据源ID(from值为ByteBank时有值) | ||
| 40 | + CustomText string `json:"customText,optional,omitempty"` // 自定义数据文本(from值为User时有值) | ||
| 41 | + MatchExpressions []Expression `json:"matchExpressions,omitempty"` // 条件匹配表达式(总体指标) | ||
| 50 | } | 42 | } |
| 51 | 43 | ||
| 52 | -type FilterItem struct { | ||
| 53 | - FieldItem | 44 | +type Expression struct { |
| 45 | + Operator string `json:"operator,options=[<,>,==,<>,<=,>=]"` // 操作符号 <,>,==,<>,<=,>= | ||
| 46 | + CompareValue string `json:"compareValue"` // 比较值 | ||
| 47 | + ToValue string `json:"toValue"` // 显示值(转为) | ||
| 54 | } | 48 | } |
| 55 | 49 | ||
| 56 | -// FieldItem 字段项 | ||
| 57 | -type FieldItem struct { | ||
| 58 | - Source | ||
| 59 | - Field string `json:"field"` | 50 | +type Dimension struct { |
| 51 | + Name string `json:"name"` | ||
| 52 | + Value string `json:"value"` | ||
| 60 | } | 53 | } |
| 61 | 54 | ||
| 62 | -type Source struct { | ||
| 63 | - From string `json:"from"` // 数据源类型 ByteBank:字库 User:用户自定义 | ||
| 64 | - SourceId int64 `json:"id"` // 数据源ID(from值为ByteBank时有值) | ||
| 65 | - CustomData interface{} `json:"customData"` // 自定义数据(from值为User时有值) | 55 | +func (e ChartProperty) GetFirstDataSourceId() int64 { |
| 56 | + for _, s := range e.Series { | ||
| 57 | + if s.DataSourceId > 0 { | ||
| 58 | + return s.DataSourceId | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + return 0 | ||
| 66 | } | 62 | } |
| 67 | 63 | ||
| 68 | -type DataConfig struct { | ||
| 69 | - Source Source `json:"source"` | 64 | +func (e ChartProperty) GetAllDataSourceId() []int64 { |
| 65 | + var idList = make([]int64, 0) | ||
| 66 | + for _, s := range e.Series { | ||
| 67 | + if s.DataSourceId > 0 { | ||
| 68 | + idList = append(idList, s.DataSourceId) | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + return idList | ||
| 70 | } | 72 | } |
| @@ -6,12 +6,16 @@ import ( | @@ -6,12 +6,16 @@ import ( | ||
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | type ChartSetting struct { | 8 | type ChartSetting struct { |
| 9 | - Id int64 // ID | ||
| 10 | - ChartId int64 // 图表ID | ||
| 11 | - Property string // 属性 | ||
| 12 | - Style string // 样式 | ||
| 13 | - Series string // 系列值-数据绑定 | 9 | + Id int64 // ID |
| 10 | + ChartId int64 // 图表ID | ||
| 11 | + DataSourceId int64 // (冗余)数据源ID,多个数据源取第一个源 | ||
| 12 | + DataSourceIds []int64 | ||
| 13 | + ChartType string // (冗余)图表类型 (记录型表格:RecordTable-1 总体指标:MetricsCard-1 容器卡片:ContainerCard-1 四分图:QuarterChart-1) | ||
| 14 | + Title Title | ||
| 15 | + TableAbility TableAbility // 表格能力 | ||
| 16 | + Series []Series // 系列值-数据绑定 | ||
| 14 | 17 | ||
| 18 | + TenantId int64 // 租户ID | ||
| 15 | CreatedAt int64 `json:",omitempty"` | 19 | CreatedAt int64 `json:",omitempty"` |
| 16 | UpdatedAt int64 `json:",omitempty"` | 20 | UpdatedAt int64 `json:",omitempty"` |
| 17 | DeletedAt int64 `json:",omitempty"` | 21 | DeletedAt int64 `json:",omitempty"` |
| @@ -33,3 +37,12 @@ func (m *ChartSetting) Identify() interface{} { | @@ -33,3 +37,12 @@ func (m *ChartSetting) Identify() interface{} { | ||
| 33 | } | 37 | } |
| 34 | return m.Id | 38 | return m.Id |
| 35 | } | 39 | } |
| 40 | + | ||
| 41 | +func (m *ChartSetting) ChartProperty(cover string) ChartProperty { | ||
| 42 | + return ChartProperty{ | ||
| 43 | + Title: m.Title, | ||
| 44 | + TableAbility: m.TableAbility, | ||
| 45 | + Series: m.Series, | ||
| 46 | + Cover: cover, | ||
| 47 | + } | ||
| 48 | +} |
| @@ -14,6 +14,7 @@ func (gateway *ByteMetadataService) TableDataPreview(ctx context.Context, reques | @@ -14,6 +14,7 @@ func (gateway *ByteMetadataService) TableDataPreview(ctx context.Context, reques | ||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | type TableDataPreviewRequest struct { | 16 | type TableDataPreviewRequest struct { |
| 17 | + Token string `header:"x-mmm-accesstoken"` | ||
| 17 | ObjectId int64 `json:"objectId"` //表ID | 18 | ObjectId int64 `json:"objectId"` //表ID |
| 18 | ObjectType string `json:"objectType"` //表类型 File:文件 MetaTable:元表 DBTable:数据库表 ;当对象类型为DBTable时 objectId 1:表操作日志 2.拆解模块日志 | 19 | ObjectType string `json:"objectType"` //表类型 File:文件 MetaTable:元表 DBTable:数据库表 ;当对象类型为DBTable时 objectId 1:表操作日志 2.拆解模块日志 |
| 19 | Where *TableQueryWhere `json:"where"` //查询条件 | 20 | Where *TableQueryWhere `json:"where"` //查询条件 |
| @@ -14,6 +14,7 @@ func (gateway *ByteMetadataService) TableFieldOptionalValues(ctx context.Context | @@ -14,6 +14,7 @@ func (gateway *ByteMetadataService) TableFieldOptionalValues(ctx context.Context | ||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | type TableFieldOptionalValuesRequest struct { | 16 | type TableFieldOptionalValuesRequest struct { |
| 17 | + Token string `header:"x-mmm-accesstoken"` | ||
| 17 | ObjectType string `json:"objectType" valid:"Required"` // 对象类型 | 18 | ObjectType string `json:"objectType" valid:"Required"` // 对象类型 |
| 18 | ObjectId int `json:"objectId" valid:"Required"` // 对象Id标识 | 19 | ObjectId int `json:"objectId" valid:"Required"` // 对象Id标识 |
| 19 | Field Field `json:"field" valid:"Required"` // 选择列 | 20 | Field Field `json:"field" valid:"Required"` // 选择列 |
| @@ -14,7 +14,8 @@ func (gateway *ByteMetadataService) TableInfo(ctx context.Context, request *Tabl | @@ -14,7 +14,8 @@ func (gateway *ByteMetadataService) TableInfo(ctx context.Context, request *Tabl | ||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | type TableInfoRequest struct { | 16 | type TableInfoRequest struct { |
| 17 | - TableId int `path:"tableId"` | 17 | + Token string `header:"x-mmm-accesstoken"` |
| 18 | + TableId int `path:"tableId"` | ||
| 18 | } | 19 | } |
| 19 | type TableInfoResponse struct { | 20 | type TableInfoResponse struct { |
| 20 | // 表Id | 21 | // 表Id |
| @@ -14,6 +14,7 @@ func (gateway *ByteMetadataService) ObjectTableSearch(ctx context.Context, reque | @@ -14,6 +14,7 @@ func (gateway *ByteMetadataService) ObjectTableSearch(ctx context.Context, reque | ||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | type ObjectTableSearchRequest struct { | 16 | type ObjectTableSearchRequest struct { |
| 17 | + Token string `header:"x-mmm-accesstoken"` | ||
| 17 | // 表名称 | 18 | // 表名称 |
| 18 | Name string `cname:"表名称" json:"name,optional"` | 19 | Name string `cname:"表名称" json:"name,optional"` |
| 19 | //ViewType string `cname:"视图类型 full:完整 main:主表关系" json:"viewType"` | 20 | //ViewType string `cname:"视图类型 full:完整 main:主表关系" json:"viewType"` |
| @@ -488,6 +488,31 @@ | @@ -488,6 +488,31 @@ | ||
| 488 | }, | 488 | }, |
| 489 | "title": "ChartItem" | 489 | "title": "ChartItem" |
| 490 | }, | 490 | }, |
| 491 | + "ChartProperty": { | ||
| 492 | + "type": "object", | ||
| 493 | + "properties": { | ||
| 494 | + "title": { | ||
| 495 | + "$ref": "#/definitions/Title", | ||
| 496 | + "description": " 标题" | ||
| 497 | + }, | ||
| 498 | + "table": { | ||
| 499 | + "$ref": "#/definitions/TableAbility", | ||
| 500 | + "description": " 表筛选功能" | ||
| 501 | + }, | ||
| 502 | + "series": { | ||
| 503 | + "type": "array", | ||
| 504 | + "items": { | ||
| 505 | + "$ref": "#/definitions/Series" | ||
| 506 | + }, | ||
| 507 | + "description": " 系列(数据源)" | ||
| 508 | + }, | ||
| 509 | + "cover": { | ||
| 510 | + "type": "string", | ||
| 511 | + "description": " 封面" | ||
| 512 | + } | ||
| 513 | + }, | ||
| 514 | + "title": "ChartProperty" | ||
| 515 | + }, | ||
| 491 | "ChartRenameRequest": { | 516 | "ChartRenameRequest": { |
| 492 | "type": "object", | 517 | "type": "object", |
| 493 | "properties": { | 518 | "properties": { |
| @@ -525,11 +550,21 @@ | @@ -525,11 +550,21 @@ | ||
| 525 | "name": { | 550 | "name": { |
| 526 | "type": "string", | 551 | "type": "string", |
| 527 | "description": " 名称" | 552 | "description": " 名称" |
| 553 | + }, | ||
| 554 | + "chartType": { | ||
| 555 | + "type": "string", | ||
| 556 | + "description": " 图表类型" | ||
| 557 | + }, | ||
| 558 | + "property": { | ||
| 559 | + "$ref": "#/definitions/ChartProperty", | ||
| 560 | + "description": " 图表属性" | ||
| 528 | } | 561 | } |
| 529 | }, | 562 | }, |
| 530 | "title": "ChartSaveRequest", | 563 | "title": "ChartSaveRequest", |
| 531 | "required": [ | 564 | "required": [ |
| 532 | - "type" | 565 | + "type", |
| 566 | + "chartType", | ||
| 567 | + "property" | ||
| 533 | ] | 568 | ] |
| 534 | }, | 569 | }, |
| 535 | "ChartSaveResponse": { | 570 | "ChartSaveResponse": { |
| @@ -587,11 +622,21 @@ | @@ -587,11 +622,21 @@ | ||
| 587 | "id": { | 622 | "id": { |
| 588 | "type": "integer", | 623 | "type": "integer", |
| 589 | "format": "int64" | 624 | "format": "int64" |
| 625 | + }, | ||
| 626 | + "chartType": { | ||
| 627 | + "type": "string", | ||
| 628 | + "description": " 图表类型" | ||
| 629 | + }, | ||
| 630 | + "property": { | ||
| 631 | + "$ref": "#/definitions/ChartProperty", | ||
| 632 | + "description": " 图表属性" | ||
| 590 | } | 633 | } |
| 591 | }, | 634 | }, |
| 592 | "title": "ChartUpdateRequest", | 635 | "title": "ChartUpdateRequest", |
| 593 | "required": [ | 636 | "required": [ |
| 594 | - "id" | 637 | + "id", |
| 638 | + "chartType", | ||
| 639 | + "property" | ||
| 595 | ] | 640 | ] |
| 596 | }, | 641 | }, |
| 597 | "ChartUpdateResponse": { | 642 | "ChartUpdateResponse": { |
| @@ -660,6 +705,29 @@ | @@ -660,6 +705,29 @@ | ||
| 660 | "order" | 705 | "order" |
| 661 | ] | 706 | ] |
| 662 | }, | 707 | }, |
| 708 | + "Expression": { | ||
| 709 | + "type": "object", | ||
| 710 | + "properties": { | ||
| 711 | + "Operator": { | ||
| 712 | + "type": "string", | ||
| 713 | + "description": " 操作符号 \u003c,\u003e,==,\u003c\u003e,\u003c=,\u003e=" | ||
| 714 | + }, | ||
| 715 | + "compareValue": { | ||
| 716 | + "type": "string", | ||
| 717 | + "description": " 比较值" | ||
| 718 | + }, | ||
| 719 | + "toValue": { | ||
| 720 | + "type": "string", | ||
| 721 | + "description": " 显示值(转为)" | ||
| 722 | + } | ||
| 723 | + }, | ||
| 724 | + "title": "Expression", | ||
| 725 | + "required": [ | ||
| 726 | + "Operator", | ||
| 727 | + "compareValue", | ||
| 728 | + "toValue" | ||
| 729 | + ] | ||
| 730 | + }, | ||
| 663 | "GetTableDetailRequest": { | 731 | "GetTableDetailRequest": { |
| 664 | "type": "object", | 732 | "type": "object", |
| 665 | "properties": { | 733 | "properties": { |
| @@ -694,12 +762,12 @@ | @@ -694,12 +762,12 @@ | ||
| 694 | "format": "int32", | 762 | "format": "int32", |
| 695 | "description": " 对象ID" | 763 | "description": " 对象ID" |
| 696 | }, | 764 | }, |
| 697 | - "pageNumber": { | 765 | + "page": { |
| 698 | "type": "integer", | 766 | "type": "integer", |
| 699 | "format": "int32", | 767 | "format": "int32", |
| 700 | "description": " 分页数" | 768 | "description": " 分页数" |
| 701 | }, | 769 | }, |
| 702 | - "pageSize": { | 770 | + "size": { |
| 703 | "type": "integer", | 771 | "type": "integer", |
| 704 | "format": "int32", | 772 | "format": "int32", |
| 705 | "description": " 页码" | 773 | "description": " 页码" |
| @@ -771,6 +839,103 @@ | @@ -771,6 +839,103 @@ | ||
| 771 | "values", | 839 | "values", |
| 772 | "total" | 840 | "total" |
| 773 | ] | 841 | ] |
| 842 | + }, | ||
| 843 | + "Series": { | ||
| 844 | + "type": "object", | ||
| 845 | + "properties": { | ||
| 846 | + "name": { | ||
| 847 | + "type": "string", | ||
| 848 | + "description": " 名称 (例如 指标1、指标2)" | ||
| 849 | + }, | ||
| 850 | + "from": { | ||
| 851 | + "type": "string", | ||
| 852 | + "description": " 数据源类型 ByteBank:字库 User:用户自定义" | ||
| 853 | + }, | ||
| 854 | + "dataSourceId": { | ||
| 855 | + "type": "integer", | ||
| 856 | + "format": "int64", | ||
| 857 | + "description": " 数据源ID(from值为ByteBank时有值)" | ||
| 858 | + }, | ||
| 859 | + "customText": { | ||
| 860 | + "type": "string", | ||
| 861 | + "description": " 自定义数据文本(from值为User时有值)" | ||
| 862 | + }, | ||
| 863 | + "matchExpressions": { | ||
| 864 | + "type": "array", | ||
| 865 | + "items": { | ||
| 866 | + "$ref": "#/definitions/Expression" | ||
| 867 | + }, | ||
| 868 | + "description": " 条件匹配表达式(总体指标)" | ||
| 869 | + } | ||
| 870 | + }, | ||
| 871 | + "title": "Series", | ||
| 872 | + "required": [ | ||
| 873 | + "name", | ||
| 874 | + "from", | ||
| 875 | + "matchExpressions" | ||
| 876 | + ] | ||
| 877 | + }, | ||
| 878 | + "TableAbility": { | ||
| 879 | + "type": "object", | ||
| 880 | + "properties": { | ||
| 881 | + "filterSwitch": { | ||
| 882 | + "type": "boolean", | ||
| 883 | + "format": "boolean", | ||
| 884 | + "description": " 表筛选功能开关" | ||
| 885 | + }, | ||
| 886 | + "dimensionList": { | ||
| 887 | + "type": "array", | ||
| 888 | + "items": { | ||
| 889 | + "type": "string" | ||
| 890 | + }, | ||
| 891 | + "description": " 维度列表" | ||
| 892 | + } | ||
| 893 | + }, | ||
| 894 | + "title": "TableAbility" | ||
| 895 | + }, | ||
| 896 | + "Title": { | ||
| 897 | + "type": "object", | ||
| 898 | + "properties": { | ||
| 899 | + "titleSwitch": { | ||
| 900 | + "type": "boolean", | ||
| 901 | + "format": "boolean", | ||
| 902 | + "description": " 组件标题开关" | ||
| 903 | + }, | ||
| 904 | + "introduceSwitch": { | ||
| 905 | + "type": "boolean", | ||
| 906 | + "format": "boolean", | ||
| 907 | + "description": " 组件说明开关" | ||
| 908 | + }, | ||
| 909 | + "titleType": { | ||
| 910 | + "type": "string", | ||
| 911 | + "description": " 标题类型" | ||
| 912 | + }, | ||
| 913 | + "heading": { | ||
| 914 | + "type": "string", | ||
| 915 | + "description": " 主标题" | ||
| 916 | + }, | ||
| 917 | + "subTitle": { | ||
| 918 | + "type": "string", | ||
| 919 | + "description": " 副标题" | ||
| 920 | + }, | ||
| 921 | + "explainType": { | ||
| 922 | + "type": "string", | ||
| 923 | + "description": " text file" | ||
| 924 | + }, | ||
| 925 | + "explainTxt": { | ||
| 926 | + "type": "string", | ||
| 927 | + "description": " 文字说明" | ||
| 928 | + }, | ||
| 929 | + "fileUrl": { | ||
| 930 | + "type": "string", | ||
| 931 | + "description": " 组件图片/视频" | ||
| 932 | + } | ||
| 933 | + }, | ||
| 934 | + "title": "Title", | ||
| 935 | + "required": [ | ||
| 936 | + "titleType", | ||
| 937 | + "explainType" | ||
| 938 | + ] | ||
| 774 | } | 939 | } |
| 775 | }, | 940 | }, |
| 776 | "securityDefinitions": { | 941 | "securityDefinitions": { |
| @@ -55,6 +55,8 @@ type ( | @@ -55,6 +55,8 @@ type ( | ||
| 55 | Pid int64 `json:"pid,optional"`// 父级ID | 55 | Pid int64 `json:"pid,optional"`// 父级ID |
| 56 | Type string `json:"type"`// 类型 report:报表 group:分组 chart:图表 | 56 | Type string `json:"type"`// 类型 report:报表 group:分组 chart:图表 |
| 57 | Name string `json:"name,optional"`// 名称 | 57 | Name string `json:"name,optional"`// 名称 |
| 58 | + ChartType string `json:"chartType"` // 图表类型 | ||
| 59 | + ChartProperty ChartProperty `json:"property"` // 图表属性 | ||
| 58 | } | 60 | } |
| 59 | ChartSaveResponse struct{ | 61 | ChartSaveResponse struct{ |
| 60 | Chart ChartItem `json:"chart"` | 62 | Chart ChartItem `json:"chart"` |
| @@ -67,6 +69,8 @@ type ( | @@ -67,6 +69,8 @@ type ( | ||
| 67 | 69 | ||
| 68 | ChartUpdateRequest struct{ | 70 | ChartUpdateRequest struct{ |
| 69 | Id int64 `path:"id"` | 71 | Id int64 `path:"id"` |
| 72 | + ChartType string `json:"chartType"` // 图表类型 | ||
| 73 | + ChartProperty ChartProperty `json:"property"` // 图表属性 | ||
| 70 | } | 74 | } |
| 71 | ChartUpdateResponse struct{} | 75 | ChartUpdateResponse struct{} |
| 72 | 76 | ||
| @@ -95,13 +99,14 @@ type ( | @@ -95,13 +99,14 @@ type ( | ||
| 95 | Type string `json:"type,optional"`// 类型 report:报表 group:分组 chart:图表 | 99 | Type string `json:"type,optional"`// 类型 report:报表 group:分组 chart:图表 |
| 96 | Sort int64 `json:"sort,optional"`// 排序 | 100 | Sort int64 `json:"sort,optional"`// 排序 |
| 97 | Name string `json:"name,optional"`// 名称 | 101 | Name string `json:"name,optional"`// 名称 |
| 98 | - Charts []ChartItem `json:"charts,optional"` | 102 | + //Charts []ChartItem `json:"charts,optional"` |
| 103 | + ChartProperty *ChartProperty `json:"property,optional,omitempty"` //属性 | ||
| 99 | } | 104 | } |
| 100 | ) | 105 | ) |
| 101 | 106 | ||
| 102 | type( | 107 | type( |
| 103 | ChartComponentSearchRequest{ | 108 | ChartComponentSearchRequest{ |
| 104 | - Name string `json:"name"` | 109 | + Name string `json:"name,optional"` |
| 105 | } | 110 | } |
| 106 | ChartComponentSearchResponse{ | 111 | ChartComponentSearchResponse{ |
| 107 | List []ChartComponentItem `json:"list"` | 112 | List []ChartComponentItem `json:"list"` |
| @@ -113,4 +118,43 @@ type( | @@ -113,4 +118,43 @@ type( | ||
| 113 | Cover string `json:"cover,optional"` // 封面 | 118 | Cover string `json:"cover,optional"` // 封面 |
| 114 | Desc string `json:"desc,optional"`// 描述 | 119 | Desc string `json:"desc,optional"`// 描述 |
| 115 | } | 120 | } |
| 121 | +) | ||
| 122 | + | ||
| 123 | +type( | ||
| 124 | + ChartProperty struct { | ||
| 125 | + Title Title `json:"title,optional"` // 标题 | ||
| 126 | + TableAbility TableAbility `json:"table,optional"` // 表筛选功能 | ||
| 127 | + Series []Series `json:"series,optional"` // 系列(数据源) | ||
| 128 | + Cover string `json:"cover,optional"` // 封面 | ||
| 129 | + } | ||
| 130 | + Title struct { | ||
| 131 | + TitleSwitch bool `json:"titleSwitch,optional"` // 组件标题开关 | ||
| 132 | + IntroduceSwitch bool `json:"introduceSwitch,optional"` // 组件说明开关 | ||
| 133 | + TitleType string `json:"titleType"` // 标题类型 | ||
| 134 | + Heading string `json:"heading,optional"` // 主标题 | ||
| 135 | + SubTitle string `json:"subTitle,optional"` // 副标题 | ||
| 136 | + ExplainType string `json:"explainType,optional,options=[text,file]"` // text file | ||
| 137 | + ExplainTxt string `json:"explainTxt,optional"` // 文字说明 | ||
| 138 | + FileUrl string `json:"fileUrl,optional"` // 组件图片/视频 | ||
| 139 | + } | ||
| 140 | + TableAbility struct { | ||
| 141 | + FilterSwitch bool `json:"filterSwitch,optional"` // 表筛选功能开关 | ||
| 142 | + DimensionList []Dimension `json:"dimensionList,optional"` // 维度列表 | ||
| 143 | + } | ||
| 144 | + Series struct {// 图表类型 (记录型表格:RecordTable-1 总体指标:MetricsCard-1 容器卡片:ContainerCard-1 四分图:QuarterChart-1) | ||
| 145 | + Name string `json:"name"` // 名称 (例如 指标1、指标2) | ||
| 146 | + SourceFrom string `json:"from,options=[ByteBank,User]"` // 数据源类型 ByteBank:字库 User:用户自定义 | ||
| 147 | + DataSourceId int64 `json:"dataSourceId,optional,omitempty"` // 数据源ID(from值为ByteBank时有值) | ||
| 148 | + CustomText string `json:"customText,optional,omitempty"` // 自定义数据文本(from值为User时有值) | ||
| 149 | + MatchExpressions []Expression `json:"matchExpressions,omitempty"` // 条件匹配表达式(总体指标) | ||
| 150 | + } | ||
| 151 | + Expression struct { | ||
| 152 | + Operator string `json:"operator"` // 操作符号 <,>,==,<>,<=,>= | ||
| 153 | + CompareValue string `json:"compareValue"` // 比较值 | ||
| 154 | + ToValue string `json:"toValue"` // 显示值(转为) | ||
| 155 | + } | ||
| 156 | + Dimension struct{ | ||
| 157 | + Name string `json:"name"` | ||
| 158 | + Value string `json:"value"` | ||
| 159 | + } | ||
| 116 | ) | 160 | ) |
| @@ -34,13 +34,14 @@ service Core { | @@ -34,13 +34,14 @@ service Core { | ||
| 34 | 34 | ||
| 35 | type ( | 35 | type ( |
| 36 | SearchTableByModuleRequest struct{ | 36 | SearchTableByModuleRequest struct{ |
| 37 | - | 37 | + Token string `header:"x-mmm-accesstoken"` |
| 38 | } | 38 | } |
| 39 | SearchTableByModuleResponse struct{ | 39 | SearchTableByModuleResponse struct{ |
| 40 | 40 | ||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | SearchTableFieldOptionalValuesRequest struct{ | 43 | SearchTableFieldOptionalValuesRequest struct{ |
| 44 | + Token string `header:"x-mmm-accesstoken"` | ||
| 44 | ObjectId int `json:"objectId"` // 对象ID | 45 | ObjectId int `json:"objectId"` // 对象ID |
| 45 | Field string `json:"field"` // 当前选择的字段 | 46 | Field string `json:"field"` // 当前选择的字段 |
| 46 | SqlName string `json:"sqlName"` // 字段SqlName | 47 | SqlName string `json:"sqlName"` // 字段SqlName |
| @@ -62,6 +63,7 @@ type ( | @@ -62,6 +63,7 @@ type ( | ||
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | GetTableDetailRequest struct { | 65 | GetTableDetailRequest struct { |
| 66 | + Token string `header:"x-mmm-accesstoken"` | ||
| 65 | TableId int `path:"tableId"` // 表ID | 67 | TableId int `path:"tableId"` // 表ID |
| 66 | } | 68 | } |
| 67 | GetTableDetailResponse struct{ | 69 | GetTableDetailResponse struct{ |
| @@ -69,6 +71,7 @@ type ( | @@ -69,6 +71,7 @@ type ( | ||
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | SearchTableDataRequest struct{ | 73 | SearchTableDataRequest struct{ |
| 74 | + Token string `header:"x-mmm-accesstoken"` | ||
| 72 | ObjectId int `json:"objectId"` // 对象ID | 75 | ObjectId int `json:"objectId"` // 对象ID |
| 73 | PageNumber int `json:"page,optional"` // 分页数 | 76 | PageNumber int `json:"page,optional"` // 分页数 |
| 74 | PageSize int `json:"size,optional"` // 页码 | 77 | PageSize int `json:"size,optional"` // 页码 |
| @@ -5,5 +5,9 @@ import ( | @@ -5,5 +5,9 @@ import ( | ||
| 5 | ) | 5 | ) |
| 6 | 6 | ||
| 7 | func GetTenantFromCtx(ctx context.Context) int64 { | 7 | func GetTenantFromCtx(ctx context.Context) int64 { |
| 8 | - return 1 | 8 | + userToken := GetUserTokenFromCtx(ctx) |
| 9 | + if userToken.CompanyId == 0 { | ||
| 10 | + return 0 | ||
| 11 | + } | ||
| 12 | + return userToken.CompanyId | ||
| 9 | } | 13 | } |
| @@ -10,10 +10,11 @@ import ( | @@ -10,10 +10,11 @@ import ( | ||
| 10 | ) | 10 | ) |
| 11 | 11 | ||
| 12 | var ( | 12 | var ( |
| 13 | - CtxKeyJwtUserId = "UserId" | 13 | + CtxKeyJwtUserId = "userId" |
| 14 | + CtxKeyJwtCompanyId = "companyId" | ||
| 14 | ) | 15 | ) |
| 15 | 16 | ||
| 16 | -func GetUserIdFromCtx(ctx context.Context, key string) int64 { | 17 | +func GetInt64FromCtx(ctx context.Context, key string) int64 { |
| 17 | var uid int64 | 18 | var uid int64 |
| 18 | if jsonUid, ok := ctx.Value(key).(json.Number); ok { | 19 | if jsonUid, ok := ctx.Value(key).(json.Number); ok { |
| 19 | if int64Uid, err := jsonUid.Int64(); err == nil { | 20 | if int64Uid, err := jsonUid.Int64(); err == nil { |
| @@ -52,12 +53,14 @@ func getArrayInt64FromCtx(ctx context.Context, key string) []int64 { | @@ -52,12 +53,14 @@ func getArrayInt64FromCtx(ctx context.Context, key string) []int64 { | ||
| 52 | 53 | ||
| 53 | func GetUserTokenFromCtx(ctx context.Context) UserToken { | 54 | func GetUserTokenFromCtx(ctx context.Context) UserToken { |
| 54 | return UserToken{ | 55 | return UserToken{ |
| 55 | - UserId: GetUserIdFromCtx(ctx, CtxKeyJwtUserId), | 56 | + UserId: GetInt64FromCtx(ctx, CtxKeyJwtUserId), |
| 57 | + CompanyId: GetInt64FromCtx(ctx, CtxKeyJwtCompanyId), | ||
| 56 | } | 58 | } |
| 57 | } | 59 | } |
| 58 | 60 | ||
| 59 | type UserToken struct { | 61 | type UserToken struct { |
| 60 | - UserId int64 `json:"userId"` | 62 | + UserId int64 `json:"userId"` |
| 63 | + CompanyId int64 `json:"companyId"` | ||
| 61 | } | 64 | } |
| 62 | 65 | ||
| 63 | func (tk UserToken) GenerateToken(jwtConfig config.JwtAuth) (string, error) { | 66 | func (tk UserToken) GenerateToken(jwtConfig config.JwtAuth) (string, error) { |
-
请 注册 或 登录 后发表评论