add initial application structure with configuration, logging, and health check endpoints

This commit is contained in:
kever
2026-01-15 21:39:15 +08:00
parent fed727e593
commit ed8c3d55b8
103 changed files with 39974 additions and 80 deletions

View File

@@ -0,0 +1,43 @@
package dto
import "time"
type HeroCreateRequest struct {
HeroName *string `json:"heroName"`
HeroCode *string `json:"heroCode"`
HeroAttrLv60 *string `json:"heroAttrLv60"`
Creator *string `json:"creator"`
CreateTime *time.Time `json:"createTime"`
Updater *string `json:"updater"`
UpdateTime *time.Time `json:"updateTime"`
Deleted *bool `json:"deleted"`
NickName *string `json:"nickName"`
Rarity *string `json:"rarity"`
Role *string `json:"role"`
Zodiac *string `json:"zodiac"`
HeadImgURL *string `json:"headImgUrl"`
Attribute *string `json:"attribute"`
Remark *string `json:"remark"`
RawJSON *string `json:"rawJson"`
SetContentJSON *string `json:"setContentJson"`
SetUpdateTime *time.Time `json:"setUpdateTime"`
}
type HeroUpdateRequest struct {
HeroName *string `json:"heroName"`
HeroCode *string `json:"heroCode"`
HeroAttrLv60 *string `json:"heroAttrLv60"`
Updater *string `json:"updater"`
UpdateTime *time.Time `json:"updateTime"`
Deleted *bool `json:"deleted"`
NickName *string `json:"nickName"`
Rarity *string `json:"rarity"`
Role *string `json:"role"`
Zodiac *string `json:"zodiac"`
HeadImgURL *string `json:"headImgUrl"`
Attribute *string `json:"attribute"`
Remark *string `json:"remark"`
RawJSON *string `json:"rawJson"`
SetContentJSON *string `json:"setContentJson"`
SetUpdateTime *time.Time `json:"setUpdateTime"`
}

View File

@@ -0,0 +1,34 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicArtifactInfo struct {
ent.Schema
}
func (EpicArtifactInfo) Table() string {
return "epic_artifact_info"
}
func (EpicArtifactInfo) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("artifact_name").MaxLen(255),
field.String("artifact_code").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
field.Int("stats_health"),
field.Int("stats_attack"),
field.Int("stats_defense"),
field.String("rarity").MaxLen(255),
field.String("role").MaxLen(255),
field.String("artifact_name_en").MaxLen(255),
field.String("image_url").MaxLen(255),
}
}

View File

@@ -0,0 +1,26 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicGvgAttackTeams struct {
ent.Schema
}
func (EpicGvgAttackTeams) Table() string {
return "epic_gvg_attack_teams"
}
func (EpicGvgAttackTeams) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("attack_heroes").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
}
}

View File

@@ -0,0 +1,32 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicGvgDefenseAttackMapping struct {
ent.Schema
}
func (EpicGvgDefenseAttackMapping) Table() string {
return "epic_gvg_defense_attack_mapping"
}
func (EpicGvgDefenseAttackMapping) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.Int64("defense_id"),
field.Int64("attack_id"),
field.String("equipment_info").MaxLen(255),
field.String("artifacts").MaxLen(255),
field.String("battle_strategy").MaxLen(255),
field.String("prerequisites").MaxLen(255),
field.String("important_notes").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
}
}

View File

@@ -0,0 +1,26 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicGvgDefenseTeams struct {
ent.Schema
}
func (EpicGvgDefenseTeams) Table() string {
return "epic_gvg_defense_teams"
}
func (EpicGvgDefenseTeams) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("defense_heroes").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
}
}

View File

@@ -0,0 +1,38 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicHeroInfo struct {
ent.Schema
}
func (EpicHeroInfo) Table() string {
return "epic_hero_info"
}
func (EpicHeroInfo) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("hero_name").MaxLen(255),
field.String("hero_code").MaxLen(255),
field.String("hero_attr_lv60").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
field.String("nick_name").MaxLen(255),
field.String("rarity").MaxLen(255),
field.String("role").MaxLen(255),
field.String("zodiac").MaxLen(255),
field.String("head_img_url").MaxLen(255),
field.String("attribute").MaxLen(255),
field.String("remark").MaxLen(255),
field.String("raw_json").MaxLen(255),
field.String("set_content_json").MaxLen(255),
field.Time("set_update_time").Optional().Nillable(),
}
}

