rcvr.go 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package impl
  4. import (
  5. "context"
  6. "property-household/impl/v1/gate"
  7. "property-household/impl/v1/house"
  8. "property-household/impl/v1/house_rent"
  9. "property-household/impl/v1/user"
  10. "property-household/pb"
  11. pb_v1 "property-household/pb/v1"
  12. "git.getensh.com/common/gopkgs/tasker/rpctasker"
  13. "google.golang.org/grpc"
  14. )
  15. // 具体实现
  16. type Rcvr struct {
  17. }
  18. func Register(s *grpc.Server) {
  19. pb.RegisterHouseholdServer(s, &Rcvr{})
  20. }
  21. // 登录
  22. func (c *Rcvr) Login(ctx context.Context, req *pb_v1.LoginRequest) (reply *pb_v1.LoginReply, err error) {
  23. t1 := func() error {
  24. reply, err = user.Login(ctx, req)
  25. return err
  26. }
  27. return reply, rpctasker.Exec(ctx, t1)
  28. }
  29. func (c *Rcvr) UserWxPublicAdd(ctx context.Context, req *pb_v1.UserWxPublicAddRequest) (reply *pb_v1.UserWxPublicAddReply, err error) {
  30. t1 := func() error {
  31. reply, err = user.UserWxPublicAdd(ctx, req)
  32. return err
  33. }
  34. return reply, rpctasker.Exec(ctx, t1)
  35. }
  36. func (c *Rcvr) WxPublicEmptyUnionId(ctx context.Context, req *pb_v1.WxPublicEmptyUnionIdRequest) (reply *pb_v1.WxPublicEmptyUnionIdReply, err error) {
  37. t1 := func() error {
  38. reply, err = user.WxPublicEmptyUnionId(ctx, req)
  39. return err
  40. }
  41. return reply, rpctasker.Exec(ctx, t1)
  42. }
  43. func (c *Rcvr) HouseholdHouses(ctx context.Context, req *pb_v1.HouseholdHousesRequest) (reply *pb_v1.HouseholdHousesReply, err error) {
  44. t1 := func() error {
  45. reply, err = house.HouseholdHouses(ctx, req)
  46. return err
  47. }
  48. return reply, rpctasker.Exec(ctx, t1)
  49. }
  50. func (c *Rcvr) HouseholdRefuse(ctx context.Context, req *pb_v1.HouseholdRefuseRequest) (reply *pb_v1.HouseholdRefuseReply, err error) {
  51. t1 := func() error {
  52. reply, err = house.HouseholdRefuse(ctx, req)
  53. return err
  54. }
  55. return reply, rpctasker.Exec(ctx, t1)
  56. }
  57. func (c *Rcvr) HouseholdWaitCount(ctx context.Context, req *pb_v1.HouseholdWaitCountRequest) (reply *pb_v1.HouseholdWaitCountReply, err error) {
  58. t1 := func() error {
  59. reply, err = house.HouseholdWaitCount(ctx, req)
  60. return err
  61. }
  62. return reply, rpctasker.Exec(ctx, t1)
  63. }
  64. func (c *Rcvr) UserInfo(ctx context.Context, req *pb_v1.UserInfoRequest) (reply *pb_v1.UserInfoReply, err error) {
  65. t1 := func() error {
  66. reply, err = user.UserInfo(ctx, req)
  67. return err
  68. }
  69. return reply, rpctasker.Exec(ctx, t1)
  70. }
  71. func (c *Rcvr) RealNameAuth(ctx context.Context, req *pb_v1.RealNameAuthRequest) (reply *pb_v1.RealNameAuthReply, err error) {
  72. t1 := func() error {
  73. reply, err = user.RealNameAuth(ctx, req)
  74. return err
  75. }
  76. return reply, rpctasker.Exec(ctx, t1)
  77. }
  78. func (c *Rcvr) UserUpdateNickName(ctx context.Context, req *pb_v1.UserUpdateNickNameRequest) (reply *pb_v1.UserUpdateNickNameReply, err error) {
  79. t1 := func() error {
  80. reply, err = user.UserUpdateNickName(ctx, req)
  81. return err
  82. }
  83. return reply, rpctasker.Exec(ctx, t1)
  84. }
  85. func (c *Rcvr) HouseholdList(ctx context.Context, req *pb_v1.HouseholdListRequest) (reply *pb_v1.HouseholdListReply, err error) {
  86. t1 := func() error {
  87. reply, err = house.HouseholdList(ctx, req)
  88. return err
  89. }
  90. return reply, rpctasker.Exec(ctx, t1)
  91. }
  92. func (c *Rcvr) HouseholdApply(ctx context.Context, req *pb_v1.HouseholdApplyRequest) (reply *pb_v1.HouseholdApplyReply, err error) {
  93. t1 := func() error {
  94. reply, err = house.HouseholdApply(ctx, req)
  95. return err
  96. }
  97. return reply, rpctasker.Exec(ctx, t1)
  98. }
  99. func (c *Rcvr) HouseholdDelApply(ctx context.Context, req *pb_v1.HouseholdDelApplyRequest) (reply *pb_v1.HouseholdDelApplyReply, err error) {
  100. t1 := func() error {
  101. reply, err = house.HouseholdDelApply(ctx, req)
  102. return err
  103. }
  104. return reply, rpctasker.Exec(ctx, t1)
  105. }
  106. func (c *Rcvr) HouseholdGardenNameChange(ctx context.Context, req *pb_v1.HouseholdGardenNameChangeRequest) (reply *pb_v1.HouseholdGardenNameChangeReply, err error) {
  107. t1 := func() error {
  108. reply, err = house.HouseholdGardenNameChange(ctx, req)
  109. return err
  110. }
  111. return reply, rpctasker.Exec(ctx, t1)
  112. }
  113. func (c *Rcvr) HouseholdApprove(ctx context.Context, req *pb_v1.HouseholdApproveRequest) (reply *pb_v1.HouseholdApproveReply, err error) {
  114. t1 := func() error {
  115. reply, err = house.HouseholdApprove(ctx, req)
  116. return err
  117. }
  118. return reply, rpctasker.Exec(ctx, t1)
  119. }
  120. func (c *Rcvr) HouseholdUserList(ctx context.Context, req *pb_v1.HouseholdUserListRequest) (reply *pb_v1.HouseholdUserListReply, err error) {
  121. t1 := func() error {
  122. reply, err = house.HouseholdUserList(ctx, req)
  123. return err
  124. }
  125. return reply, rpctasker.Exec(ctx, t1)
  126. }
  127. func (c *Rcvr) HouseRentApply(ctx context.Context, req *pb_v1.HouseRentApplyRequest) (reply *pb_v1.HouseRentApplyReply, err error) {
  128. t1 := func() error {
  129. reply, err = house_rent.HouseRentApply(ctx, req)
  130. return err
  131. }
  132. return reply, rpctasker.Exec(ctx, t1)
  133. }
  134. func (c *Rcvr) HouseRentApprove(ctx context.Context, req *pb_v1.HouseRentApproveRequest) (reply *pb_v1.HouseRentApproveReply, err error) {
  135. t1 := func() error {
  136. reply, err = house_rent.HouseRentApprove(ctx, req)
  137. return err
  138. }
  139. return reply, rpctasker.Exec(ctx, t1)
  140. }
  141. func (c *Rcvr) HouseRentUpdate(ctx context.Context, req *pb_v1.HouseRentUpdateRequest) (reply *pb_v1.HouseRentUpdateReply, err error) {
  142. t1 := func() error {
  143. reply, err = house_rent.HouseRentUpdate(ctx, req)
  144. return err
  145. }
  146. return reply, rpctasker.Exec(ctx, t1)
  147. }
  148. func (c *Rcvr) HouseRentDown(ctx context.Context, req *pb_v1.HouseRentDownRequest) (reply *pb_v1.HouseRentDownReply, err error) {
  149. t1 := func() error {
  150. reply, err = house_rent.HouseRentDown(ctx, req)
  151. return err
  152. }
  153. return reply, rpctasker.Exec(ctx, t1)
  154. }
  155. func (c *Rcvr) HouseRentList(ctx context.Context, req *pb_v1.HouseRentListRequest) (reply *pb_v1.HouseRentListReply, err error) {
  156. t1 := func() error {
  157. reply, err = house_rent.HouseRentList(ctx, req)
  158. return err
  159. }
  160. return reply, rpctasker.Exec(ctx, t1)
  161. }
  162. func (c *Rcvr) HouseRentChangeField(ctx context.Context, req *pb_v1.HouseRentChangeFieldRequest) (reply *pb_v1.HouseRentChangeFieldReply, err error) {
  163. t1 := func() error {
  164. reply, err = house_rent.HouseRentChangeField(ctx, req)
  165. return err
  166. }
  167. return reply, rpctasker.Exec(ctx, t1)
  168. }
  169. func (c *Rcvr) GateQcode(ctx context.Context, req *pb_v1.GateQcodeRequest) (reply *pb_v1.GateQcodeReply, err error) {
  170. t1 := func() error {
  171. reply, err = gate.GateQcode(ctx, req)
  172. return err
  173. }
  174. return reply, rpctasker.Exec(ctx, t1)
  175. }
  176. // 住户退出房屋
  177. func (c *Rcvr) HouseholdDelHouse(ctx context.Context, req *pb_v1.HouseholdDelHouseRequest) (reply *pb_v1.HouseholdDelHouseReply, err error) {
  178. t1 := func() error {
  179. reply, err = house.HouseholdDelHouse(ctx, req)
  180. return err
  181. }
  182. return reply, rpctasker.Exec(ctx, t1)
  183. }
  184. // 租房预约看房
  185. func (c *Rcvr) HouseRentAppointmentAdd(ctx context.Context, req *pb_v1.HouseRentAppointmentAddRequest) (reply *pb_v1.HouseRentAppointmentAddReply, err error) {
  186. t1 := func() error {
  187. reply, err = house_rent.HouseRentAppointmentAdd(ctx, req)
  188. return err
  189. }
  190. return reply, rpctasker.Exec(ctx, t1)
  191. }
  192. // 租房预约列表
  193. func (c *Rcvr) HouseRentAppointmentList(ctx context.Context, req *pb_v1.HouseRentAppointmentListRequest) (reply *pb_v1.HouseRentAppointmentListReply, err error) {
  194. t1 := func() error {
  195. reply, err = house_rent.HouseRentAppointmentList(ctx, req)
  196. return err
  197. }
  198. return reply, rpctasker.Exec(ctx, t1)
  199. }
  200. // 删除租房预约
  201. func (c *Rcvr) HouseRentAppointmentDel(ctx context.Context, req *pb_v1.HouseRentAppointmentDelRequest) (reply *pb_v1.HouseRentAppointmentDelReply, err error) {
  202. t1 := func() error {
  203. reply, err = house_rent.HouseRentAppointmentDel(ctx, req)
  204. return err
  205. }
  206. return reply, rpctasker.Exec(ctx, t1)
  207. }
  208. func (c *Rcvr) HouseRentAppointmentStatus(ctx context.Context, req *pb_v1.HouseRentAppointmentStatusRequest) (reply *pb_v1.HouseRentAppointmentStatusReply, err error) {
  209. t1 := func() error {
  210. reply, err = house_rent.HouseRentAppointmentStatus(ctx, req)
  211. return err
  212. }
  213. return reply, rpctasker.Exec(ctx, t1)
  214. }