123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- syntax = "proto3";
- package base_shopping_service;
- option go_package = "./proto;shopping_service";
- enum StatusEnum {
- UNKNOWN = 0;
- ENABLED = 1;
- DISABLED = 2;
- DELETED = 3;
- }
- enum OrderStatusEnum {
- ORDER_UNKNOWN = 0;
- ORDER_CREATED = 1;
- ORDER_PENDING_PAYMENT = 2;
- ORDER_PAID = 3;
- ORDER_PROCESSING = 4;
- ORDER_SHIPPED = 5;
- ORDER_COMPLETED = 6;
- ORDER_CANCELED = 7;
- ORDER_REFUND_IN_PROGRESS = 8;
- ORDER_REFUNDED = 9;
- ORDER_RETURN_IN_PROGRESS = 10;
- ORDER_RETURNED = 11;
- UNDER_REVIEW = 12;
- }
- enum PaymentStatusEnum {
- PAYMENT_UNKNOWN = 0;
- PAYMENT_PENDING = 1; // 待支付 订单已创建,但尚未支付。
- PAYMENT_PROCESSING = 2; // 支付中 支付请求已经提交,正在处理中。
- PAYMENT_PAID = 3; // 支付成功 支付已成功完成。
- PAYMENT_FAILED = 4; // 支付失败 支付尝试失败。
- PAYMENT_CANCELED = 5; // 取消支付 用户或系统取消了支付。
- PAYMENT_REFUNDING = 6; // 退款中 用户请求退款,退款正在处理中。
- PAYMENT_REFUNDED = 7; // 已退款 退款已成功完成。
- PAYMENT_PARTIALLY_REFUNDING = 8; // Refunding 部分退款中 用户请求部分退款,部分退款正在处理中。
- PAYMENT_PARTIALLY_REFUNDED = 9; // Refunded 已部分退款 部分退款已成功完成。
- }
- enum PaymentMethodEnum {
- Payment_Method_UNKNOWN = 0; // 未知类型
- PAYMENT_METHOD_BANKCARD = 1; // 银行卡
- PAYMENT_METHOD_ALIPAY = 3; // 支付宝
- PAYMENT_METHOD_WECHAT_PAY = 4; // 微信
- }
- message Address {
- int64 id = 1;
- int64 user_id = 2;
- string country = 3;
- string province = 4;
- string city = 5;
- string district = 6;
- string street = 7;
- string remark = 8;
- int32 is_default= 9;
- Location location = 10;
- int64 created_at = 11;
- int64 updated_at = 12;
- }
- message Location {
- int64 id = 1;
- int64 address_id = 2;
- float lon = 3;
- float lat = 4;
- }
- message Category {
- int64 id = 1;
- string name = 2;
- string description = 3;
- int64 created_at = 4;
- int64 updated_at = 5;
- int64 parent_category_id = 6;
- }
- message Order {
- int64 id = 1;
- int64 user_id = 2;
- User user = 3;
- int64 address_id = 4;
- Address address = 5;
- int32 total_amount = 6;
- OrderStatusEnum status = 7;
- PaymentMethodEnum payment_method = 8;
- int64 created_at = 9;
- int64 updated_at = 10;
- repeated OrderItem order_items = 11;
- Payment payment = 12;
- }
- message OrderItem {
- int64 id = 1;
- int64 order_id = 2;
- Order order = 3;
- int64 product_id = 4;
- Product product = 5;
- int64 quantity = 6;
- int64 subtotal = 7;
- }
- message Payment {
- int64 id = 1;
- int64 order_id = 2;
- int64 amount = 3;
- PaymentStatusEnum status = 4;
- PaymentMethodEnum payment_method = 5;
- int64 created_at = 6;
- int64 updated_at = 7;
- }
- message Product {
- int64 id = 1;
- string name = 2;
- string description = 3;
- int32 price = 4;
- int32 stock_quantity = 5;
- int64 created_at = 6;
- int64 updated_at = 7;
- int64 category_id = 8;
- Category category = 9;
- }
- message ShoppingCart {
- int64 id = 1;
- int64 user_id = 2;
- int64 created_at = 3;
- int64 updated_at = 4;
- int64 quantity = 5;
- repeated ShoppingCartItem items = 6;
- }
- message ShoppingCartItem {
- int64 id = 1;
- int64 shopping_cart_id = 2;
- int64 product_id = 3;
- Product product = 4;
- int32 quantity = 5;
- int32 total_price = 6;
- }
- message UserAuth {
- int64 id = 1;
- int64 user_id = 2;
- string oauth_type = 3;
- string oauth_id = 4;
- string union_id = 5;
- string credential = 6;
- }
- message User {
- int64 id = 1;
- string username = 2;
- string password = 3;
- string phone_number = 4;
- string email = 5;
- string avatar = 6;
- int64 created_at = 7;
- string created_by = 8;
- int64 updated_at = 9;
- string updated_by = 10;
- repeated Address addresses = 11;
- ShoppingCart shopping_cart = 12;
- repeated Order orders = 13;
- repeated UserAuth user_auth = 14;
- StatusEnum status = 15;
- repeated base_shopping_service.Base roles = 16;
- int64 group_id = 17;
- UserGroup group = 18;
- }
- message UserGroup {
- int64 id = 1;
- string name = 2;
- string description = 3;
- string code = 4;
- int64 created_at = 5;
- string created_by = 6;
- int64 updated_at = 7;
- string updated_by = 8;
- }
- //
- //message AdminUser {
- // int64 id = 1;
- // string username = 2;
- // string phone_number = 3;
- // string avatar = 4;
- // string email = 5;
- // base_shopping_service.StatusEnum status = 6;
- // bool is_reserved = 7;
- // int64 created_at = 8;
- // string created_by = 9;
- // int64 updated_at = 10;
- // string updated_by = 11;
- // repeated base_shopping_service.Base roles = 12;
- //}
- //
- message Base {
- string key = 1;
- string value = 2;
- }
- message Role {
- int64 id = 1;
- string name = 2;
- string description = 3;
- repeated Base users = 4;
- repeated Base permissions = 5;
- string created_by = 6;
- int64 created_at = 7;
- int64 updated_at = 8;
- string updated_by = 9;
- base_shopping_service.StatusEnum status = 10;
- bool is_reserved =11;
- }
- message Permission {
- int64 id = 1;
- string name = 2;
- string description = 3;
- repeated Base roles = 4;
- int64 created_at = 5;
- string created_by = 6;
- int64 updated_at = 7;
- string updated_by = 8;
- base_shopping_service.StatusEnum status = 9;
- bool is_reserved = 10;
- string endpoint = 11;
- }
|