syntax = "proto3"; // package声明符,用来防止不同的消息类型有命名冲突 package pb_v1; // 用于生成指定语言go的包名称 option go_package = "property-applete-gateway/pb/v1"; message VoteTopicChoiceItem { string flag = 1; string text = 2; } message VoteTopic { // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题 int32 topic_type = 1; string topic_name = 2; // 总星数,当为评分题时有效 int32 star = 3; // 是否必选 bool must = 4; // 题目编号 int64 number = 5; // 选择题的选项 repeated VoteTopicChoiceItem choice_items = 6; } message VoteAddRequest { string title = 1; repeated string pics = 2; int64 start = 3; int64 end = 4; int64 garden_id = 5; repeated VoteTopic topics = 6; } message VoteAddReply { } message VoteUpdateRequest { int64 id = 1; string title = 2; repeated string pics = 3; int64 start = 4; int64 end = 5; int64 garden_id = 6; repeated VoteTopic topics = 7; } message VoteUpdateReply { } message VoteDelRequest { int64 id = 1; int64 garden_id = 2; } message VoteDelReply { } message VoteListRequest { int64 garden_id = 1; string title = 2; int64 page = 3; int64 page_size = 4; } message VoteItem { string title = 1; repeated string pics = 2; int64 start = 3; int64 end = 4; int64 id = 5; int64 created_at = 6; repeated VoteTopic topics = 7; int64 user_count = 8; } message VoteListReply { int64 total = 1; int64 page = 2; repeated VoteItem list = 3; } message VoteTopicAnswer { // 题目编号 int64 number = 1; // 题目类型 int32 topic_type = 2; // 问答题回答,当题目类型为问答题时有效 repeated string completion_answers = 3; // 选择题回答,当题目类型为选择题时有效 repeated string choice_answers = 4; // 评分题回答,当题目类型为评分题时有效 int32 star_answers = 5; } message VoteAddAnswerRequest { int64 id = 1; int64 garden_id = 2; int64 uid = 3; repeated VoteTopicAnswer answers = 4; } message VoteAddAnswerReply { } message VoteResultListRequest { int64 id = 1; int64 garden_id = 2; int64 page = 3; int64 page_size = 4; } message VoteResultData { // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题 int32 topic_type = 1; string topic_name = 2; // 总星数,当为评分题时有效 int32 star = 3; // 是否必选 bool must = 4; // 题目编号 int64 number = 5; // 选择题的选项 repeated VoteTopicChoiceItem choice_items = 6; // 问答题回答,当题目类型为问答题时有效 repeated string completion_answers = 7; // 选择题回答,当题目类型为选择题时有效 repeated string choice_answers = 8; // 评分题回答,当题目类型为评分题时有效 int32 star_answers = 9; } message VoteResultUserAnswerItem { // 用户uid int64 uid = 1; repeated VoteResultData answers = 2; } message VoteResultListReply { int64 page = 1; int64 total = 2; repeated VoteResultUserAnswerItem list = 3; } message VoteResultStatisticRequest { int64 id = 1; int64 garden_id = 2; } message VoteResultStatisticChoice { // 选择选项标识 string flag = 1; // 该选项被选的用户 int32 count = 2; } message VoteResultStatisticStar { // 评分星数 int32 star = 1; // 评该星数的用户数量 int32 count = 2; } message VoteResultStatisticItem { // 题目类型 1 填空题 2 单选题 3 多选题 4 评分题 int32 topic_type = 1; string topic_name = 2; // 总星数,当为评分题时有效 int32 star = 3; // 是否必选 bool must = 4; // 题目编号 int64 number = 5; // 选择题的选项内容 repeated VoteTopicChoiceItem choice_items = 6; // 选择题的选项回答统计,当题目类型为选择题时有效 repeated VoteResultStatisticChoice choice_statistic = 7; // 评分题的分数回答统计,当题目类型为评分题时有效 repeated VoteResultStatisticStar star_statistic = 8; // 平均分, 当题目类型为评分题时有效 int32 star_avg = 9; } message VoteResultStatisticReply { // 题目统计 repeated VoteResultStatisticItem list = 1; }