CHG: house transaction controller
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 25s
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 25s
This commit is contained in:
parent
69137f366c
commit
a2f60c3410
26
internal/controller/house/transaction.go
Normal file
26
internal/controller/house/transaction.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package house
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
transactionv1 "service.xpcool.com/api/house/transaction"
|
||||||
|
transaction "service.xpcool.com/internal/service/house/transaction"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TransactionList 分页查询成交记录。
|
||||||
|
func (c *Controller) TransactionList(ctx context.Context, req *transactionv1.TransactionListReq) (res *transactionv1.TransactionListRes, err error) {
|
||||||
|
list, total, err := transaction.Transaction().List(ctx, req.Page, req.Size, req.Region, req.Keyword)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
out := make([]*transactionv1.TransactionItem, 0, len(list))
|
||||||
|
for i := range list {
|
||||||
|
v := &list[i]
|
||||||
|
out = append(out, &transactionv1.TransactionItem{
|
||||||
|
Id: v.Id, CommunityId: v.CommunityId, CommunityName: v.CommunityName,
|
||||||
|
Layout: v.Layout, Area: v.Area, DealPrice: v.DealPrice, DealUnitPrice: v.DealUnitPrice,
|
||||||
|
ListDays: v.ListDays, DealDate: v.DealDate, Source: v.Source,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return &transactionv1.TransactionListRes{List: out, Total: total}, nil
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user