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:
@@ -0,0 +1,211 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package orders
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the orders type in the database.
|
||||
Label = "orders"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldConsumerID holds the string denoting the consumer_id field in the database.
|
||||
FieldConsumerID = "consumer_id"
|
||||
// FieldConsumerName holds the string denoting the consumer_name field in the database.
|
||||
FieldConsumerName = "consumer_name"
|
||||
// FieldPlayerID holds the string denoting the player_id field in the database.
|
||||
FieldPlayerID = "player_id"
|
||||
// FieldPlayerName holds the string denoting the player_name field in the database.
|
||||
FieldPlayerName = "player_name"
|
||||
// FieldShopID holds the string denoting the shop_id field in the database.
|
||||
FieldShopID = "shop_id"
|
||||
// FieldShopName holds the string denoting the shop_name field in the database.
|
||||
FieldShopName = "shop_name"
|
||||
// FieldServiceSnapshot holds the string denoting the service_snapshot field in the database.
|
||||
FieldServiceSnapshot = "service_snapshot"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldTotalPrice holds the string denoting the total_price field in the database.
|
||||
FieldTotalPrice = "total_price"
|
||||
// FieldNote holds the string denoting the note field in the database.
|
||||
FieldNote = "note"
|
||||
// FieldVersion holds the string denoting the version field in the database.
|
||||
FieldVersion = "version"
|
||||
// FieldTimeoutJobID holds the string denoting the timeout_job_id field in the database.
|
||||
FieldTimeoutJobID = "timeout_job_id"
|
||||
// FieldSearchText holds the string denoting the search_text field in the database.
|
||||
FieldSearchText = "search_text"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldAcceptedAt holds the string denoting the accepted_at field in the database.
|
||||
FieldAcceptedAt = "accepted_at"
|
||||
// FieldClosedAt holds the string denoting the closed_at field in the database.
|
||||
FieldClosedAt = "closed_at"
|
||||
// FieldCompletedAt holds the string denoting the completed_at field in the database.
|
||||
FieldCompletedAt = "completed_at"
|
||||
// FieldCancelledAt holds the string denoting the cancelled_at field in the database.
|
||||
FieldCancelledAt = "cancelled_at"
|
||||
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// Table holds the table name of the orders in the database.
|
||||
Table = "orders"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for orders fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldConsumerID,
|
||||
FieldConsumerName,
|
||||
FieldPlayerID,
|
||||
FieldPlayerName,
|
||||
FieldShopID,
|
||||
FieldShopName,
|
||||
FieldServiceSnapshot,
|
||||
FieldStatus,
|
||||
FieldTotalPrice,
|
||||
FieldNote,
|
||||
FieldVersion,
|
||||
FieldTimeoutJobID,
|
||||
FieldSearchText,
|
||||
FieldCreatedAt,
|
||||
FieldAcceptedAt,
|
||||
FieldClosedAt,
|
||||
FieldCompletedAt,
|
||||
FieldCancelledAt,
|
||||
FieldUpdatedAt,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// ConsumerNameValidator is a validator for the "consumer_name" field. It is called by the builders before save.
|
||||
ConsumerNameValidator func(string) error
|
||||
// PlayerNameValidator is a validator for the "player_name" field. It is called by the builders before save.
|
||||
PlayerNameValidator func(string) error
|
||||
// ShopNameValidator is a validator for the "shop_name" field. It is called by the builders before save.
|
||||
ShopNameValidator func(string) error
|
||||
// DefaultStatus holds the default value on creation for the "status" field.
|
||||
DefaultStatus string
|
||||
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
StatusValidator func(string) error
|
||||
// DefaultVersion holds the default value on creation for the "version" field.
|
||||
DefaultVersion int
|
||||
// TimeoutJobIDValidator is a validator for the "timeout_job_id" field. It is called by the builders before save.
|
||||
TimeoutJobIDValidator func(string) error
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() time.Time
|
||||
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
||||
UpdateDefaultUpdatedAt func() time.Time
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Orders queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByConsumerID orders the results by the consumer_id field.
|
||||
func ByConsumerID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldConsumerID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByConsumerName orders the results by the consumer_name field.
|
||||
func ByConsumerName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldConsumerName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPlayerID orders the results by the player_id field.
|
||||
func ByPlayerID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPlayerID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPlayerName orders the results by the player_name field.
|
||||
func ByPlayerName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPlayerName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByShopID orders the results by the shop_id field.
|
||||
func ByShopID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldShopID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByShopName orders the results by the shop_name field.
|
||||
func ByShopName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldShopName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTotalPrice orders the results by the total_price field.
|
||||
func ByTotalPrice(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTotalPrice, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNote orders the results by the note field.
|
||||
func ByNote(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNote, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByVersion orders the results by the version field.
|
||||
func ByVersion(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldVersion, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTimeoutJobID orders the results by the timeout_job_id field.
|
||||
func ByTimeoutJobID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTimeoutJobID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySearchText orders the results by the search_text field.
|
||||
func BySearchText(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSearchText, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAcceptedAt orders the results by the accepted_at field.
|
||||
func ByAcceptedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAcceptedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByClosedAt orders the results by the closed_at field.
|
||||
func ByClosedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldClosedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCompletedAt orders the results by the completed_at field.
|
||||
func ByCompletedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCompletedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCancelledAt orders the results by the cancelled_at field.
|
||||
func ByCancelledAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCancelledAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updated_at field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user