|
@@ -0,0 +1,53 @@
|
|
|
+package com.caimei365.user.service.impl;
|
|
|
+
|
|
|
+import com.caimei365.user.mapper.BaseMapper;
|
|
|
+import com.caimei365.user.mapper.ClubMapper;
|
|
|
+import com.caimei365.user.model.ResponseJson;
|
|
|
+import com.caimei365.user.model.po.ClubPo;
|
|
|
+import com.caimei365.user.model.po.UserPo;
|
|
|
+import com.caimei365.user.service.ClubService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Description
|
|
|
+ *
|
|
|
+ * @author : Charles
|
|
|
+ * @date : 2021/3/15
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+public class ClubServiceImpl implements ClubService {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ClubMapper clubMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据用户Id查询机构资料
|
|
|
+ *
|
|
|
+ * @param userId 用户Id
|
|
|
+ * @return Map(userPo, clubPo)
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Map<String, Object>> getClubUserInfo(Integer userId) {
|
|
|
+ UserPo user = clubMapper.getUserByUserId(userId);
|
|
|
+ if (user == null) {
|
|
|
+ return ResponseJson.error("用户信息不存在", null);
|
|
|
+ }
|
|
|
+ ClubPo club = clubMapper.getClubById(user.getClubId());
|
|
|
+ if (club == null) {
|
|
|
+ return ResponseJson.error("机构信息不存在", null);
|
|
|
+ }
|
|
|
+ Map<String, Object> map = new HashMap(2);
|
|
|
+ map.put("user", user);
|
|
|
+ map.put("club", club);
|
|
|
+ return ResponseJson.success(map);
|
|
|
+ }
|
|
|
+}
|