|
@@ -4,26 +4,19 @@ import (
|
|
|
"aiChat/api/aiSearch/v1"
|
|
|
"aiChat/internal/model"
|
|
|
"aiChat/utility"
|
|
|
- "context"
|
|
|
- "fmt"
|
|
|
-
|
|
|
"app.yhyue.com/moapp/jybase/encrypt"
|
|
|
+ "context"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
)
|
|
|
|
|
|
func (c *ControllerV1) BiddingList(ctx context.Context, req *v1.BiddingListReq) (res *v1.BiddingListRes, err error) {
|
|
|
- var hTmp []v1.ResBidding
|
|
|
+ hTmp := []v1.ResBidding{}
|
|
|
session := model.SessionCtx.Get(ctx).JSession
|
|
|
- if session.PositionId <= 0 {
|
|
|
- return nil, fmt.Errorf("请登录")
|
|
|
- }
|
|
|
chatId := gconv.Int64(encrypt.SE.Decode4HexByCheck(req.ChatId))
|
|
|
if chatId == 0 {
|
|
|
return &v1.BiddingListRes{
|
|
|
- ErrorCode: 0,
|
|
|
- ErrorMsg: "",
|
|
|
- Data: hTmp,
|
|
|
+ Data: hTmp,
|
|
|
}, nil
|
|
|
}
|
|
|
err = g.Model("ai_search_bidding").Where("chat_id = ? and position_id=?", chatId, session.PositionId).OrderDesc("create_time").Scan(&hTmp)
|
|
@@ -37,9 +30,8 @@ func (c *ControllerV1) BiddingList(ctx context.Context, req *v1.BiddingListReq)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return &v1.BiddingListRes{
|
|
|
- ErrorCode: 0,
|
|
|
- ErrorMsg: "",
|
|
|
- Data: hTmp,
|
|
|
+ Data: hTmp,
|
|
|
}, nil
|
|
|
}
|