确认收藏
parent
d5db372eae
commit
db84feadaf
|
|
@ -50,15 +50,17 @@ public class AppLoginController {
|
|||
@ApiOperation(value = "注册" , notes = "注册")
|
||||
public R<?> register(@RequestBody RegisterForm registerForm) {
|
||||
AppUser appUser = appUserService.selectAppUserByPhone(registerForm.getPhoneNumber());
|
||||
AppRegister register = appRegisterService.selectAppRegisterByphone(registerForm.getPhoneNumber());
|
||||
Assert.notNull(registerForm.getSchoolId(), "学校id不能为空");
|
||||
Assert.isNull(appUser, "手机号已注册");
|
||||
if (StringUtils.isNotEmpty(registerForm.getEmail())) {
|
||||
|
||||
}
|
||||
Assert.isNull(register, "手机号已提交审核,请勿多次提交");
|
||||
// if (StringUtils.isNotEmpty(registerForm.getEmail())) {
|
||||
//
|
||||
// }
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
||||
int i = appRegisterService.insertAppRegister(appRegister);
|
||||
redisService.deleteObject(registerForm.getPhoneNumber());
|
||||
// redisService.deleteObject(registerForm.getPhoneNumber());
|
||||
Assert.isTrue(i > 0, "注册失败");
|
||||
return R.ok(null,"注册成功,请等待审核结果!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class AppUserCollectController extends BaseController
|
|||
/**
|
||||
* 查询用户收藏列表
|
||||
*/
|
||||
@RequiresPermissions("app:collect:list")
|
||||
// @RequiresPermissions("app:collect:list")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value = "查询用户收藏", notes = "查询用户收藏", httpMethod = "GET")
|
||||
public TableDataInfo list(AppUserCollect appUserCollect)
|
||||
|
|
@ -62,7 +62,7 @@ public class AppUserCollectController extends BaseController
|
|||
/**
|
||||
* 导出用户收藏列表
|
||||
*/
|
||||
@RequiresPermissions("app:collect:export")
|
||||
// @RequiresPermissions("app:collect:export")
|
||||
@Log(title = "用户收藏", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AppUserCollect appUserCollect)
|
||||
|
|
@ -75,7 +75,7 @@ public class AppUserCollectController extends BaseController
|
|||
/**
|
||||
* 获取用户收藏详细信息
|
||||
*/
|
||||
@RequiresPermissions("app:collect:query")
|
||||
// @RequiresPermissions("app:collect:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "获取用户收藏详细信息", notes = "获取用户收藏详细信息", httpMethod = "GET")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
|
|
@ -86,7 +86,7 @@ public class AppUserCollectController extends BaseController
|
|||
/**
|
||||
* 新增用户收藏
|
||||
*/
|
||||
@RequiresPermissions("app:collect:add")
|
||||
// @RequiresPermissions("app:collect:add")
|
||||
@ApiOperation(value = "新增用户收藏", notes = "新增用户收藏", httpMethod = "POST")
|
||||
@Log(title = "用户收藏", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
|
|
@ -98,7 +98,7 @@ public class AppUserCollectController extends BaseController
|
|||
/**
|
||||
* 修改用户收藏
|
||||
*/
|
||||
@RequiresPermissions("app:collect:edit")
|
||||
// @RequiresPermissions("app:collect:edit")
|
||||
@ApiOperation(value = "修改用户收藏", notes = "修改用户收藏", httpMethod = "PUT")
|
||||
@Log(title = "用户收藏", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/edit")
|
||||
|
|
@ -110,7 +110,7 @@ public class AppUserCollectController extends BaseController
|
|||
/**
|
||||
* 删除用户收藏
|
||||
*/
|
||||
@RequiresPermissions("app:collect:remove")
|
||||
// @RequiresPermissions("app:collect:remove")
|
||||
@Log(title = "用户收藏", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class AppUserFansController extends BaseController
|
|||
/**
|
||||
* 查询用户关注列表
|
||||
*/
|
||||
@RequiresPermissions("app:fans:list")
|
||||
// @RequiresPermissions("app:fans:list")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value = "查询用户关注", notes = "查询用户关注", httpMethod = "GET")
|
||||
public TableDataInfo list(AppUserFans appUserFans)
|
||||
|
|
@ -56,7 +56,7 @@ public class AppUserFansController extends BaseController
|
|||
/**
|
||||
* 导出用户关注列表
|
||||
*/
|
||||
@RequiresPermissions("app:fans:export")
|
||||
// @RequiresPermissions("app:fans:export")
|
||||
@Log(title = "用户关注", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AppUserFans appUserFans)
|
||||
|
|
@ -69,7 +69,7 @@ public class AppUserFansController extends BaseController
|
|||
/**
|
||||
* 获取用户关注详细信息
|
||||
*/
|
||||
@RequiresPermissions("app:fans:query")
|
||||
// @RequiresPermissions("app:fans:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "获取用户关注详细信息", notes = "获取用户关注详细信息", httpMethod = "GET")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
|
|
@ -80,7 +80,7 @@ public class AppUserFansController extends BaseController
|
|||
/**
|
||||
* 新增用户关注
|
||||
*/
|
||||
@RequiresPermissions("app:fans:add")
|
||||
// @RequiresPermissions("app:fans:add")
|
||||
@ApiOperation(value = "新增用户关注", notes = "新增用户关注", httpMethod = "POST")
|
||||
@Log(title = "用户关注", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
|
|
@ -92,7 +92,7 @@ public class AppUserFansController extends BaseController
|
|||
/**
|
||||
* 修改用户关注
|
||||
*/
|
||||
@RequiresPermissions("app:fans:edit")
|
||||
// @RequiresPermissions("app:fans:edit")
|
||||
@ApiOperation(value = "修改用户关注", notes = "修改用户关注", httpMethod = "PUT")
|
||||
@Log(title = "用户关注", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/edit")
|
||||
|
|
@ -104,7 +104,7 @@ public class AppUserFansController extends BaseController
|
|||
/**
|
||||
* 删除用户关注
|
||||
*/
|
||||
@RequiresPermissions("app:fans:remove")
|
||||
// @RequiresPermissions("app:fans:remove")
|
||||
@Log(title = "用户关注", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.ruoyi.app.domain.AppUser;
|
|||
import com.ruoyi.app.domain.UserSkill;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ import java.util.List;
|
|||
* @author wyh
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@Data
|
||||
public class AppUserVo extends AppUser
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
@ -28,11 +30,11 @@ public class AppUserVo extends AppUser
|
|||
|
||||
private String cityName;
|
||||
|
||||
private int friendNum;
|
||||
private Integer friendNum;
|
||||
|
||||
private int likeNum;
|
||||
private Integer likeNum;
|
||||
|
||||
private int attentionNum;
|
||||
private Integer attentionNum;
|
||||
|
||||
private int fansNum;
|
||||
public void setUserSkillList(List<UserSkill> userSkillList) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.app.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppRegister;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 注册审核Mapper接口
|
||||
|
|
@ -58,4 +59,7 @@ public interface AppRegisterMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAppRegisterByIds(Long[] ids);
|
||||
|
||||
AppRegister selectAppRegisterByphone(@Param("phoneNumber")
|
||||
String phoneNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,4 +63,7 @@ public interface IAppRegisterService
|
|||
int passAppRegister(Long id);
|
||||
|
||||
int rejectAppRegister(Long id);
|
||||
|
||||
|
||||
AppRegister selectAppRegisterByphone(String phoneNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,4 +146,10 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
|||
appRegister.setUpdateTime(DateUtils.getNowDate());
|
||||
return appRegisterMapper.updateAppRegister(appRegister);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppRegister selectAppRegisterByphone(String phoneNumber) {
|
||||
|
||||
return appRegisterMapper.selectAppRegisterByphone(phoneNumber);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ruoyi.app.domain.*;
|
|||
import com.ruoyi.app.domain.vo.AppUserDynamicVo;
|
||||
import com.ruoyi.app.mapper.*;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -165,7 +166,16 @@ public class AppUserDynamicServiceImpl implements IAppUserDynamicService
|
|||
// 是否点赞
|
||||
if (appUserDynamic.getAppId() != null) {
|
||||
appUserDynamicVo.setIsLike(userIds.contains(appUserDynamic.getUserId()) ? 0 : 1);
|
||||
|
||||
}
|
||||
|
||||
AppUserCollect appUserCollect = new AppUserCollect();
|
||||
appUserCollect.setDynamicId(id);
|
||||
List<AppUserCollect> appUserCollects = appUserCollectMapper.selectAppUserCollectList(appUserCollect);
|
||||
if (CollectionUtils.isNotEmpty(appUserCollects)){
|
||||
appUserDynamicVo.setIsCollect(1);
|
||||
}
|
||||
|
||||
// 评论数
|
||||
AppDynamicComment appDynamicComment = new AppDynamicComment();
|
||||
appDynamicComment.setDynamicId(id);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ public class AppUserServiceImpl implements IAppUserService
|
|||
userSkill.setUserId(id);
|
||||
List<UserSkill> userSkillList = userSkillMapper.selectUserSkillList(userSkill);
|
||||
AppUserVo appUser = appUserMapper.selectAppUserById(id);
|
||||
appUser.setUserSkillList(userSkillList);
|
||||
if(CollectionUtils.isNotEmpty(userSkillList)) {
|
||||
appUser.setUserSkillList(userSkillList);
|
||||
}
|
||||
|
||||
return appUser;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,4 +117,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectAppRegisterByphone" resultType="com.ruoyi.app.domain.AppRegister">
|
||||
select * from app_register where phone = #{phoneNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue