init
This commit is contained in:
@@ -3,4 +3,5 @@ package com.ruoyi.cai.constant;
|
|||||||
public class RedisConstant {
|
public class RedisConstant {
|
||||||
public static final String REDIS_P = "cai-";
|
public static final String REDIS_P = "cai-";
|
||||||
public static final String SYSTEM_CONFIG = REDIS_P + "system-config";
|
public static final String SYSTEM_CONFIG = REDIS_P + "system-config";
|
||||||
|
public static final String CITY_CACHE_REDIS = REDIS_P + "city";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.ruoyi.cai.controller.app;
|
package com.ruoyi.cai.controller.app;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.ruoyi.cai.domain.CaiReportCate;
|
|
||||||
import com.ruoyi.cai.domain.CaiSkill;
|
|
||||||
import com.ruoyi.cai.dto.app.query.AnchorUpdateReq;
|
import com.ruoyi.cai.dto.app.query.AnchorUpdateReq;
|
||||||
|
import com.ruoyi.cai.dto.app.vo.AnchorJoinHomeVo;
|
||||||
import com.ruoyi.cai.dto.app.vo.AnchorVo;
|
import com.ruoyi.cai.dto.app.vo.AnchorVo;
|
||||||
import com.ruoyi.cai.dto.app.vo.CameraAuditVo;
|
import com.ruoyi.cai.dto.app.vo.CameraAuditVo;
|
||||||
import com.ruoyi.cai.manager.CurrentUserManager;
|
import com.ruoyi.cai.manager.CurrentUserManager;
|
||||||
|
import com.ruoyi.cai.service.CaiAnchorApplyService;
|
||||||
import com.ruoyi.cai.service.CaiAnchorService;
|
import com.ruoyi.cai.service.CaiAnchorService;
|
||||||
import com.ruoyi.cai.service.CaiUserCameraAuditService;
|
import com.ruoyi.cai.service.CaiUserCameraAuditService;
|
||||||
|
import com.ruoyi.cai.service.CaiUserService;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.helper.LoginHelper;
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -17,8 +17,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/anchor")
|
@RequestMapping("/api/anchor")
|
||||||
@@ -31,6 +29,10 @@ public class CaiAnchorAppController {
|
|||||||
private CaiUserCameraAuditService userCameraAuditService;
|
private CaiUserCameraAuditService userCameraAuditService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CaiAnchorService anchorService;
|
private CaiAnchorService anchorService;
|
||||||
|
@Autowired
|
||||||
|
private CaiUserService userService;
|
||||||
|
@Autowired
|
||||||
|
private CaiAnchorApplyService anchorApplyService;
|
||||||
|
|
||||||
@GetMapping("/info")
|
@GetMapping("/info")
|
||||||
@Operation(summary = "当前用户的主播信息")
|
@Operation(summary = "当前用户的主播信息")
|
||||||
@@ -60,5 +62,25 @@ public class CaiAnchorAppController {
|
|||||||
return R.ok(userCameraAuditService.uploadCameraAudit(vo));
|
return R.ok(userCameraAuditService.uploadCameraAudit(vo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "同意主播服务协议")
|
||||||
|
@PostMapping("/agreeProtocol")
|
||||||
|
public R<Boolean> agreeProtocol(){
|
||||||
|
boolean b = userService.agreeProtocol(LoginHelper.getUserId());
|
||||||
|
return R.ok(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "加入主播页面")
|
||||||
|
@GetMapping("/joinHome")
|
||||||
|
public R<AnchorJoinHomeVo> joinHome(){
|
||||||
|
AnchorJoinHomeVo vo = anchorApplyService.joinHome(LoginHelper.getUserId());
|
||||||
|
return R.ok(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "申请加入主播")
|
||||||
|
@GetMapping("/joinAnchor")
|
||||||
|
public R<Boolean> joinAnchor(){
|
||||||
|
return R.ok(anchorApplyService.joinAnchor(LoginHelper.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.ruoyi.cai.controller.app;
|
package com.ruoyi.cai.controller.app;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.cai.domain.CaiCitys;
|
||||||
import com.ruoyi.cai.domain.CaiGoods;
|
import com.ruoyi.cai.domain.CaiGoods;
|
||||||
import com.ruoyi.cai.domain.CaiReportCate;
|
import com.ruoyi.cai.domain.CaiReportCate;
|
||||||
import com.ruoyi.cai.domain.CaiSkill;
|
|
||||||
import com.ruoyi.cai.domain.CaiWithdrawExchange;
|
import com.ruoyi.cai.domain.CaiWithdrawExchange;
|
||||||
|
import com.ruoyi.cai.service.CaiCitysService;
|
||||||
import com.ruoyi.cai.service.CaiGoodsService;
|
import com.ruoyi.cai.service.CaiGoodsService;
|
||||||
import com.ruoyi.cai.service.CaiReportCateService;
|
import com.ruoyi.cai.service.CaiReportCateService;
|
||||||
import com.ruoyi.cai.service.CaiWithdrawExchangeService;
|
import com.ruoyi.cai.service.CaiWithdrawExchangeService;
|
||||||
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/setting")
|
@RequestMapping("/api/setting")
|
||||||
@@ -29,6 +31,8 @@ public class CaiSettingAppController {
|
|||||||
private CaiWithdrawExchangeService withdrawExchangeService;
|
private CaiWithdrawExchangeService withdrawExchangeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CaiReportCateService reportCateService;
|
private CaiReportCateService reportCateService;
|
||||||
|
@Autowired
|
||||||
|
private CaiCitysService citysService;
|
||||||
|
|
||||||
@GetMapping("/goods")
|
@GetMapping("/goods")
|
||||||
@Operation(summary = "充值配置")
|
@Operation(summary = "充值配置")
|
||||||
@@ -53,4 +57,11 @@ public class CaiSettingAppController {
|
|||||||
List<CaiReportCate> list = reportCateService.list(Wrappers.lambdaQuery(CaiReportCate.class));
|
List<CaiReportCate> list = reportCateService.list(Wrappers.lambdaQuery(CaiReportCate.class));
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/city")
|
||||||
|
@Operation(summary = "城市")
|
||||||
|
public R<Map<Long,String>> city(){
|
||||||
|
return R.ok(citysService.all());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ public class CaiAnchorApply implements Serializable {
|
|||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
/**
|
|
||||||
* 同意协议 0 不同意 1 同意
|
|
||||||
*/
|
|
||||||
private Integer agreeProtocol;
|
|
||||||
/**
|
/**
|
||||||
* 审核状态 0 未申请 1 审核中 2 审核不通过 3 审核通过
|
* 审核状态 0 未申请 1 审核中 2 审核不通过 3 审核通过
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package com.ruoyi.cai.domain;
|
package com.ruoyi.cai.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对象 cai_user
|
* 用户对象 cai_user
|
||||||
@@ -61,10 +56,6 @@ public class CaiUser implements Serializable {
|
|||||||
* 手机号验证状态 0 未验证 1 已验证
|
* 手机号验证状态 0 未验证 1 已验证
|
||||||
*/
|
*/
|
||||||
private Integer mobileStatus;
|
private Integer mobileStatus;
|
||||||
/**
|
|
||||||
* 自拍认证 0 未认证 1 已认证
|
|
||||||
*/
|
|
||||||
private Integer cameraStatus;
|
|
||||||
/**
|
/**
|
||||||
* 头像
|
* 头像
|
||||||
*/
|
*/
|
||||||
@@ -101,6 +92,14 @@ public class CaiUser implements Serializable {
|
|||||||
* 相册上传状态 0 未上传 1 已上传
|
* 相册上传状态 0 未上传 1 已上传
|
||||||
*/
|
*/
|
||||||
private Integer photoStatus;
|
private Integer photoStatus;
|
||||||
|
/**
|
||||||
|
* 自拍认证 0 未认证 1 已认证
|
||||||
|
*/
|
||||||
|
private Integer cameraStatus;
|
||||||
|
/**
|
||||||
|
* 是否同意服务协议
|
||||||
|
*/
|
||||||
|
private Integer agreeProtocol;
|
||||||
/**
|
/**
|
||||||
* 视频状态 0 休息中 1 视频中
|
* 视频状态 0 休息中 1 视频中
|
||||||
*/
|
*/
|
||||||
@@ -117,14 +116,6 @@ public class CaiUser implements Serializable {
|
|||||||
* 邀请人
|
* 邀请人
|
||||||
*/
|
*/
|
||||||
private Integer inviteId;
|
private Integer inviteId;
|
||||||
/**
|
|
||||||
* 财富值
|
|
||||||
*/
|
|
||||||
private Long wealthValue;
|
|
||||||
/**
|
|
||||||
* 大咖值
|
|
||||||
*/
|
|
||||||
private Long loveValue;
|
|
||||||
/**
|
/**
|
||||||
* 终端 0 默认接口 1 安卓 2 ios 3 网页 4小程序
|
* 终端 0 默认接口 1 安卓 2 ios 3 网页 4小程序
|
||||||
*/
|
*/
|
||||||
@@ -141,14 +132,6 @@ public class CaiUser implements Serializable {
|
|||||||
* 是否是播主 0 否 1 是
|
* 是否是播主 0 否 1 是
|
||||||
*/
|
*/
|
||||||
private Integer isAnchor;
|
private Integer isAnchor;
|
||||||
/**
|
|
||||||
* 音频
|
|
||||||
*/
|
|
||||||
private String voice;
|
|
||||||
/**
|
|
||||||
* 大咖值
|
|
||||||
*/
|
|
||||||
private Integer voiceTime;
|
|
||||||
/**
|
/**
|
||||||
* 类型 0 关闭 1 打开
|
* 类型 0 关闭 1 打开
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.cai.dto.app.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AnchorJoinHomeVo implements Serializable {
|
||||||
|
/**
|
||||||
|
* 资料是否完成 0 未完成 1已完成
|
||||||
|
*/
|
||||||
|
private Integer finishStatus;
|
||||||
|
/**
|
||||||
|
* 相册上传状态 0 未上传 1 已上传
|
||||||
|
*/
|
||||||
|
private Integer photoStatus;
|
||||||
|
/**
|
||||||
|
* 自拍认证 0 未认证 1 已认证
|
||||||
|
*/
|
||||||
|
private Integer cameraStatus;
|
||||||
|
/**
|
||||||
|
* 是否同意服务协议
|
||||||
|
*/
|
||||||
|
private Integer agreeProtocol;
|
||||||
|
|
||||||
|
private Integer applyStatus;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.ruoyi.cai.domain.CaiAnchorApply;
|
import com.ruoyi.cai.domain.CaiAnchorApply;
|
||||||
import com.ruoyi.cai.dto.admin.vo.CaiAnchorApplyAdminVo;
|
import com.ruoyi.cai.dto.admin.vo.CaiAnchorApplyAdminVo;
|
||||||
|
import com.ruoyi.cai.dto.app.vo.AnchorJoinHomeVo;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,5 +15,11 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
*/
|
*/
|
||||||
public interface CaiAnchorApplyService extends IService<CaiAnchorApply> {
|
public interface CaiAnchorApplyService extends IService<CaiAnchorApply> {
|
||||||
|
|
||||||
|
CaiAnchorApply getByUserId(Long userId);
|
||||||
|
|
||||||
Page<CaiAnchorApplyAdminVo> pageAdmin(PageQuery pageQuery, CaiAnchorApplyAdminVo bo);
|
Page<CaiAnchorApplyAdminVo> pageAdmin(PageQuery pageQuery, CaiAnchorApplyAdminVo bo);
|
||||||
|
|
||||||
|
AnchorJoinHomeVo joinHome(Long userId);
|
||||||
|
|
||||||
|
boolean joinAnchor(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,6 @@ public interface CaiUserService extends IService<CaiUser> {
|
|||||||
CaiUser getByUserCode(String userCode);
|
CaiUser getByUserCode(String userCode);
|
||||||
|
|
||||||
void updateVideoStatus(Long userId, int videoStatus);
|
void updateVideoStatus(Long userId, int videoStatus);
|
||||||
|
|
||||||
|
boolean agreeProtocol(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
package com.ruoyi.cai.service.impl;
|
package com.ruoyi.cai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.cai.domain.CaiAnchorApply;
|
import com.ruoyi.cai.domain.CaiAnchorApply;
|
||||||
|
import com.ruoyi.cai.domain.CaiUser;
|
||||||
import com.ruoyi.cai.dto.admin.vo.CaiAnchorApplyAdminVo;
|
import com.ruoyi.cai.dto.admin.vo.CaiAnchorApplyAdminVo;
|
||||||
|
import com.ruoyi.cai.dto.app.vo.AnchorJoinHomeVo;
|
||||||
import com.ruoyi.cai.mapper.CaiAnchorApplyMapper;
|
import com.ruoyi.cai.mapper.CaiAnchorApplyMapper;
|
||||||
import com.ruoyi.cai.service.CaiAnchorApplyService;
|
import com.ruoyi.cai.service.CaiAnchorApplyService;
|
||||||
|
import com.ruoyi.cai.service.CaiUserService;
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播主申请管理Service业务层处理
|
* 播主申请管理Service业务层处理
|
||||||
*
|
*
|
||||||
@@ -18,8 +26,67 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class CaiAnchorApplyServiceImpl extends ServiceImpl<CaiAnchorApplyMapper,CaiAnchorApply> implements CaiAnchorApplyService {
|
public class CaiAnchorApplyServiceImpl extends ServiceImpl<CaiAnchorApplyMapper,CaiAnchorApply> implements CaiAnchorApplyService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CaiUserService userService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CaiAnchorApply getByUserId(Long userId){
|
||||||
|
return this.getOne(Wrappers.lambdaQuery(CaiAnchorApply.class)
|
||||||
|
.eq(CaiAnchorApply::getUserId,userId).last("limit 1"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<CaiAnchorApplyAdminVo> pageAdmin(PageQuery pageQuery, CaiAnchorApplyAdminVo bo) {
|
public Page<CaiAnchorApplyAdminVo> pageAdmin(PageQuery pageQuery, CaiAnchorApplyAdminVo bo) {
|
||||||
return baseMapper.pageAdmin(pageQuery.build(),bo);
|
return baseMapper.pageAdmin(pageQuery.build(),bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnchorJoinHomeVo joinHome(Long userId) {
|
||||||
|
CaiUser user = userService.getById(userId);
|
||||||
|
CaiAnchorApply anchorApply = this.getByUserId(userId);
|
||||||
|
AnchorJoinHomeVo vo = new AnchorJoinHomeVo();
|
||||||
|
vo.setFinishStatus(user.getFinishStatus());
|
||||||
|
vo.setPhotoStatus(user.getPhotoStatus());
|
||||||
|
vo.setCameraStatus(user.getCameraStatus());
|
||||||
|
vo.setAgreeProtocol(user.getAgreeProtocol());
|
||||||
|
if(anchorApply != null){
|
||||||
|
vo.setApplyStatus(user.getStatus());
|
||||||
|
}else{
|
||||||
|
vo.setApplyStatus(0);
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean joinAnchor(Long userId) {
|
||||||
|
CaiUser user = userService.getById(userId);
|
||||||
|
if(user.getIsAnchor() == 1){
|
||||||
|
throw new ServiceException("您已经是主播,不能重复申请");
|
||||||
|
}
|
||||||
|
if(user.getFinishStatus() != 1){
|
||||||
|
throw new ServiceException("您还未完善个人资料");
|
||||||
|
}
|
||||||
|
if(user.getPhotoStatus() != 1){
|
||||||
|
throw new ServiceException("请选上传相册");
|
||||||
|
}
|
||||||
|
if(user.getCameraStatus() != 1){
|
||||||
|
throw new ServiceException("您还未完成自拍认证");
|
||||||
|
}
|
||||||
|
if(user.getAgreeProtocol() != 1){
|
||||||
|
throw new ServiceException("您还未同意个人协议");
|
||||||
|
}
|
||||||
|
CaiAnchorApply anchorApply = this.getByUserId(userId);
|
||||||
|
if(anchorApply != null && anchorApply.getStatus() == 1){
|
||||||
|
throw new ServiceException("您的提交的申请正在审核中请耐心等待");
|
||||||
|
}
|
||||||
|
if(anchorApply == null){
|
||||||
|
anchorApply = new CaiAnchorApply();
|
||||||
|
}else{
|
||||||
|
anchorApply.setAuditCount(anchorApply.getAuditCount()+1);
|
||||||
|
}
|
||||||
|
anchorApply.setStatus(1);
|
||||||
|
anchorApply.setCreateTime(LocalDateTime.now());
|
||||||
|
this.saveOrUpdate(anchorApply);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,4 +102,12 @@ public class CaiUserServiceImpl extends ServiceImpl<CaiUserMapper, CaiUser> impl
|
|||||||
.eq(CaiUser::getId,userId)
|
.eq(CaiUser::getId,userId)
|
||||||
.set(CaiUser::getVideoStatus,videoStatus));
|
.set(CaiUser::getVideoStatus,videoStatus));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean agreeProtocol(Long userId) {
|
||||||
|
this.update(Wrappers.lambdaUpdate(CaiUser.class)
|
||||||
|
.eq(CaiUser::getId,userId)
|
||||||
|
.set(CaiUser::getAgreeProtocol,1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user