权限/合伙人信息,中版
This commit is contained in:
parent
48fbaf151a
commit
e895e3d4bb
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.domain.Result;
|
||||
import com.ruoyi.system.domain.TbUserImg;
|
||||
import com.ruoyi.system.domain.TbUserMatch;
|
||||
import com.ruoyi.system.domain.TbUserSingle;
|
||||
import com.ruoyi.system.service.ITbUserImgService;
|
||||
import com.ruoyi.system.service.ITbUserMatchService;
|
||||
import com.ruoyi.system.service.ITbUserSingleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>登陆相关接口</p>
|
||||
* @author clunt
|
||||
*/
|
||||
@Api(tags = "App*合伙人接口")
|
||||
@RestController
|
||||
@RequestMapping(value = "/app/match")
|
||||
public class TbUserMatchAppController {
|
||||
|
||||
@Autowired
|
||||
private ITbUserMatchService tbUserMatchService;
|
||||
|
||||
@Autowired
|
||||
private ITbUserImgService tbUserImgService;
|
||||
|
||||
@Autowired
|
||||
private ITbUserSingleService tbUserSingleService;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value = "填写合伙人信息", httpMethod = "POST")
|
||||
public Result<String> addSave(@RequestBody TbUserMatch tbUserMatch)
|
||||
{
|
||||
int effectiveRows = tbUserMatchService.insertTbUserMatch(tbUserMatch);
|
||||
if(effectiveRows > 0){
|
||||
return Result.success("填写合伙人信息成功!");
|
||||
}else {
|
||||
return Result.error("填写合伙人信息失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/edit")
|
||||
@ApiOperation(value = "更新合伙人信息", httpMethod = "POST")
|
||||
public Result<String> editSave(@RequestBody TbUserMatch tbUserMatch)
|
||||
{
|
||||
int effectiveRows = tbUserMatchService.updateTbUserMatch(tbUserMatch);
|
||||
if(effectiveRows > 0){
|
||||
return Result.success("更新合伙人信息成功!");
|
||||
}else {
|
||||
return Result.error("更新合伙人信息失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/recommend")
|
||||
@ApiOperation(value = "获取合伙人推荐用户.第一版不排除自己", httpMethod = "POST")
|
||||
@ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示的条数", required = true, dataType = "int") })
|
||||
public Result<PageInfo<TbUserSingle>> recommend(@RequestBody TbUserSingle tbUserSingle,
|
||||
@RequestParam("pageNum") int pageNum,
|
||||
@RequestParam("pageSize") int pageSize) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<TbUserSingle> list = tbUserSingleService.selectTbUserSingleList(tbUserSingle);
|
||||
list.forEach(model->{
|
||||
if(model.getBirthday() != null){
|
||||
model.setAge(DateUtil.ageOfNow(model.getBirthday()));
|
||||
}
|
||||
model.setTbUserImgList(tbUserImgService.lambdaQuery().eq(TbUserImg::getUserId, model.getUserId()).list());
|
||||
});
|
||||
return Result.success(PageInfo.of(list));
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping("/getByUserId")
|
||||
@ApiOperation(value = "通过userId获取合伙人信息", httpMethod = "POST")
|
||||
public Result<TbUserMatch> getByUserId(@RequestBody TbUserMatch tbUserMatch)
|
||||
{
|
||||
TbUserMatch userMatch = tbUserMatchService.lambdaQuery().eq(TbUserMatch::getUserId, tbUserMatch.getUserId()).one();
|
||||
if(userMatch != null){
|
||||
userMatch.setTbUserImgList(tbUserImgService.lambdaQuery().eq(TbUserImg::getUserId, tbUserMatch.getUserId()).list());
|
||||
}
|
||||
return Result.success(userMatch);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdcardUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.domain.Result;
|
||||
|
|
|
|||
|
|
@ -310,6 +310,8 @@ public class ShiroConfig
|
|||
filterChainDefinitionMap.put("/app/follow/**", "anon");
|
||||
// app支付接口
|
||||
filterChainDefinitionMap.put("/app/matchOrder/**", "anon");
|
||||
// app合伙人推荐接口
|
||||
filterChainDefinitionMap.put("/app/match/**", "anon");
|
||||
// 系统权限列表
|
||||
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
|
@ -7,6 +8,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 合伙人信息对象 tb_user_match
|
||||
*
|
||||
|
|
@ -63,5 +66,8 @@ public class TbUserMatch extends BaseEntity
|
|||
@ApiModelProperty(value = "资源群体")
|
||||
private String matchContent;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "合伙人图片资料")
|
||||
private List<TbUserImg> tbUserImgList;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue