新增了获取问题解锁状态
This commit is contained in:
+5
-40
@@ -32,9 +32,9 @@ type QuestionDto struct {
|
||||
|
||||
// QuestionBuyStatusDto 获取问题解锁状态
|
||||
type QuestionBuyStatusDto struct {
|
||||
QuestionId string `json:"buy_status"` // 解锁状态(0:否 1:是)
|
||||
QuestionTitle *int `json:"buy_mode"` // 解锁方式(1:单项有效期 2:会员)
|
||||
ValidDate *time.Time `json:"valid_date"` // 到期时间
|
||||
BuyStatus int `json:"buy_status"` // 解锁状态(0:否 1:是)
|
||||
BuyMode int `json:"buy_mode"` // 解锁方式(1:单项有效期 2:会员)
|
||||
ValidDate string `json:"valid_date"` // 到期时间
|
||||
}
|
||||
|
||||
// GetQuestionDto 详情-问题
|
||||
@@ -60,42 +60,7 @@ func GetQuestionDto(m *model.Question) *QuestionDto {
|
||||
}
|
||||
}
|
||||
|
||||
// GetQuestionListDto 列表-问题
|
||||
func GetQuestionListDto(m []*model.Question) []*QuestionDto {
|
||||
// 处理返回值
|
||||
responses := make([]*QuestionDto, len(m))
|
||||
|
||||
if len(m) > 0 {
|
||||
for i, v := range m {
|
||||
response := &QuestionDto{
|
||||
QuestionId: fmt.Sprintf("%d", v.QuestionId),
|
||||
QuestionTitle: v.QuestionTitle,
|
||||
QuestionSubtitle: v.QuestionSubtitle,
|
||||
QuestionIden: v.QuestionIden,
|
||||
QuestionStatus: v.QuestionStatus,
|
||||
IsHide: v.IsHide,
|
||||
IsRecommend: v.IsRecommend,
|
||||
ClickCount: v.ClickCount,
|
||||
SubmitCount: v.SubmitCount,
|
||||
PayCount: v.PayCount,
|
||||
Price: v.Price,
|
||||
DiscountPrice: v.DiscountPrice,
|
||||
DiscountEndTime: v.DiscountEndTime,
|
||||
QuestionBrief: v.QuestionBrief,
|
||||
QuestionExplain: v.QuestionExplain,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
// GetHotQuestionListDto 列表-热榜问题
|
||||
// GetHotQuestionListDto 列表-热榜
|
||||
func GetHotQuestionListDto(m []*model.Question) []*QuestionDto {
|
||||
// 处理返回值
|
||||
responses := make([]*QuestionDto, len(m))
|
||||
@@ -170,7 +135,7 @@ func GetGuessUserLikeListDto(m []*model.Question) []*QuestionDto {
|
||||
return responses
|
||||
}
|
||||
|
||||
// GetQuestionPageListDto 列表-分页问题
|
||||
// GetQuestionPageListDto 列表-分页
|
||||
func GetQuestionPageListDto(m []*model.Question) []*QuestionDto {
|
||||
// 处理返回值
|
||||
responses := make([]*QuestionDto, len(m))
|
||||
|
||||
Reference in New Issue
Block a user