286 lines
8.1 KiB
Protocol Buffer
286 lines
8.1 KiB
Protocol Buffer
syntax = "proto3"; //版本声明,使用v3版本
|
||
|
||
package fsservice;
|
||
option go_package = "gitee.com/fusenpack/fusen-service;service";
|
||
|
||
// 导入google/api/annotations.proto 注释依赖
|
||
import "google/api/annotations.proto";
|
||
import "service/basic.proto";
|
||
import "google/protobuf/struct.proto";
|
||
import "google/protobuf/any.proto";
|
||
|
||
//定义服务
|
||
service info {
|
||
// 用户信息
|
||
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: "*"
|
||
};
|
||
}
|
||
|
||
}
|
||
|
||
//定义产品服务
|
||
service product {
|
||
// 产品详情
|
||
rpc GetProductDetail(GetProductDetailReq) returns (GetProductDetailRsp) {
|
||
option (google.api.http) = {
|
||
get: "/api/product/get_product_detail"
|
||
};
|
||
}
|
||
}
|
||
|
||
message UserInfoRequest {
|
||
repeated string module = 1; // 模块
|
||
}
|
||
|
||
message QueryProfileRequest {
|
||
string top_key = 1; // 首键
|
||
}
|
||
|
||
message QueryProfileResponse {
|
||
google.protobuf.Struct data = 1;
|
||
}
|
||
|
||
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; // 消息内容
|
||
}
|
||
|
||
//获取产品详情
|
||
message GetProductDetailReq{
|
||
int64 product_id = 1;
|
||
string template_tag = 2;
|
||
int64 selected_color_index = 3;
|
||
string logo = 4;
|
||
}
|
||
message GetProductDetailRsp {
|
||
string logo = 1; //logo
|
||
TemplateTagColorInfo template_tag_color_info = 2; //标签颜色信息
|
||
ProductInfo product_info = 3; //产品基本信息
|
||
google.protobuf.ListValue base_colors = 4; //一些返回写死的颜色
|
||
repeated SizeInfo size_list = 5; //尺寸相关信息
|
||
}
|
||
|
||
message SizeInfo {
|
||
int64 id =1; //尺寸id
|
||
int64 is_default = 2; //是否默认显示
|
||
google.protobuf.Struct title = 3; //尺寸标题信息
|
||
string capacity = 4; //尺寸名称
|
||
int64 parts_can_deleted = 5; //配件是否可删除
|
||
int64 is_hot = 6; //是否热门
|
||
string min_price = 7; //最低价
|
||
google.protobuf.Struct template_info = 8; //模板相关信息
|
||
ModelInfo model_info = 9; //模型相关信息
|
||
repeated FittingInfo fitting_list = 10; //配件相关信息
|
||
}
|
||
message FittingInfo {
|
||
int64 id = 1; //配件id
|
||
int64 is_hot = 2; //是否热门
|
||
string material_image = 3;//配件材质图
|
||
google.protobuf.Struct design_info = 4; //配件设计信息
|
||
string price = 5; //配件价格
|
||
string name = 6; //配件名
|
||
int64 is_default = 7; //是否默认的配件
|
||
}
|
||
message ModelInfo {
|
||
int64 id = 1; //模型id
|
||
google.protobuf.Struct design_info = 2; //模型设计信息
|
||
LightInfo light_info = 3; //灯光信息
|
||
}
|
||
message LightInfo {
|
||
int64 id = 1; //灯光id
|
||
google.protobuf.Struct light_design_info = 2; //灯光设计信息
|
||
}
|
||
message ProductInfo {
|
||
int64 id = 1; //产品id
|
||
string description = 2; //产品描述
|
||
int64 product_type = 3; //产品类型id
|
||
string product_type_name = 4;//产品类型名称
|
||
string title = 5; //产品标题
|
||
int64 is_env = 6; //是否环保
|
||
int64 is_micro = 7; //是否可微波炉
|
||
int64 is_customization = 8; //是否可定制产品
|
||
google.protobuf.Struct website_unit = 9; //产品前台网站单位
|
||
}
|
||
message TemplateTagColorInfo {
|
||
google.protobuf.ListValue colors = 1; //传入logo对应的算法颜色组
|
||
int64 selected_color_index = 2; //选择的模板标签的颜色索引值
|
||
google.protobuf.Struct template_tag_groups = 3; //模板标签分组信息
|
||
}
|
||
|