View File

@@ -0,0 +1,30 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicHeroUserBuild struct {
ent.Schema
}
func (EpicHeroUserBuild) Table() string {
return "epic_hero_user_build"
}
func (EpicHeroUserBuild) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("artifact_code").MaxLen(255),
field.String("hero_code").MaxLen(255),
field.Float("hero_heath_build"),
field.Float("hero_attack_build"),
field.Float("hero_def_build"),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
}
}

View File

@@ -0,0 +1,31 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type EpicI18NMappings struct {
ent.Schema
}
func (EpicI18NMappings) Table() string {
return "epic_i18n_mappings"
}
func (EpicI18NMappings) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("key_name").MaxLen(255),
field.String("language").MaxLen(255),
field.String("value").MaxLen(255),
field.String("category").MaxLen(255),
field.Int("status"),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Int("deleted"),
field.String("code").MaxLen(255),
}
}

View File

@@ -0,0 +1,29 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type FribbleHeroSet struct {
ent.Schema
}
func (FribbleHeroSet) Table() string {
return "fribble_hero_set"
}
func (FribbleHeroSet) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.String("hero_code").MaxLen(255),
field.String("json_content").MaxLen(255),
field.String("hero_name").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
field.Int("success_get"),
}
}

View File

@@ -0,0 +1,42 @@
package entity
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
type GearSetInfo struct {
ent.Schema
}
func (GearSetInfo) Table() string {
return "gear_set_info"
}
func (GearSetInfo) Fields() []ent.Field {
return []ent.Field{
field.Int64("id").Immutable().Unique(),
field.Int("level"),
field.Int64("gear_id"),
field.Int("enhance"),
field.String("gear_type").MaxLen(255),
field.String("gear_set_type").MaxLen(255),
field.String("main_stat_type").MaxLen(255),
field.Int("main_stat_value"),
field.String("sub_stat_one_type").MaxLen(255),
field.Int("sub_stat_one_value"),
field.String("sub_stat_two_type").MaxLen(255),
field.Int("sub_stat_two_value"),
field.String("sub_stat_three_type").MaxLen(255),
field.Int("sub_stat_three_value"),
field.String("sub_stat_four_type").MaxLen(255),
field.Int("sub_stat_four_value"),
field.String("account_code").MaxLen(255),
field.String("creator").MaxLen(255),
field.Time("create_time").Optional().Nillable(),
field.String("updater").MaxLen(255),
field.Time("update_time").Optional().Nillable(),
field.Bool("deleted"),
field.Int64("tenant_id"),
}
}

View File

@@ -0,0 +1,25 @@
package vo
import "time"
type Hero struct {
ID int64 `json:"id"`
HeroName string `json:"heroName"`
HeroCode string `json:"heroCode"`
HeroAttrLv60 string `json:"heroAttrLv60"`
Creator string `json:"creator"`
CreateTime *time.Time `json:"createTime"`
Updater string `json:"updater"`
UpdateTime *time.Time `json:"updateTime"`
Deleted bool `json:"deleted"`
NickName string `json:"nickName"`
Rarity string `json:"rarity"`
Role string `json:"role"`
Zodiac string `json:"zodiac"`
HeadImgURL string `json:"headImgUrl"`
Attribute string `json:"attribute"`
Remark string `json:"remark"`
RawJSON string `json:"rawJson"`
SetContentJSON string `json:"setContentJson"`
SetUpdateTime *time.Time `json:"setUpdateTime"`
}

View File

@@ -0,0 +1,22 @@
package vo
type Response struct {
Code string `json:"code"`
Message string `json:"message"`
Data any `json:"data,omitempty"`
}
func OK(data any) Response {
return Response{
Code: "OK",
Message: "success",
Data: data,
}
}
func Error(message string) Response {
return Response{
Code: "ERROR",
Message: message,
}
}