Merge pull request 'feat-IRONFANS-70' (#258) from feat-IRONFANS-70 into test
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/258
This commit is contained in:
commit
381cd689ba
|
@ -186,3 +186,23 @@ type OpHeadResp struct {
|
||||||
base.BaseResponse
|
base.BaseResponse
|
||||||
Data *OpHeadData `json:"data"`
|
Data *OpHeadData `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// op 列表
|
||||||
|
type OpCountByZidReq struct {
|
||||||
|
base.BaseRequest
|
||||||
|
Zid *int64 `json:"zid"` // 空间id
|
||||||
|
MType *int64 `json:"m_type"` // 媒体类型
|
||||||
|
CType *int64 `json:"c_type"` // 付费模式
|
||||||
|
IsIronfanVisible *int64 `json:"is_ironfan_visible"` // 是否铁粉可见
|
||||||
|
CtUpperBound *int64 `json:"ct_upper_bound"` // 创建时间上界,闭区间
|
||||||
|
CtLowerBound *int64 `json:"ct_lower_bound"` // 创建时间下界,开区间,可为0
|
||||||
|
Status *int64 `json:"status"` // 状态
|
||||||
|
}
|
||||||
|
|
||||||
|
type OpCountByZidData struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type OpLCountByZidResp struct {
|
||||||
|
base.BaseResponse
|
||||||
|
Data *OpListByMidData `json:"data"`
|
||||||
|
}
|
||||||
|
|
|
@ -3960,9 +3960,11 @@ func (m *Mongo) GetZoneMomentListByZid(ctx *gin.Context, req *zonemomentproto.Op
|
||||||
orClause = append(orClause, qmgo.M{
|
orClause = append(orClause, qmgo.M{
|
||||||
"is_headed": consts.IsHeaded_Yes,
|
"is_headed": consts.IsHeaded_Yes,
|
||||||
})
|
})
|
||||||
orClause = append(orClause, qmgo.M{
|
if len(ctClause) != 0 {
|
||||||
"ct": ctClause,
|
orClause = append(orClause, qmgo.M{
|
||||||
})
|
"ct": ctClause,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
query["$or"] = orClause
|
query["$or"] = orClause
|
||||||
err := col.Find(ctx, query).Sort("-is_headed", "-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
err := col.Find(ctx, query).Sort("-is_headed", "-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
||||||
|
@ -4007,6 +4009,37 @@ func (m *Mongo) GetZoneMomentListByMid(ctx *gin.Context, req *zonemomentproto.Op
|
||||||
return list, err
|
return list, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Mongo) GetZoneMomentCountByZid(ctx *gin.Context, req *zonemomentproto.OpCountByZidReq) (int64, error) {
|
||||||
|
col := m.getColZoneMoment()
|
||||||
|
query := qmgo.M{
|
||||||
|
"zid": util.DerefInt64(req.Zid),
|
||||||
|
"del_flag": 0,
|
||||||
|
}
|
||||||
|
if req.MType != nil {
|
||||||
|
query["m_type"] = util.DerefInt64(req.MType)
|
||||||
|
}
|
||||||
|
if req.CType != nil {
|
||||||
|
query["c_type"] = util.DerefInt64(req.CType)
|
||||||
|
}
|
||||||
|
if req.IsIronfanVisible != nil {
|
||||||
|
query["is_ironfan_visible"] = util.DerefInt64(req.IsIronfanVisible)
|
||||||
|
}
|
||||||
|
if req.Status != nil {
|
||||||
|
query["status"] = util.DerefInt64(req.Status)
|
||||||
|
}
|
||||||
|
ctClause := qmgo.M{}
|
||||||
|
if req.CtLowerBound != nil {
|
||||||
|
ctClause["$gt"] = util.DerefInt64(req.CtLowerBound)
|
||||||
|
}
|
||||||
|
if req.CtUpperBound != nil {
|
||||||
|
ctClause["$lte"] = util.DerefInt64(req.CtUpperBound)
|
||||||
|
}
|
||||||
|
if len(ctClause) != 0 {
|
||||||
|
query["ct"] = ctClause
|
||||||
|
}
|
||||||
|
return col.Find(ctx, query).Count()
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Mongo) ThumbsUpZoneMoment(ctx *gin.Context, req *zonemomentproto.OpZoneMomentThumbsUpReq) (err error) {
|
func (m *Mongo) ThumbsUpZoneMoment(ctx *gin.Context, req *zonemomentproto.OpZoneMomentThumbsUpReq) (err error) {
|
||||||
col := m.getColMoment()
|
col := m.getColMoment()
|
||||||
change := qmgo.Change{
|
change := qmgo.Change{
|
||||||
|
|
Loading…
Reference in New Issue