add initial application structure with configuration, logging, and health check endpoints
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"epic-ent/internal/domain/vo"
|
||||
)
|
||||
|
||||
type HealthRepository struct{}
|
||||
|
||||
func NewHealthRepository() *HealthRepository {
|
||||
return &HealthRepository{}
|
||||
}
|
||||
|
||||
func (r *HealthRepository) Check() vo.HealthStatus {
|
||||
return vo.HealthStatus{Status: "ok"}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ func (r *HeroRepository) Create(ctx context.Context, req dto.HeroCreateRequest)
|
||||
SetAttribute(valueOrEmpty(req.Attribute)).
|
||||
SetRemark(valueOrEmpty(req.Remark)).
|
||||
SetRawJSON(valueOrEmpty(req.RawJSON)).
|
||||
SetSetContentJSON(valueOrEmpty(req.SetContentJSON))
|
||||
SetContentJSONSet(valueOrEmpty(req.ContentJSONSet))
|
||||
|
||||
if req.CreateTime != nil {
|
||||
create.SetCreateTime(*req.CreateTime)
|
||||
@@ -43,8 +43,8 @@ func (r *HeroRepository) Create(ctx context.Context, req dto.HeroCreateRequest)
|
||||
if req.UpdateTime != nil {
|
||||
create.SetUpdateTime(*req.UpdateTime)
|
||||
}
|
||||
if req.SetUpdateTime != nil {
|
||||
create.SetSetUpdateTime(*req.SetUpdateTime)
|
||||
if req.UpdateTimeSet != nil {
|
||||
create.SetUpdateTimeSet(*req.UpdateTimeSet)
|
||||
}
|
||||
|
||||
hero, err := create.Save(ctx)
|
||||
@@ -132,12 +132,12 @@ func (r *HeroRepository) Update(ctx context.Context, id int64, req dto.HeroUpdat
|
||||
update.SetRawJSON(*req.RawJSON)
|
||||
updated = true
|
||||
}
|
||||
if req.SetContentJSON != nil {
|
||||
update.SetSetContentJSON(*req.SetContentJSON)
|
||||
if req.ContentJSONSet != nil {
|
||||
update.SetContentJSONSet(*req.ContentJSONSet)
|
||||
updated = true
|
||||
}
|
||||
if req.SetUpdateTime != nil {
|
||||
update.SetSetUpdateTime(*req.SetUpdateTime)
|
||||
if req.UpdateTimeSet != nil {
|
||||
update.SetUpdateTimeSet(*req.UpdateTimeSet)
|
||||
updated = true
|
||||
}
|
||||
|
||||
@@ -198,8 +198,8 @@ func toVO(hero *ent.EpicHeroInfo) vo.Hero {
|
||||
Attribute: hero.Attribute,
|
||||
Remark: hero.Remark,
|
||||
RawJSON: hero.RawJSON,
|
||||
SetContentJSON: hero.SetContentJSON,
|
||||
SetUpdateTime: hero.SetUpdateTime,
|
||||
ContentJSONSet: hero.ContentJSONSet,
|
||||
UpdateTimeSet: hero.UpdateTimeSet,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import "go.uber.org/fx"
|
||||
|
||||
var Module = fx.Options(
|
||||
fx.Provide(
|
||||
NewHealthRepository,
|
||||
NewHeroRepository,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user