proto/service/fsservice.proto

231 lines
5.8 KiB
Protocol Buffer
Raw Normal View History

2023-11-27 09:36:02 +00:00
syntax = "proto3"; //版本声明使用v3版本
package fsservice;
2023-12-04 06:56:42 +00:00
option go_package = "gitee.com/fusenpack/fusen-service;service";
2023-11-27 09:36:02 +00:00
// 导入google/api/annotations.proto 注释依赖
import "google/api/annotations.proto";
import "service/basic.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";
2023-12-05 09:43:04 +00:00
2023-11-27 09:36:02 +00:00
//定义服务
2023-12-04 06:56:42 +00:00
service info {
2023-11-27 09:36:02 +00:00
// 用户信息
rpc UserInfo(UserInfoRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/user"
body: "*"
};
}
// 用户个人资料查询
rpc UserProfile(QueryProfileRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/user/profile"
body: "*"
};
}
// 获取默认用户个人资料
rpc DefaultUserProfile(DefaultProfileRequest) returns (basic.Response) {
option (google.api.http) = {
get: "/api/info/user/profile/default/{request}"
};
}
// 更新用户个人资料
rpc UpdateProfileBase(ProfileRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/user/profile/base/update"
body: "*"
};
}
// 设置默认地址
rpc AddressDefault(AddressDefaultRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/address/default"
body: "*"
};
}
// 添加地址
rpc AddressAdd(AddressRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/address/add"
body: "*"
};
}
// 更新地址
rpc AddressUpdate(AddressRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/address/update"
body: "*"
};
}
// 更新地址使用状态
rpc AddressUsedUpdate(AddressIdRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/address/update/used"
body: "*"
};
}
// 删除地址
rpc AddressDelete(AddressIdRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/address/delete"
body: "*"
};
}
// 获取地址列表
rpc AddressList(basic.Request) returns (basic.Response) {
option (google.api.http) = {
get: "/api/info/address/list"
};
}
// 获取餐厅列表
rpc RestaurantList(basic.Request) returns (basic.Response) {
option (google.api.http) = {
get: "/api/info/restaurant/list"
};
}
// 搜索建议
rpc PreLogoSearchSuggestions(PreLogoSearchSuggestionsRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/prelogo/search/suggestions"
body: "*"
};
}
// 搜索
rpc PreLogoSearch(PreLogoSearchRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/prelogo/search"
body: "*"
};
}
// 联系我们
rpc ContactUs(ContactUsRequest) returns (basic.Response) {
option (google.api.http) = {
post: "/api/info/contact/us"
body: "*"
};
}
}
2023-12-04 06:56:42 +00:00
//定义产品服务
service product {
// 产品详情
2023-12-05 10:02:04 +00:00
rpc GetProductDetail(GetProductDetailReq) returns (basic.Response) {
2023-12-04 06:56:42 +00:00
option (google.api.http) = {
2023-12-04 09:16:28 +00:00
get: "/api/product/get_product_detail"
2023-12-04 06:56:42 +00:00
};
}
}
2023-11-27 09:36:02 +00:00
message UserInfoRequest {
repeated string module = 1; // 模块
}
message QueryProfileRequest {
string top_key = 1; // 首键
}
message QueryProfileResponse {
2023-12-04 06:56:42 +00:00
google.protobuf.Struct data = 1;
2023-11-27 09:36:02 +00:00
}
message DefaultProfileRequest {
string request = 1; // 请求
}
message ProfileRequest {
ProfileBase base = 1; // 基础个人资料
SubscriptionStatus sub_status = 2; // 订阅状态
}
message ProfileBase {
optional string first_name = 1; // 名字
optional string last_name = 2; // 姓氏
optional string email = 4; // 电子邮件
optional string mobile = 5; // 手机号码
optional string resetaurant = 6; // 餐厅
optional string company = 7; // 公司
}
message SubscriptionStatus {
NotificationEmail notification_email = 1; // 邮件通知设置
NotificationPhone notification_phone = 2; // 电话通知设置
}
message NotificationEmail {
bool order_update = 1; // 订单更新
bool newseleter = 2; // 新闻订阅
}
message NotificationPhone {
bool order_update = 1; // 订单更新
bool newseleter = 2; // 新闻订阅
}
message AddressObjectRequest {
int64 address_id = 1; // 地址ID
string address_name = 2; // 地址名称
}
message AddressIdRequest {
int64 address_id = 1; // 地址ID
}
message AddressDefaultRequest {
int64 address_id = 1; // 地址ID
int64 is_default = 2; // 是否默认
}
message AddressRequest {
int64 address_id = 1; // 地址ID已弃用
int64 is_default = 2; // 是否默认
string first_name = 3; // 名字
string last_name = 4; // 姓氏
string mobile = 5; // 手机号码
string zip_code = 6; // 邮政编码
string street = 7; // 街道
string suite = 8; // 套房
string city = 9; // 城市
string state = 10; // 省份
}
message PreLogoSearchSuggestionsRequest {
string keywords = 1; // 关键字
}
message PreLogoSearchRequest {
string zip_code = 1; // 邮编
string keywords = 2; // 关键字
}
message ContactUsRequest {
string name = 1; // 姓名
string email = 2; // 电子邮件
string phone = 3; // 电话号码
string message = 4; // 消息内容
}
2023-12-04 10:20:02 +00:00
//获取产品详情
2023-12-04 06:56:42 +00:00
message GetProductDetailReq{
int64 product_id = 1;
2023-12-04 08:26:44 +00:00
string template_tag = 2;
int64 selected_color_index = 3;
string logo = 4;
2023-12-05 10:02:04 +00:00
}