Refactor: Remove deprecated gRPC service files and implement new API structure

- Deleted old gRPC service definitions in `game_grpc.pb.go` and `public.go`.
- Added new API server implementations for objectstory, player, and shop services.
- Introduced configuration files for new APIs in `etc/*.yaml`.
- Created main entry points for each service in `objectstory.go`, `player.go`, and `shop.go`.
- Removed unused user update handler and user API files.
- Added utility functions for context management and HTTP header parsing.
- Introduced PostgreSQL backup configuration in `backup/postgreSql.yaml`.
This commit is contained in:
wwweww
2026-02-28 18:35:56 +08:00
parent d2f33b4b96
commit 19cc7a778c
349 changed files with 42548 additions and 1453 deletions
+76
View File
@@ -0,0 +1,76 @@
// Code generated by ent, DO NOT EDIT.
package models
import (
"juwan-backend/app/order/rpc/internal/models/orders"
"juwan-backend/app/order/rpc/internal/models/orderstatelogs"
"juwan-backend/app/order/rpc/internal/models/schema"
"time"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
orderstatelogsFields := schema.OrderStateLogs{}.Fields()
_ = orderstatelogsFields
// orderstatelogsDescFromStatus is the schema descriptor for from_status field.
orderstatelogsDescFromStatus := orderstatelogsFields[2].Descriptor()
// orderstatelogs.FromStatusValidator is a validator for the "from_status" field. It is called by the builders before save.
orderstatelogs.FromStatusValidator = orderstatelogsDescFromStatus.Validators[0].(func(string) error)
// orderstatelogsDescToStatus is the schema descriptor for to_status field.
orderstatelogsDescToStatus := orderstatelogsFields[3].Descriptor()
// orderstatelogs.ToStatusValidator is a validator for the "to_status" field. It is called by the builders before save.
orderstatelogs.ToStatusValidator = orderstatelogsDescToStatus.Validators[0].(func(string) error)
// orderstatelogsDescAction is the schema descriptor for action field.
orderstatelogsDescAction := orderstatelogsFields[4].Descriptor()
// orderstatelogs.ActionValidator is a validator for the "action" field. It is called by the builders before save.
orderstatelogs.ActionValidator = orderstatelogsDescAction.Validators[0].(func(string) error)
// orderstatelogsDescActorRole is the schema descriptor for actor_role field.
orderstatelogsDescActorRole := orderstatelogsFields[6].Descriptor()
// orderstatelogs.ActorRoleValidator is a validator for the "actor_role" field. It is called by the builders before save.
orderstatelogs.ActorRoleValidator = orderstatelogsDescActorRole.Validators[0].(func(string) error)
// orderstatelogsDescCreatedAt is the schema descriptor for created_at field.
orderstatelogsDescCreatedAt := orderstatelogsFields[8].Descriptor()
// orderstatelogs.DefaultCreatedAt holds the default value on creation for the created_at field.
orderstatelogs.DefaultCreatedAt = orderstatelogsDescCreatedAt.Default.(func() time.Time)
ordersFields := schema.Orders{}.Fields()
_ = ordersFields
// ordersDescConsumerName is the schema descriptor for consumer_name field.
ordersDescConsumerName := ordersFields[2].Descriptor()
// orders.ConsumerNameValidator is a validator for the "consumer_name" field. It is called by the builders before save.
orders.ConsumerNameValidator = ordersDescConsumerName.Validators[0].(func(string) error)
// ordersDescPlayerName is the schema descriptor for player_name field.
ordersDescPlayerName := ordersFields[4].Descriptor()
// orders.PlayerNameValidator is a validator for the "player_name" field. It is called by the builders before save.
orders.PlayerNameValidator = ordersDescPlayerName.Validators[0].(func(string) error)
// ordersDescShopName is the schema descriptor for shop_name field.
ordersDescShopName := ordersFields[6].Descriptor()
// orders.ShopNameValidator is a validator for the "shop_name" field. It is called by the builders before save.
orders.ShopNameValidator = ordersDescShopName.Validators[0].(func(string) error)
// ordersDescStatus is the schema descriptor for status field.
ordersDescStatus := ordersFields[8].Descriptor()
// orders.DefaultStatus holds the default value on creation for the status field.
orders.DefaultStatus = ordersDescStatus.Default.(string)
// orders.StatusValidator is a validator for the "status" field. It is called by the builders before save.
orders.StatusValidator = ordersDescStatus.Validators[0].(func(string) error)
// ordersDescVersion is the schema descriptor for version field.
ordersDescVersion := ordersFields[11].Descriptor()
// orders.DefaultVersion holds the default value on creation for the version field.
orders.DefaultVersion = ordersDescVersion.Default.(int)
// ordersDescTimeoutJobID is the schema descriptor for timeout_job_id field.
ordersDescTimeoutJobID := ordersFields[12].Descriptor()
// orders.TimeoutJobIDValidator is a validator for the "timeout_job_id" field. It is called by the builders before save.
orders.TimeoutJobIDValidator = ordersDescTimeoutJobID.Validators[0].(func(string) error)
// ordersDescCreatedAt is the schema descriptor for created_at field.
ordersDescCreatedAt := ordersFields[14].Descriptor()
// orders.DefaultCreatedAt holds the default value on creation for the created_at field.
orders.DefaultCreatedAt = ordersDescCreatedAt.Default.(func() time.Time)
// ordersDescUpdatedAt is the schema descriptor for updated_at field.
ordersDescUpdatedAt := ordersFields[19].Descriptor()
// orders.DefaultUpdatedAt holds the default value on creation for the updated_at field.
orders.DefaultUpdatedAt = ordersDescUpdatedAt.Default.(func() time.Time)
// orders.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
orders.UpdateDefaultUpdatedAt = ordersDescUpdatedAt.UpdateDefault.(func() time.Time)
}