|
@@ -3,6 +3,10 @@ package com.ruoyi.web.controller.api;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
+import com.ruoyi.app.domain.TbMyProfile;
|
|
|
+import com.ruoyi.app.domain.TbProfileImg;
|
|
|
+import com.ruoyi.app.service.ITbMyProfileService;
|
|
|
+import com.ruoyi.app.service.ITbProfileImgService;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -18,11 +22,13 @@ import com.ruoyi.system.service.ITPersonalMessageService;
|
|
|
import com.ruoyi.system.service.ITPersonalModelService;
|
|
|
import com.ruoyi.system.service.ITPersonalPageService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -42,6 +48,10 @@ public class ApiTemplateController extends BaseController {
|
|
|
private ITPersonalModelService modelService;
|
|
|
@Autowired
|
|
|
private ITPersonalMessageService messageService;
|
|
|
+ @Autowired
|
|
|
+ private ITbMyProfileService iTbMyProfileService;
|
|
|
+ @Autowired
|
|
|
+ private ITbProfileImgService profileImgService;
|
|
|
/**
|
|
|
* 查询个人页 图片列表
|
|
|
*/
|
|
@@ -130,4 +140,37 @@ public class ApiTemplateController extends BaseController {
|
|
|
List<TPersonalMessage> list = messageService.list(lqw);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("个人详情列表")
|
|
|
+ @GetMapping("/profileList")
|
|
|
+ public AjaxResult list(TbMyProfile tbMyProfile) {
|
|
|
+ Long appUserId = tbMyProfile.getAppUserId();
|
|
|
+ if (appUserId == null){
|
|
|
+ return AjaxResult.error("参数为空");
|
|
|
+ }
|
|
|
+ List<TbMyProfile> profileList = iTbMyProfileService.list(new LambdaQueryWrapper<TbMyProfile>()
|
|
|
+ .eq(TbMyProfile::getAppUserId, appUserId)
|
|
|
+ );
|
|
|
+ if (profileList.size() > 0) {
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ profileList.forEach(item -> {
|
|
|
+ ids.add(item.getId());
|
|
|
+ });
|
|
|
+ List<TbProfileImg> imgList = profileImgService.list(new LambdaQueryWrapper<TbProfileImg>()
|
|
|
+ .in(TbProfileImg::getProfileId, ids)
|
|
|
+ );
|
|
|
+ if (imgList.size() > 0) {
|
|
|
+ profileList.forEach(item -> {
|
|
|
+ List<TbProfileImg> newList = new ArrayList<>();
|
|
|
+ imgList.forEach(img -> {
|
|
|
+ if (item.getId().equals(img.getProfileId())) {
|
|
|
+ newList.add(img);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.setImgList(newList);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(profileList);
|
|
|
+ }
|
|
|
}
|