Skip to content

Commit

Permalink
feat(pro): add uc
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed Sep 20, 2024
1 parent ca29002 commit bf87847
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/svc/servicecontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type ServiceContext struct {
Config config.Config
PowerX *uc.PowerXUseCase
OpenAPI *uc.OpenAPIUseCase
Pro *uc.ProUseCase
Custom *uc.CustomUseCase

MPCustomerJWTAuth rest.Middleware
Expand All @@ -29,6 +30,7 @@ type ServiceContext struct {
func NewServiceContext(c config.Config, opts ...Option) *ServiceContext {
powerx, _ := uc.NewPowerXUseCase(&c)
openapi, _ := uc.NewOpenAPIUseCase(&c, powerx)
pro, _ := uc.NewProUseCase(&c, powerx)
custom, _ := uc.NewCustomUseCase(&c, powerx)

svcCtx := ServiceContext{
Expand All @@ -43,6 +45,7 @@ func NewServiceContext(c config.Config, opts ...Option) *ServiceContext {
UserNoPermJWTAuth: middleware.NewUserNoPermJWTAuthMiddleware(&c, powerx).Handle,
OpenAPIJWTAuth: middleware.NewOpenAPIJWTAuthMiddleware(&c, powerx).Handle,
OpenAPIPlatformGet: middleware.NewOpenAPIPlatformGetMiddleware(&c, powerx).Handle,
Pro: pro,
Custom: custom,
}

Expand Down
20 changes: 20 additions & 0 deletions internal/uc/pro.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package uc

import (
"PowerX/internal/config"
"gorm.io/gorm"
)

type ProUseCase struct {
db *gorm.DB
}

func NewProUseCase(conf *config.Config, pxUseCase *PowerXUseCase) (uc *ProUseCase, clean func()) {

uc = &ProUseCase{}

// 需要打印当时系统的Timezone
return uc, func() {

}
}

0 comments on commit bf87847

Please sign in to comment.