Преглед на файлове

Merge remote-tracking branch 'origin/master'

zouxuan преди 2 години
родител
ревизия
b8b8590711
променени са 60 файла, в които са добавени 1819 реда и са изтрити 206 реда
  1. 11 1
      cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/entity/LoginEntity.java
  2. 3 0
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/filter/PhoneLoginAuthenticationFilter.java
  3. 4 2
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/provider/PhoneAuthenticationProvider.java
  4. 4 2
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/SysUserService.java
  5. 42 31
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/impl/SysUserServiceImpl.java
  6. 40 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/config/BbsRedisConfig.java
  7. 0 12
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsArticleController.java
  8. 82 45
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsPrivateMessageController.java
  9. 42 62
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsReplyController.java
  10. 144 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/HomeController.java
  11. 34 8
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsPrivateMessageDao.java
  12. 9 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsReplyAuthRecordDao.java
  13. 37 8
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsReplyDao.java
  14. 48 1
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/BbsPrivateMessageDto.java
  15. 56 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/MessageReadDto.java
  16. 82 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/PrivateMessagePersonVo.java
  17. 63 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/ReplyAuditDto.java
  18. 11 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsCollectSearch.java
  19. 25 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsFollowSearch.java
  20. 12 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsLikeSearch.java
  21. 25 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsPrivateMessageSearch.java
  22. 23 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsReplySearch.java
  23. 20 2
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/entity/BbsPrivateMessage.java
  24. 103 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/entity/BbsReplyAuthRecord.java
  25. 2 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsCollectService.java
  26. 27 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsPrivateMessageService.java
  27. 20 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsReplyAuthRecordService.java
  28. 37 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsReplyService.java
  29. 19 1
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/impl/BbsPrivateMessageServiceImpl.java
  30. 38 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/impl/BbsReplyAuthRecordServiceImpl.java
  31. 41 1
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/impl/BbsReplyServiceImpl.java
  32. 37 1
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsCollectVo.java
  33. 24 1
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsFollowVo.java
  34. 100 0
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsReplyAuditVo.java
  35. 17 5
      cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsReplyVo.java
  36. 4 4
      cooleshow-bbs/src/main/resources/config/mybatis/BbsArticleMapper.xml
  37. 11 1
      cooleshow-bbs/src/main/resources/config/mybatis/BbsCollectMapper.xml
  38. 24 0
      cooleshow-bbs/src/main/resources/config/mybatis/BbsFollowMapper.xml
  39. 7 0
      cooleshow-bbs/src/main/resources/config/mybatis/BbsLikeMapper.xml
  40. 49 0
      cooleshow-bbs/src/main/resources/config/mybatis/BbsPrivateMessageMapper.xml
  41. 6 0
      cooleshow-bbs/src/main/resources/config/mybatis/BbsReplyAuthRecordMapper.xml
  42. 79 0
      cooleshow-bbs/src/main/resources/config/mybatis/BbsReplyMapper.xml
  43. 5 2
      cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/AppConstant.java
  44. 2 6
      cooleshow-task/src/main/java/com/yonge/cooleshow/task/jobs/TeacherEarningTask.java
  45. 2 1
      cooleshow-user/pom.xml
  46. 7 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicSheetAuthRecordService.java
  47. 22 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAuthRecordServiceImpl.java
  48. 10 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java
  49. 11 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MusicSheetDetailVo.java
  50. 2 2
      cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  51. 5 4
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml
  52. 0 1
      cooleshow-user/user-teacher/pom.xml
  53. 2 1
      cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseScheduleController.java
  54. 78 0
      cooleshow-user/user-website/pom.xml
  55. 29 0
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/WebsiteApplication.java
  56. 44 0
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/config/ResourceServerConfig.java
  57. 54 0
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/config/WebMvcConfig.java
  58. 41 0
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/interceptor/MDCInterceptor.java
  59. 31 0
      cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/interceptor/OperationLogInterceptor.java
  60. 12 0
      cooleshow-user/user-website/src/main/resources/bootstrap-prod.yml

+ 11 - 1
cooleshow-auth/auth-api/src/main/java/com/yonge/cooleshow/auth/api/entity/LoginEntity.java

@@ -8,8 +8,10 @@ public class LoginEntity {
     private String clientId;
 
     private String clientSecret;
-
+    //未注册是否立即注册
     private Boolean isSurportRegister;
+    //注册的用户类型,没有则按照clientId自动分配:STUDENT,TEACHER
+    private String registerUserType;
 
     private String phone;
     
@@ -47,6 +49,14 @@ public class LoginEntity {
         this.clientSecret = clientSecret;
     }
 
+    public String getRegisterUserType() {
+        return registerUserType;
+    }
+
+    public void setRegisterUserType(String registerUserType) {
+        this.registerUserType = registerUserType;
+    }
+
     public String getPhone() {
         return phone;
     }

+ 3 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/filter/PhoneLoginAuthenticationFilter.java

@@ -25,6 +25,7 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 	private static final String SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY = "smsCode";
 	private static final String clientIdParameter = "clientId";
 	private static final String IS_SURPORT_REGISTER = "isSurportRegister";
+	private static final String REGISTER_USER_TYPE = "registerUserType";
 
 	private static final String DEVICE_NUM = "deviceNum";
 
@@ -47,6 +48,7 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 		String credentials = obtainParameter(request, SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY);
 		
 		boolean isRegister = StringUtils.equals("true", request.getParameter(IS_SURPORT_REGISTER));
+		String registerUserType = obtainParameter(request, REGISTER_USER_TYPE);
 
 		String clientId = request.getParameter(clientIdParameter).toUpperCase();
 
@@ -63,6 +65,7 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 		loginEntity.setPhone(principal);
 		loginEntity.setSmsCode(credentials);
 		loginEntity.setIsSurportRegister(isRegister);
+		loginEntity.setRegisterUserType(registerUserType);
 		loginEntity.setDeviceNum(deviceNum);
 
 		authRequest = new PhoneAuthenticationToken(SecurityConstants.PHONE_PRINCIPAL_PREFIX + principal, loginEntity);

+ 4 - 2
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/provider/PhoneAuthenticationProvider.java

@@ -60,7 +60,9 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 		String clientId = loginEntity.getClientId();
 
 		Boolean isRegister = loginEntity.getIsSurportRegister();
-		
+
+		String registerUserType = loginEntity.getRegisterUserType();
+
 		String deviceNum = loginEntity.getDeviceNum();
 
 		SysUserInfo userInfo = sysUserService.queryUserInfoByPhone(phone);
@@ -70,7 +72,7 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 				throw new LockedException("用户不存在");
 			}
 			
-			userInfo = sysUserService.registerUser(loginEntity.getPhone(), clientId);
+			userInfo = sysUserService.registerUser(loginEntity.getPhone(), clientId,registerUserType);
 			
 			if (StringUtils.isNotBlank(deviceNum)) {
 				sysUserDeviceService.bindDevice(clientId, userInfo.getSysUser().getId(), deviceNum);

+ 4 - 2
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/SysUserService.java

@@ -121,9 +121,10 @@ public interface SysUserService extends BaseService<Long, SysUser> {
      *
      * @param phone
      * @param clientId
+     * @param registerUserType
      * @return
      */
-    SysUserInfo registerUser(String phone, String clientId);
+    SysUserInfo registerUser(String phone, String clientId, String registerUserType);
 
     /**
      * 刷新token
@@ -164,6 +165,7 @@ public interface SysUserService extends BaseService<Long, SysUser> {
      * @return: com.yonge.cooleshow.biz.dal.vo.TeacherVo
      */
     UserSetVo getSetDetail(Long id);
+
     /***
      * 用户设置
      * @author liweifan
@@ -177,7 +179,7 @@ public interface SysUserService extends BaseService<Long, SysUser> {
     void updateRongCloudUserInfo(Long userId);
 
     /**
-     *  商城同步管理用户
+     * 商城同步管理用户
      *
      * @param queryInfo
      * @return

+ 42 - 31
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/impl/SysUserServiceImpl.java

@@ -142,40 +142,51 @@ public class SysUserServiceImpl extends BaseServiceImpl<Long, SysUser> implement
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public SysUserInfo registerUser(String phone, String clientId) {
+    public SysUserInfo registerUser(String phone, String clientId, String registerUserType) {
+        if (StringUtils.equalsIgnoreCase(registerUserType, "TEACHER")) {
+            return registerTeacher(phone);
+        } else if (StringUtils.equalsIgnoreCase(registerUserType, "STUDENT")) {
+            return registerStudent(phone);
+        } else if (StringUtils.equalsIgnoreCase(clientId, "TEACHER")) {
+            return registerTeacher(phone);
+        } else if (StringUtils.equalsIgnoreCase(clientId, "STUDENT")) {
+            return registerStudent(phone);
+        }
+        return null;
+    }
+
+    private SysUserInfo registerTeacher(String phone) {
         SysUser sysUser = new SysUser();
         sysUser.setPhone(phone);
-        //String password = sysUser.getPhone().substring(sysUser.getPhone().length() - 6);
-        //sysUser.setPassword(new BCryptPasswordEncoder().encode(password));
         String defaultHeard = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD);
         sysUser.setAvatar(defaultHeard);
-        if (StringUtils.equalsIgnoreCase(clientId, "TEACHER")) {
-            sysUser.setUserType("TEACHER");
-            sysUserDao.insert(sysUser);
-            //添加用户现金账户
-            //imFeignService.register(new ImUserModel(sysUser.getId().toString(),phone,null));
-            //userFeignService.createCashAccount(sysUser.getId());
-            //sysTenantAccount
-            //创建teacher表
-            sysUserDao.saveTeacher(sysUser.getId());
-            //创建老师账户
-            sysUserDao.createUserAccount(sysUser.getId());
 
-            //用户默认昵称
-            sysUser.setUsername("游客"+sysUser.getId());
-            sysUserDao.update(sysUser);
-            return queryUserInfoByPhone(phone);
-        } else if (StringUtils.equalsIgnoreCase(clientId, "STUDENT")) {
-            sysUser.setUserType("STUDENT");
-            sysUserDao.insert(sysUser);
-            saveStudent(sysUser);
-
-            //用户默认昵称
-            sysUser.setUsername("游客"+sysUser.getId());
-            sysUserDao.update(sysUser);
-            return queryUserInfoByPhone(phone);
-        }
-        return null;
+        sysUser.setUserType("TEACHER");
+        sysUserDao.insert(sysUser);
+        //创建teacher表
+        sysUserDao.saveTeacher(sysUser.getId());
+        //创建老师账户
+        sysUserDao.createUserAccount(sysUser.getId());
+        //用户默认昵称
+        sysUser.setUsername("游客" + sysUser.getId());
+        sysUserDao.update(sysUser);
+        return queryUserInfoByPhone(phone);
+    }
+
+    private SysUserInfo registerStudent(String phone) {
+        SysUser sysUser = new SysUser();
+        sysUser.setPhone(phone);
+        String defaultHeard = sysConfigService.findConfigValue(SysConfigConstant.DEFAULT_HEARD);
+        sysUser.setAvatar(defaultHeard);
+
+        sysUser.setUserType("STUDENT");
+        sysUserDao.insert(sysUser);
+        saveStudent(sysUser);
+
+        //用户默认昵称
+        sysUser.setUsername("游客" + sysUser.getId());
+        sysUserDao.update(sysUser);
+        return queryUserInfoByPhone(phone);
     }
 
     @Override
@@ -188,7 +199,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Long, SysUser> implement
     @Transactional(rollbackFor = Exception.class)
     public void saveStudent(SysUser sysUser) {
         sysUserDao.saveStudent(sysUser.getId());
-        if(!sysUser.getUserType().contains("TEACHER")){
+        if (!sysUser.getUserType().contains("TEACHER")) {
             sysUserDao.createUserAccount(sysUser.getId());
         }
     }
@@ -198,7 +209,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Long, SysUser> implement
     public void saveTeacher(SysUser sysUser) {
 
         sysUserDao.saveTeacher(sysUser.getId());
-        if(!sysUser.getUserType().contains("STUDENT")){
+        if (!sysUser.getUserType().contains("STUDENT")) {
             sysUserDao.createUserAccount(sysUser.getId());
         }
     }

+ 40 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/config/BbsRedisConfig.java

@@ -0,0 +1,40 @@
+package com.yonge.cooleshow.bbs.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class BbsRedisConfig {
+    @Bean(name = "redis1")
+    public RedisTemplate<String, Object> rcif(RedisConnectionFactory factory) {
+        //为了开发方便一般直接使用 <String, Object>
+        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
+        template.setConnectionFactory(factory);
+        //Json序列化配置
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper om = new ObjectMapper();
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        //String 的序列化
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        // key采用String的序列化方式
+        template.setKeySerializer(stringRedisSerializer);
+        // hash的key也采用String的序列化方式
+        template.setHashKeySerializer(stringRedisSerializer);
+        // value序列化方式采用jackson
+        template.setValueSerializer(jackson2JsonRedisSerializer);
+        // hash的value序列化方式采用jackson
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
+        template.afterPropertiesSet();
+        return template;
+    }
+}
+

+ 0 - 12
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsArticleController.java

@@ -78,16 +78,4 @@ public class BbsArticleController extends BaseController {
         bbsArticleService.articleTop(article);
         return succeed();
     }
-
-    /**
-     * 首页
-     */
-    @PostMapping("/home")
-    @ApiOperation(value = "首页", notes = "传入bbsArticleSearch")
-    public HttpResponseResult<PageInfo<BbsArticleVo>> home(@RequestBody BbsArticleSearch query) {
-        query.setDelFlag(false);
-        query.setStatus(ArticleEnum.PASS);
-        IPage<BbsArticleVo> pages = bbsArticleService.selectPage(PageUtil.getPage(query), query);
-        return succeed(PageUtil.pageInfo(pages));
-    }
 }

+ 82 - 45
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsPrivateMessageController.java

@@ -1,6 +1,13 @@
 package com.yonge.cooleshow.bbs.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.bbs.dto.BbsPrivateMessageDto;
+import com.yonge.cooleshow.bbs.dto.MessageReadDto;
+import com.yonge.cooleshow.bbs.dto.PrivateMessagePersonVo;
+import com.yonge.cooleshow.bbs.enums.YesOrNoEnum;
+import com.yonge.toolset.base.exception.BizException;
 import com.yonge.toolset.base.page.PageInfo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -19,6 +26,10 @@ import com.yonge.cooleshow.bbs.dto.search.BbsPrivateMessageSearch;
 import com.yonge.cooleshow.bbs.entity.BbsPrivateMessage;
 import com.yonge.cooleshow.bbs.service.BbsPrivateMessageService;
 
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
 @RestController
 @RequestMapping("/bbsPrivateMessage")
 @Api(value = "私信", tags = "私信")
@@ -27,58 +38,84 @@ public class BbsPrivateMessageController extends BaseController {
     @Autowired
     private BbsPrivateMessageService bbsPrivateMessageService;
 
-	/**
-     * 查询单条
-     */
-    @GetMapping("/detail/{id}")
-    @ApiOperation(value = "详情", notes = "传入id")
-    public HttpResponseResult<BbsPrivateMessageVo> detail(@PathVariable("id") Long id) {
-    	return succeed(bbsPrivateMessageService.detail(id));
-	}
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
     
-    /**
-     * 查询分页
-     */
-    @PostMapping("/page")
-    @ApiOperation(value = "查询分页", notes = "传入bbsPrivateMessageSearch")
-    public HttpResponseResult<PageInfo<BbsPrivateMessageVo>> page(@RequestBody BbsPrivateMessageSearch query) {
-		IPage<BbsPrivateMessageVo> pages = bbsPrivateMessageService.selectPage(PageUtil.getPage(query), query);
+
+    @PostMapping("/page/person")
+    @ApiOperation(value = "私信人员列表", notes = "传入bbsPrivateMessageSearch")
+    public HttpResponseResult<PageInfo<PrivateMessagePersonVo>> pagePerson(@RequestBody BbsPrivateMessageSearch query) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || user.getId() == null) {
+			throw  new BizException("请重新登录");
+		}
+		query.setUserId(user.getId());
+		IPage<PrivateMessagePersonVo> pages = bbsPrivateMessageService.selectPersonPage(PageUtil.getPage(query), query);
         return succeed(PageUtil.pageInfo(pages));
 	}
-    
-    /**
-	 * 新增
-	 */
+
+	@PostMapping("/page/message")
+	@ApiOperation(value = "私信人员消息列表", notes = "传入bbsPrivateMessageSearch")
+	public HttpResponseResult<PageInfo<BbsPrivateMessageDto>> pageMessage(@RequestBody @Valid BbsPrivateMessageSearch query) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || user.getId() == null) {
+			throw  new BizException("请重新登录");
+		}
+		SysUser receiverUser = sysUserFeignService.queryUserById(query.getReceiverUserId());
+		if (receiverUser == null || user.getId() == null) {
+			throw  new BizException("私信接收方用户不存在");
+		}
+		query.setUserId(user.getId());
+		IPage<BbsPrivateMessageDto> pages = bbsPrivateMessageService.selectMessagePage(PageUtil.getPage(query), query);
+		List<BbsPrivateMessageDto> collect = pages.getRecords().stream().peek(bbsPrivateMessageDto -> {
+			bbsPrivateMessageDto.setReceiverAvatar(receiverUser.getAvatar());
+			bbsPrivateMessageDto.setReceiverName(receiverUser.getUsername());
+			bbsPrivateMessageDto.setUserName(user.getUsername());
+			bbsPrivateMessageDto.setUserAvatar(user.getAvatar());
+
+		}).collect(Collectors.toList());
+		pages.setRecords(collect);
+		return succeed(PageUtil.pageInfo(pages));
+	}
+
+
 	@PostMapping("/save")
-	@ApiOperation(value = "新增", notes = "传入bbsPrivateMessage")
+	@ApiOperation(value = "发送私信", notes = "传入bbsPrivateMessage")
 	public HttpResponseResult save(@Valid @RequestBody BbsPrivateMessage bbsPrivateMessage) {
-    	return status(bbsPrivateMessageService.save(bbsPrivateMessage));
+
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || user.getId() == null) {
+			throw  new BizException("请重新登录");
+		}
+
+		SysUser receiverUser = sysUserFeignService.queryUserById(bbsPrivateMessage.getReceiverUserId());
+		if (receiverUser == null || user.getId() == null) {
+			throw  new BizException("私信接收方用户不存在");
+		}
+		bbsPrivateMessage.setSendUserId(user.getId());
+		bbsPrivateMessage.setCreatedTime(new Date());
+		bbsPrivateMessage.setReadFlag(YesOrNoEnum.NO);
+		bbsPrivateMessageService.save(bbsPrivateMessage);
+    	return succeed(bbsPrivateMessage);
 	}
-    
-    /**
-	 * 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperation(value = "修改", notes = "传入bbsPrivateMessage")
-	public HttpResponseResult update(@Valid @RequestBody BbsPrivateMessage bbsPrivateMessage) {
-        return status(bbsPrivateMessageService.updateById(bbsPrivateMessage));
+
+
+	@PostMapping("/read")
+	@ApiOperation(value = "设置已读", notes = "传入bbsPrivateMessage")
+	public HttpResponseResult read(@RequestBody @Valid MessageReadDto readDto) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || user.getId() == null) {
+			throw  new BizException("请重新登录");
+		}
+		readDto.setUserId(user.getId());
+		return status(bbsPrivateMessageService.read(readDto));
 	}
-    
-    /**
-	 * 新增或修改
-	 */
-    @PostMapping("/submit")
-    @ApiOperation(value = "新增或修改", notes = "传入bbsPrivateMessage")
-	public HttpResponseResult submit(@Valid @RequestBody BbsPrivateMessage bbsPrivateMessage) {
-        return status(bbsPrivateMessageService.saveOrUpdate(bbsPrivateMessage));
-    }
-
- 	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+
+
+
+	@PostMapping("/remove/{ids}")
+	@ApiOperation(value = "测回消息", notes = "传入ids")
+	public HttpResponseResult remove(@PathVariable String ids) {
         if (StringUtil.isEmpty(ids)) {
 			return failed("参数不能为空");
 		}

+ 42 - 62
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/BbsReplyController.java

@@ -1,87 +1,67 @@
 package com.yonge.cooleshow.bbs.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.bbs.dto.ReplyAuditDto;
+import com.yonge.cooleshow.bbs.dto.search.BbsReplySearch;
+import com.yonge.cooleshow.bbs.service.BbsReplyService;
+import com.yonge.cooleshow.bbs.vo.BbsReplyAuditVo;
+import com.yonge.cooleshow.bbs.vo.BbsReplyVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
-
+import com.yonge.toolset.base.page.PageInfo;
 import com.yonge.toolset.mybatis.support.PageUtil;
-
 import com.yonge.toolset.utils.string.StringUtil;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
 
-import com.yonge.cooleshow.bbs.vo.BbsReplyVo;
-import com.yonge.cooleshow.bbs.dto.search.BbsReplySearch;
-import com.yonge.cooleshow.bbs.entity.BbsReply;
-import com.yonge.cooleshow.bbs.service.BbsReplyService;
-
 @RestController
 @RequestMapping("/bbsReply")
-@Api(value = "文章评论", tags = "文章评论")
+@Api(value = "文章评论", tags = "内容评论")
 public class BbsReplyController extends BaseController {
 
     @Autowired
     private BbsReplyService bbsReplyService;
 
-	/**
-     * 查询单条
-     */
-    @GetMapping("/detail/{id}")
-    @ApiOperation(value = "详情", notes = "传入id")
-    public HttpResponseResult<BbsReplyVo> detail(@PathVariable("id") Long id) {
-    	return succeed(bbsReplyService.detail(id));
-	}
-    
-    /**
-     * 查询分页
-     */
-    @PostMapping("/page")
-    @ApiOperation(value = "查询分页", notes = "传入bbsReplySearch")
-    public HttpResponseResult<PageInfo<BbsReplyVo>> page(@RequestBody BbsReplySearch query) {
-		IPage<BbsReplyVo> pages = bbsReplyService.selectPage(PageUtil.getPage(query), query);
-        return succeed(PageUtil.pageInfo(pages));
-	}
-    
-    /**
-	 * 新增
-	 */
-	@PostMapping("/save")
-	@ApiOperation(value = "新增", notes = "传入bbsReply")
-	public HttpResponseResult save(@Valid @RequestBody BbsReply bbsReply) {
-    	return status(bbsReplyService.save(bbsReply));
-	}
-    
-    /**
-	 * 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperation(value = "修改", notes = "传入bbsReply")
-	public HttpResponseResult update(@Valid @RequestBody BbsReply bbsReply) {
-        return status(bbsReplyService.updateById(bbsReply));
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+
+	@PostMapping("/audit/list")
+	@ApiOperation(value = "后台-评论审核列表")
+	public HttpResponseResult<PageInfo<BbsReplyAuditVo>> auditList(@RequestBody BbsReplySearch query) {
+
+		IPage<BbsReplyAuditVo> pages = bbsReplyService.selectAuditListPage(PageUtil.getPage(query), query);
+		return succeed(PageUtil.pageInfo(pages));
 	}
-    
-    /**
-	 * 新增或修改
-	 */
-    @PostMapping("/submit")
-    @ApiOperation(value = "新增或修改", notes = "传入bbsReply")
-	public HttpResponseResult submit(@Valid @RequestBody BbsReply bbsReply) {
-        return status(bbsReplyService.saveOrUpdate(bbsReply));
-    }
 
- 	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        if (StringUtil.isEmpty(ids)) {
+	@PostMapping("/remove/{id}")
+	@ApiOperation(value = "后台-评论删除", notes = "传入id")
+	public HttpResponseResult remove(@PathVariable Long id) {
+        if (id != null) {
 			return failed("参数不能为空");
 		}
-		return status(bbsReplyService.removeByIds(StringUtil.toLongList(ids)));
+		return status(bbsReplyService.removeById(id));
+	}
+
+
+
+	@PostMapping("/audit")
+	@ApiOperation(value = "后台-评论审核")
+	public HttpResponseResult audit(@RequestBody @Valid ReplyAuditDto auditDto) {
+
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null || null == user.getId()) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		auditDto.setVerityUserId(user.getId());
+		return status(bbsReplyService.audit(auditDto));
 	}
 }

+ 144 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/controller/HomeController.java

@@ -0,0 +1,144 @@
+package com.yonge.cooleshow.bbs.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.bbs.dto.search.*;
+import com.yonge.cooleshow.bbs.entity.BbsArticle;
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
+import com.yonge.cooleshow.bbs.service.*;
+import com.yonge.cooleshow.bbs.valid.AddGroup;
+import com.yonge.cooleshow.bbs.vo.*;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.toolset.base.exception.BizException;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.mybatis.support.PageUtil;
+import com.yonge.toolset.utils.string.StringUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+@RestController
+@RequestMapping("/home")
+@Api(value = "个人中心", tags = "个人中心")
+public class HomeController extends BaseController {
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private BbsArticleService bbsArticleService;
+
+    @Autowired
+    private BbsReplyService replyService;
+
+    @Autowired
+    private BbsCollectService collectService;
+
+    @Autowired
+    private BbsLikeService likeService;
+
+    @Autowired
+    private BbsFollowService followService;
+
+	@PostMapping("")
+	@ApiOperation(value = "首页", notes = "传入bbsArticleSearch")
+	public HttpResponseResult<PageInfo<BbsArticleVo>> home(@RequestBody BbsArticleSearch query) {
+		query.setDelFlag(false);
+		query.setStatus(ArticleEnum.PASS);
+		IPage<BbsArticleVo> pages = bbsArticleService.selectPage(PageUtil.getPage(query), query);
+		return succeed(PageUtil.pageInfo(pages));
+	}
+
+
+    @PostMapping("/article")
+    @ApiOperation(value = "文章列表")
+    public HttpResponseResult<PageInfo<BbsArticleVo>> articleList(@RequestBody BbsArticleSearch query) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            throw  new BizException("请重新登录");
+        }
+        query.setUserId(user.getId());
+
+        IPage<BbsArticleVo> pages = bbsArticleService.selectPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+
+    @PostMapping("/comment")
+    @ApiOperation(value = "评论列表")
+    public HttpResponseResult<PageInfo<BbsReplyVo>> commentList(@RequestBody BbsReplySearch query) {
+
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            throw  new BizException("请重新登录");
+        }
+        query.setUserId(user.getId());
+
+        IPage<BbsReplyVo> pages = replyService.selectCommentPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+
+    @PostMapping("/reply")
+    @ApiOperation(value = "回复列表")
+    public HttpResponseResult<PageInfo<BbsReplyVo>> replyList(@RequestBody BbsReplySearch query) {
+
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            throw  new BizException("请重新登录");
+        }
+        query.setUserId(user.getId());
+
+        IPage<BbsReplyVo> pages = replyService.selectReplyPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+
+    @PostMapping("/collect")
+    @ApiOperation(value = "收藏夹列表")
+    public HttpResponseResult<PageInfo<BbsCollectVo>> collectList(@RequestBody BbsCollectSearch query) {
+
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            throw  new BizException("请重新登录");
+        }
+        query.setUserId(user.getId());
+        IPage<BbsCollectVo> pages = collectService.selectPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+
+    @PostMapping("/like")
+    @ApiOperation(value = "点赞列表")
+    public HttpResponseResult<PageInfo<BbsLikeVo>> likeList(@RequestBody BbsLikeSearch query) {
+
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            throw  new BizException("请重新登录");
+        }
+        query.setUserId(user.getId());
+
+        IPage<BbsLikeVo> pages = likeService.selectPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
+    @PostMapping("/follow")
+    @ApiOperation(value = "关注/粉丝列表")
+    public HttpResponseResult<PageInfo<BbsFollowVo>> followList(@RequestBody @Valid BbsFollowSearch query) {
+
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || user.getId() == null) {
+            throw  new BizException("请重新登录");
+        }
+        query.setUserId(user.getId());
+
+        IPage<BbsFollowVo> pages = followService.selectPage(PageUtil.getPage(query), query);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+}

+ 34 - 8
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsPrivateMessageDao.java

@@ -4,27 +4,53 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.bbs.dto.BbsPrivateMessageDto;
+import com.yonge.cooleshow.bbs.dto.MessageReadDto;
+import com.yonge.cooleshow.bbs.dto.PrivateMessagePersonVo;
 import org.apache.ibatis.annotations.Param;
 import com.yonge.cooleshow.bbs.entity.BbsPrivateMessage;
 import com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo;
 import com.yonge.cooleshow.bbs.dto.search.BbsPrivateMessageSearch;
 
 
-public interface BbsPrivateMessageDao extends BaseMapper<BbsPrivateMessage>{
+public interface BbsPrivateMessageDao extends BaseMapper<BbsPrivateMessage> {
 	/**
 	 * 查询详情
-     * @author liweifan
-     * @date 2022-06-09 17:27:11
-     * @return: com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo
+	 *
+	 * @author liweifan
+	 * @date 2022-06-09 17:27:11
+	 * @return: com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo
 	 */
 	BbsPrivateMessageVo detail(@Param("id") Long id);
 
 	/**
 	 * 分页查询
-     * @author liweifan
-     * @date 2022-06-09 17:27:11
-     * @return: com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo
+	 *
+	 * @author liweifan
+	 * @date 2022-06-09 17:27:11
+	 * @return: com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo
 	 */
 	List<BbsPrivateMessageVo> selectPage(@Param("page") IPage page, @Param("param") BbsPrivateMessageSearch bbsPrivateMessage);
-	
+
+	/**
+	 * 私信人员列表
+	 *
+	 * @param page  分页
+	 * @param query 查询条件
+	 * @return
+	 */
+	List<PrivateMessagePersonVo> selectPersonPage(@Param("page") IPage<PrivateMessagePersonVo> page, @Param("query") BbsPrivateMessageSearch query);
+
+	/**
+	 * 设置已读
+	 *
+	 * @param readDto
+	 * @return
+	 */
+	boolean read(@Param("readDto") MessageReadDto readDto);
+
+	/**
+	 * 私信人员消息列表
+	 */
+	List<BbsPrivateMessageDto> selectMessagePage(@Param("page") IPage<BbsPrivateMessageDto> page, @Param("query") BbsPrivateMessageSearch query);
 }

+ 9 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsReplyAuthRecordDao.java

@@ -0,0 +1,9 @@
+package com.yonge.cooleshow.bbs.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yonge.cooleshow.bbs.entity.BbsReplyAuthRecord;
+
+
+public interface BbsReplyAuthRecordDao extends BaseMapper<BbsReplyAuthRecord>{
+	
+}

+ 37 - 8
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dao/BbsReplyDao.java

@@ -4,27 +4,56 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.bbs.vo.BbsReplyAuditVo;
 import org.apache.ibatis.annotations.Param;
 import com.yonge.cooleshow.bbs.entity.BbsReply;
 import com.yonge.cooleshow.bbs.vo.BbsReplyVo;
 import com.yonge.cooleshow.bbs.dto.search.BbsReplySearch;
 
 
-public interface BbsReplyDao extends BaseMapper<BbsReply>{
+public interface BbsReplyDao extends BaseMapper<BbsReply> {
 	/**
 	 * 查询详情
-     * @author liweifan
-     * @date 2022-06-09 17:27:11
-     * @return: com.yonge.cooleshow.bbs.vo.BbsReplyVo
+	 *
+	 * @author liweifan
+	 * @date 2022-06-09 17:27:11
+	 * @return: com.yonge.cooleshow.bbs.vo.BbsReplyVo
 	 */
 	BbsReplyVo detail(@Param("id") Long id);
 
 	/**
 	 * 分页查询
-     * @author liweifan
-     * @date 2022-06-09 17:27:11
-     * @return: com.yonge.cooleshow.bbs.vo.BbsReplyVo
+	 *
+	 * @author liweifan
+	 * @date 2022-06-09 17:27:11
+	 * @return: com.yonge.cooleshow.bbs.vo.BbsReplyVo
 	 */
 	List<BbsReplyVo> selectPage(@Param("page") IPage page, @Param("param") BbsReplySearch bbsReply);
-	
+
+	/**
+	 * 我的评论列表
+	 *
+	 * @param page  分页
+	 * @param query
+	 * @return
+	 */
+	List<BbsReplyVo> selectCommentPage(@Param("page") IPage<BbsReplyVo> page, @Param("query") BbsReplySearch query);
+
+	/**
+	 * 我的回复列表
+	 *
+	 * @param page  分页
+	 * @param query
+	 * @return
+	 */
+	List<BbsReplyVo> selectReplyPage(@Param("page") IPage<BbsReplyVo> page, @Param("query") BbsReplySearch query);
+
+	/**
+	 * 评论审核列表
+	 *
+	 * @param page
+	 * @param query
+	 * @return
+	 */
+	List<BbsReplyAuditVo> selectAuditListPage(@Param("page") IPage<BbsReplyAuditVo> page, @Param("query") BbsReplySearch query);
 }

+ 48 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/BbsPrivateMessageDto.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.bbs.dto;
 
 import com.yonge.cooleshow.bbs.entity.BbsPrivateMessage;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.beanutils.BeanUtils;
 
 /**
@@ -11,7 +12,53 @@ import org.apache.commons.beanutils.BeanUtils;
 @ApiModel(value = "BbsPrivateMessageDto对象", description = "私信数据传输对象")
 public class BbsPrivateMessageDto extends BbsPrivateMessage{
 	private static final long serialVersionUID = 1L;
-    
+
+    @ApiModelProperty("私信对象名")
+    private String receiverName;
+
+    @ApiModelProperty("私信对象头像")
+    private String receiverAvatar;
+
+
+    @ApiModelProperty("用户名")
+    private String userName;
+
+    @ApiModelProperty("头像")
+    private String userAvatar;
+
+
+    public String getReceiverName() {
+        return receiverName;
+    }
+
+    public void setReceiverName(String receiverName) {
+        this.receiverName = receiverName;
+    }
+
+    public String getReceiverAvatar() {
+        return receiverAvatar;
+    }
+
+    public void setReceiverAvatar(String receiverAvatar) {
+        this.receiverAvatar = receiverAvatar;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getUserAvatar() {
+        return userAvatar;
+    }
+
+    public void setUserAvatar(String userAvatar) {
+        this.userAvatar = userAvatar;
+    }
+
     public BbsPrivateMessageDto buildDto(BbsPrivateMessage bbsPrivateMessage){
         try {
             BeanUtils.copyProperties(this,bbsPrivateMessage);

+ 56 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/MessageReadDto.java

@@ -0,0 +1,56 @@
+package com.yonge.cooleshow.bbs.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-06-11
+ */
+@ApiModel("已读数据")
+public class MessageReadDto {
+
+    @ApiModelProperty(value = "当前用户id",hidden = true)
+    private Long userId;
+
+    @ApiModelProperty(value = "私信对象id",required = true)
+    @NotNull(message = "私信对象id不能为空 ")
+    private Long sendUserId;
+
+    @ApiModelProperty(value = "阅读时间",required = true)
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @NotNull(message = "阅读时间不能为空 ")
+    private Date readTime;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getSendUserId() {
+        return sendUserId;
+    }
+
+    public void setSendUserId(Long sendUserId) {
+        this.sendUserId = sendUserId;
+    }
+
+    public Date getReadTime() {
+        return readTime;
+    }
+
+    public void setReadTime(Date readTime) {
+        this.readTime = readTime;
+    }
+}

+ 82 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/PrivateMessagePersonVo.java

@@ -0,0 +1,82 @@
+package com.yonge.cooleshow.bbs.dto;
+
+import com.yonge.cooleshow.bbs.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-06-11
+ */
+@ApiModel("私信人员列表")
+public class PrivateMessagePersonVo {
+
+    @ApiModelProperty("私信对象userid")
+    private Long messageUserId;
+
+    @ApiModelProperty("用户名")
+    private String username;
+
+    @ApiModelProperty("头像")
+    private String avatar;
+
+    @ApiModelProperty(value = "0:未读 1:已读")
+    private YesOrNoEnum readFlag;
+
+    @ApiModelProperty("最后一条消息发送时间")
+    private String messageTime;
+
+    @ApiModelProperty("最后一条消息内容")
+    private String messageContent;
+
+
+    public Long getMessageUserId() {
+        return messageUserId;
+    }
+
+    public void setMessageUserId(Long messageUserId) {
+        this.messageUserId = messageUserId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getMessageTime() {
+        return messageTime;
+    }
+
+    public void setMessageTime(String messageTime) {
+        this.messageTime = messageTime;
+    }
+
+    public String getMessageContent() {
+        return messageContent;
+    }
+
+    public void setMessageContent(String messageContent) {
+        this.messageContent = messageContent;
+    }
+
+    public YesOrNoEnum getReadFlag() {
+        return readFlag;
+    }
+
+    public void setReadFlag(YesOrNoEnum readFlag) {
+        this.readFlag = readFlag;
+    }
+}

+ 63 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/ReplyAuditDto.java

@@ -0,0 +1,63 @@
+package com.yonge.cooleshow.bbs.dto;
+
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-06-13
+ */
+@ApiModel("评论审核信息")
+public class ReplyAuditDto {
+
+    @ApiModelProperty("评论id")
+    @NotNull(message = "评论id不能为空")
+    private Long replyId;
+
+    @ApiModelProperty("审核状态 审核中:DOING,通过:PASS,驳回:REJECT")
+    @NotNull(message = "审核状态不能为空")
+    private ArticleEnum status;
+
+    @ApiModelProperty(value = "审核人id",hidden = true)
+    private Long  verityUserId;
+
+    @ApiModelProperty("审核理由")
+    private String reason;
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public Long getReplyId() {
+        return replyId;
+    }
+
+    public void setReplyId(Long replyId) {
+        this.replyId = replyId;
+    }
+
+    public ArticleEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(ArticleEnum status) {
+        this.status = status;
+    }
+
+    public Long getVerityUserId() {
+        return verityUserId;
+    }
+
+    public void setVerityUserId(Long verityUserId) {
+        this.verityUserId = verityUserId;
+    }
+}

+ 11 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsCollectSearch.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.bbs.dto.search;
 
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author: liweifan
@@ -11,4 +12,14 @@ import io.swagger.annotations.ApiModel;
 public class BbsCollectSearch extends QueryInfo{
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty("登录人id")
+	private Long userId;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
 }

+ 25 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsFollowSearch.java

@@ -2,6 +2,9 @@ package com.yonge.cooleshow.bbs.dto.search;
 
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
 
 /**
  * @Author: liweifan
@@ -11,4 +14,26 @@ import io.swagger.annotations.ApiModel;
 public class BbsFollowSearch extends QueryInfo{
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty("登录人id")
+	private Long userId;
+
+	@ApiModelProperty(value = "FOLLOW:关注,FANS:粉丝",required = true)
+	@NotBlank(message = "类型不能为空")
+	private String type;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
 }

+ 12 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsLikeSearch.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.bbs.dto.search;
 
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author: liweifan
@@ -11,4 +12,15 @@ import io.swagger.annotations.ApiModel;
 public class BbsLikeSearch extends QueryInfo{
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty("登录人id")
+	private Long userId;
+
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
 }

+ 25 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsPrivateMessageSearch.java

@@ -2,6 +2,9 @@ package com.yonge.cooleshow.bbs.dto.search;
 
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
 
 /**
  * @Author: liweifan
@@ -11,4 +14,26 @@ import io.swagger.annotations.ApiModel;
 public class BbsPrivateMessageSearch extends QueryInfo{
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "当前用户id",hidden = true)
+	private Long userId;
+
+	@ApiModelProperty(value = "私信对象userid",required = true)
+	@NotNull(message = "私信对象不能为空")
+	private Long receiverUserId;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public Long getReceiverUserId() {
+		return receiverUserId;
+	}
+
+	public void setReceiverUserId(Long receiverUserId) {
+		this.receiverUserId = receiverUserId;
+	}
 }

+ 23 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/dto/search/BbsReplySearch.java

@@ -1,7 +1,9 @@
 package com.yonge.cooleshow.bbs.dto.search;
 
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author: liweifan
@@ -11,4 +13,25 @@ import io.swagger.annotations.ApiModel;
 public class BbsReplySearch extends QueryInfo{
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "论坛登录用户id",hidden = true)
+	private Long userId;
+
+	@ApiModelProperty("评论审核状态 DOING :审核中,PASS:审核 通过,REJECT:拒绝")
+	private ArticleEnum status;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public ArticleEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(ArticleEnum status) {
+		this.status = status;
+	}
 }

+ 20 - 2
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/entity/BbsPrivateMessage.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.yonge.cooleshow.bbs.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -13,6 +14,9 @@ import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
 /**
  * 私信
  */
@@ -28,14 +32,20 @@ public class BbsPrivateMessage implements Serializable {
     @TableField(value = "send_user_id_")
     private Long sendUserId;
 
-    @ApiModelProperty("接受方用户id")
+    @ApiModelProperty(value = "接受方用户id",required = true)
+    @NotNull(message = "私信接收方id不能为空")
     @TableField(value = "receiver_user_id_")
     private Long receiverUserId;
 
-    @ApiModelProperty("发送消息内容")
+    @ApiModelProperty(value = "发送消息内容",required = true)
+    @NotBlank(message = "私信信息不能为空")
     @TableField(value = "message_content_")
     private String messageContent;
 
+    @ApiModelProperty(value = "0:未读 1:已读")
+    @TableField(value = "read_flag_")
+    private YesOrNoEnum readFlag;
+
     @ApiModelProperty("发送时间")
     @TableField(value = "created_time_")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -81,4 +91,12 @@ public class BbsPrivateMessage implements Serializable {
     public void setCreatedTime(Date createdTime) {
         this.createdTime = createdTime;
     }
+
+    public YesOrNoEnum getReadFlag() {
+        return readFlag;
+    }
+
+    public void setReadFlag(YesOrNoEnum readFlag) {
+        this.readFlag = readFlag;
+    }
 }

+ 103 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/entity/BbsReplyAuthRecord.java

@@ -0,0 +1,103 @@
+package com.yonge.cooleshow.bbs.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 文章审核表
+ */
+@TableName("bbs_reply_auth_record")
+@ApiModel(value = "BbsReplyAuthRecord对象", description = "文章审核表")
+public class BbsReplyAuthRecord implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+    @ApiModelProperty("评论id ")
+    @TableField(value = "reply_id_")
+    private Long replyId;
+    @ApiModelProperty("审核中:DOING,通过:PASS,驳回:REJECT ")
+    @TableField(value = "audit_state_")
+    private ArticleEnum auditState;
+    @ApiModelProperty("审核人 ")
+    @TableField(value = "verify_user_id_")
+    private Long verifyUserId;
+    @ApiModelProperty("审核理由 ")
+    @TableField(value = "reason_")
+    private String reason;
+    @TableField(value = "create_time_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+    @TableField(value = "update_time_")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getReplyId() {
+        return replyId;
+    }
+
+    public void setReplyId(Long replyId) {
+        this.replyId = replyId;
+    }
+
+    public ArticleEnum getAuditState() {
+        return auditState;
+    }
+
+    public void setAuditState(ArticleEnum auditState) {
+        this.auditState = auditState;
+    }
+
+    public Long getVerifyUserId() {
+        return verifyUserId;
+    }
+
+    public void setVerifyUserId(Long verifyUserId) {
+        this.verifyUserId = verifyUserId;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+}

+ 2 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsCollectService.java

@@ -2,9 +2,11 @@ package com.yonge.cooleshow.bbs.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.bbs.dto.search.BbsReplySearch;
 import com.yonge.cooleshow.bbs.vo.BbsCollectVo;
 import com.yonge.cooleshow.bbs.dto.search.BbsCollectSearch;
 import com.yonge.cooleshow.bbs.entity.BbsCollect;
+import com.yonge.cooleshow.bbs.vo.BbsReplyVo;
 
 /**
  * 收藏 服务类

+ 27 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsPrivateMessageService.java

@@ -2,6 +2,9 @@ package com.yonge.cooleshow.bbs.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.bbs.dto.BbsPrivateMessageDto;
+import com.yonge.cooleshow.bbs.dto.MessageReadDto;
+import com.yonge.cooleshow.bbs.dto.PrivateMessagePersonVo;
 import com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo;
 import com.yonge.cooleshow.bbs.dto.search.BbsPrivateMessageSearch;
 import com.yonge.cooleshow.bbs.entity.BbsPrivateMessage;
@@ -26,4 +29,28 @@ public interface BbsPrivateMessageService extends IService<BbsPrivateMessage>  {
  	 * @date 2022-06-09
      */
     IPage<BbsPrivateMessageVo> selectPage(IPage<BbsPrivateMessageVo> page, BbsPrivateMessageSearch query);
+
+	/**
+	 * 私信人员列表
+	 *
+	 * @param page 分页
+	 * @param query 条件
+	 * @return
+	 */
+    IPage<PrivateMessagePersonVo> selectPersonPage(IPage<PrivateMessagePersonVo> page, BbsPrivateMessageSearch query);
+
+	/**
+	 * 设置已读
+	 *
+	 * @param readDto 已读信息
+	 * @return
+	 */
+	boolean read(MessageReadDto readDto);
+
+	/**
+	 * 私信人员消息列表
+	 *
+	 * @return
+	 */
+	IPage<BbsPrivateMessageDto> selectMessagePage(IPage<BbsPrivateMessageDto> page, BbsPrivateMessageSearch query);
 }

+ 20 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsReplyAuthRecordService.java

@@ -0,0 +1,20 @@
+package com.yonge.cooleshow.bbs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.bbs.dto.ReplyAuditDto;
+import com.yonge.cooleshow.bbs.entity.BbsReplyAuthRecord;
+
+/**
+ * 文章审核表 服务类
+ * @author liweifan
+ * @date 2022-06-13
+ */
+public interface BbsReplyAuthRecordService extends IService<BbsReplyAuthRecord>  {
+
+    /**
+     * 评论审核
+     *
+     * @param auditDto 审核信息
+     */
+    void audit(ReplyAuditDto auditDto);
+}

+ 37 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/BbsReplyService.java

@@ -2,6 +2,8 @@ package com.yonge.cooleshow.bbs.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.bbs.dto.ReplyAuditDto;
+import com.yonge.cooleshow.bbs.vo.BbsReplyAuditVo;
 import com.yonge.cooleshow.bbs.vo.BbsReplyVo;
 import com.yonge.cooleshow.bbs.dto.search.BbsReplySearch;
 import com.yonge.cooleshow.bbs.entity.BbsReply;
@@ -26,4 +28,39 @@ public interface BbsReplyService extends IService<BbsReply>  {
  	 * @date 2022-06-09
      */
     IPage<BbsReplyVo> selectPage(IPage<BbsReplyVo> page, BbsReplySearch query);
+
+	/**
+	 * 我的评论列表
+	 *
+	 * @param page 分页
+	 * @param query
+	 * @return
+	 */
+	IPage<BbsReplyVo> selectCommentPage(IPage<BbsReplyVo> page, BbsReplySearch query);
+
+	/**
+	 * 我的回复列表
+	 *
+	 * @param page 分页
+	 * @param query
+	 * @return
+	 */
+	IPage<BbsReplyVo> selectReplyPage(IPage<BbsReplyVo> page, BbsReplySearch query);
+
+	/**
+	 * 评论审核列表
+	 *
+	 * @param page 分页
+	 * @param query 查询条件
+	 * @return
+	 */
+	IPage<BbsReplyAuditVo> selectAuditListPage(IPage<BbsReplyAuditVo> page, BbsReplySearch query);
+
+	/**
+	 * 评论审核
+	 *
+	 * @param auditDto 审核信息
+	 * @return
+	 */
+	boolean audit(ReplyAuditDto auditDto);
 }

+ 19 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/impl/BbsPrivateMessageServiceImpl.java

@@ -2,6 +2,9 @@ package com.yonge.cooleshow.bbs.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.bbs.dto.BbsPrivateMessageDto;
+import com.yonge.cooleshow.bbs.dto.MessageReadDto;
+import com.yonge.cooleshow.bbs.dto.PrivateMessagePersonVo;
 import org.springframework.stereotype.Service;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,5 +28,20 @@ public class BbsPrivateMessageServiceImpl extends ServiceImpl<BbsPrivateMessageD
     public IPage<BbsPrivateMessageVo> selectPage(IPage<BbsPrivateMessageVo> page, BbsPrivateMessageSearch query){
         return page.setRecords(baseMapper.selectPage(page, query));
     }
-	
+
+    @Override
+    public IPage<PrivateMessagePersonVo> selectPersonPage(IPage<PrivateMessagePersonVo> page, BbsPrivateMessageSearch query) {
+        return page.setRecords(baseMapper.selectPersonPage(page, query));
+    }
+
+    @Override
+    public boolean read(MessageReadDto readDto) {
+        return baseMapper.read(readDto) ;
+    }
+
+    @Override
+    public IPage<BbsPrivateMessageDto> selectMessagePage(IPage<BbsPrivateMessageDto> page, BbsPrivateMessageSearch query) {
+        return page.setRecords(baseMapper.selectMessagePage(page, query));
+    }
+
 }

+ 38 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/impl/BbsReplyAuthRecordServiceImpl.java

@@ -0,0 +1,38 @@
+package com.yonge.cooleshow.bbs.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.bbs.dao.BbsReplyAuthRecordDao;
+import com.yonge.cooleshow.bbs.dto.ReplyAuditDto;
+import com.yonge.cooleshow.bbs.entity.BbsReplyAuthRecord;
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
+import com.yonge.cooleshow.bbs.service.BbsReplyAuthRecordService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+
+@Service
+public class BbsReplyAuthRecordServiceImpl extends ServiceImpl<BbsReplyAuthRecordDao, BbsReplyAuthRecord> implements
+        BbsReplyAuthRecordService {
+    private final static Logger log = LoggerFactory.getLogger(BbsReplyAuthRecordServiceImpl.class);
+
+
+    @Override
+    public void audit(ReplyAuditDto auditDto) {
+        this.lambdaUpdate()
+                .eq(BbsReplyAuthRecord::getReplyId, auditDto.getReplyId())
+                .eq(BbsReplyAuthRecord::getAuditState, ArticleEnum.DOING.getCode())
+                .remove();
+        BbsReplyAuthRecord bbsReplyAuthRecord = new BbsReplyAuthRecord();
+
+        bbsReplyAuthRecord.setReplyId(auditDto.getReplyId());
+        bbsReplyAuthRecord.setAuditState(auditDto.getStatus());
+        bbsReplyAuthRecord.setReason(auditDto.getReason());
+        bbsReplyAuthRecord.setCreateTime(new Date());
+        bbsReplyAuthRecord.setVerifyUserId(auditDto.getVerityUserId());
+        bbsReplyAuthRecord.setUpdateTime(new Date());
+        this.save(bbsReplyAuthRecord);
+    }
+}

+ 41 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/service/impl/BbsReplyServiceImpl.java

@@ -2,6 +2,12 @@ package com.yonge.cooleshow.bbs.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.bbs.dto.ReplyAuditDto;
+import com.yonge.cooleshow.bbs.enums.ArticleEnum;
+import com.yonge.cooleshow.bbs.service.BbsReplyAuthRecordService;
+import com.yonge.cooleshow.bbs.vo.BbsReplyAuditVo;
+import com.yonge.toolset.base.exception.BizException;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -16,6 +22,10 @@ import com.yonge.cooleshow.bbs.service.BbsReplyService;
 public class BbsReplyServiceImpl extends ServiceImpl<BbsReplyDao, BbsReply> implements BbsReplyService {
     private final static Logger log = LoggerFactory.getLogger(BbsReplyServiceImpl.class);
 
+
+    @Autowired
+    private BbsReplyAuthRecordService replyAuthRecordService;
+
 	@Override
     public BbsReplyVo detail(Long id) {
         return baseMapper.detail(id);
@@ -25,5 +35,35 @@ public class BbsReplyServiceImpl extends ServiceImpl<BbsReplyDao, BbsReply> impl
     public IPage<BbsReplyVo> selectPage(IPage<BbsReplyVo> page, BbsReplySearch query){
         return page.setRecords(baseMapper.selectPage(page, query));
     }
-	
+
+    @Override
+    public IPage<BbsReplyVo> selectCommentPage(IPage<BbsReplyVo> page, BbsReplySearch query) {
+        return page.setRecords(baseMapper.selectCommentPage(page, query));
+    }
+
+    @Override
+    public IPage<BbsReplyVo> selectReplyPage(IPage<BbsReplyVo> page, BbsReplySearch query) {
+        return page.setRecords(baseMapper.selectReplyPage(page, query));
+    }
+
+    @Override
+    public IPage<BbsReplyAuditVo> selectAuditListPage(IPage<BbsReplyAuditVo> page, BbsReplySearch query) {
+        return page.setRecords(baseMapper.selectAuditListPage(page, query));
+    }
+
+    @Override
+    public boolean audit(ReplyAuditDto auditDto) {
+        BbsReply bbsReply = this.getById(auditDto.getReplyId());
+        if (bbsReply == null) {
+            throw  new BizException("未找到当前评论信息");
+        }
+        if(!ArticleEnum.DOING.getCode().equals(bbsReply.getStatus().getCode())) {
+            throw  new BizException("评论已经审核");
+        }
+        bbsReply.setStatus(auditDto.getStatus());
+        this.updateById(bbsReply);
+        replyAuthRecordService.audit(auditDto);
+        return true;
+    }
+
 }

+ 37 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsCollectVo.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.bbs.vo;
 
 import com.yonge.cooleshow.bbs.entity.BbsCollect;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.beanutils.BeanUtils;
 
 /**
@@ -11,7 +12,42 @@ import org.apache.commons.beanutils.BeanUtils;
 @ApiModel(value = "BbsCollectVo对象", description = "收藏查询视图对象")
 public class BbsCollectVo extends BbsCollect{
 	private static final long serialVersionUID = 1L;
-    
+
+    @ApiModelProperty("标签id")
+    private Long labelId;
+
+    @ApiModelProperty("文章标题")
+    private String title;
+
+    @ApiModelProperty("标签名")
+    private String labelName;
+
+
+
+    public Long getLabelId() {
+        return labelId;
+    }
+
+    public void setLabelId(Long labelId) {
+        this.labelId = labelId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getLabelName() {
+        return labelName;
+    }
+
+    public void setLabelName(String labelName) {
+        this.labelName = labelName;
+    }
+
     public BbsCollectVo buildVo(BbsCollect bbsCollect){
         try {
             BeanUtils.copyProperties(this,bbsCollect);

+ 24 - 1
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsFollowVo.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.bbs.vo;
 
 import com.yonge.cooleshow.bbs.entity.BbsFollow;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.beanutils.BeanUtils;
 
 /**
@@ -11,7 +12,29 @@ import org.apache.commons.beanutils.BeanUtils;
 @ApiModel(value = "BbsFollowVo对象", description = "关注查询视图对象")
 public class BbsFollowVo extends BbsFollow{
 	private static final long serialVersionUID = 1L;
-    
+
+    @ApiModelProperty("用户名")
+    private String username;
+
+    @ApiModelProperty("头像")
+    private String avatar;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
     public BbsFollowVo buildVo(BbsFollow bbsFollow){
         try {
             BeanUtils.copyProperties(this,bbsFollow);

+ 100 - 0
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsReplyAuditVo.java

@@ -0,0 +1,100 @@
+package com.yonge.cooleshow.bbs.vo;
+
+import com.yonge.cooleshow.bbs.entity.BbsReply;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.beanutils.BeanUtils;
+
+import java.util.Date;
+
+
+public class BbsReplyAuditVo extends BbsReply {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("话题标题")
+    private String articleTitle;
+
+
+    @ApiModelProperty("评论人昵称")
+    private String userName;
+
+    @ApiModelProperty("评论人真实姓名")
+    private String realName;
+
+    @ApiModelProperty("评论人手机号")
+    private String phone;
+
+    @ApiModelProperty("审核人昵称")
+    private String verifyName;
+
+    @ApiModelProperty("审核理由")
+    private String reason;
+
+    @ApiModelProperty("审核时间")
+    private Date verifyTime;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getVerifyName() {
+        return verifyName;
+    }
+
+    public void setVerifyName(String verifyName) {
+        this.verifyName = verifyName;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public Date getVerifyTime() {
+        return verifyTime;
+    }
+
+    public void setVerifyTime(Date verifyTime) {
+        this.verifyTime = verifyTime;
+    }
+
+    public BbsReplyAuditVo buildVo(BbsReply bbsReply) {
+        try {
+            BeanUtils.copyProperties(this, bbsReply);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return this;
+    }
+
+    public String getArticleTitle() {
+        return articleTitle;
+    }
+
+    public void setArticleTitle(String articleTitle) {
+        this.articleTitle = articleTitle;
+    }
+}

+ 17 - 5
cooleshow-bbs/src/main/java/com/yonge/cooleshow/bbs/vo/BbsReplyVo.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.bbs.vo;
 
 import com.yonge.cooleshow.bbs.entity.BbsReply;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.beanutils.BeanUtils;
 
 /**
@@ -9,16 +10,27 @@ import org.apache.commons.beanutils.BeanUtils;
  * @Data: 2022-06-09 17:27:11
  */
 @ApiModel(value = "BbsReplyVo对象", description = "文章评论查询视图对象")
-public class BbsReplyVo extends BbsReply{
-	private static final long serialVersionUID = 1L;
-    
-    public BbsReplyVo buildVo(BbsReply bbsReply){
+public class BbsReplyVo extends BbsReply {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("话题标题")
+    private String articleTitle;
+
+
+    public BbsReplyVo buildVo(BbsReply bbsReply) {
         try {
-            BeanUtils.copyProperties(this,bbsReply);
+            BeanUtils.copyProperties(this, bbsReply);
         } catch (Exception e) {
             e.printStackTrace();
         }
         return this;
     }
 
+    public String getArticleTitle() {
+        return articleTitle;
+    }
+
+    public void setArticleTitle(String articleTitle) {
+        this.articleTitle = articleTitle;
+    }
 }

+ 4 - 4
cooleshow-bbs/src/main/resources/config/mybatis/BbsArticleMapper.xml

@@ -58,14 +58,14 @@
         	<include refid="baseColumns" />
 		FROM bbs_article t
         <where>
-            <if test="param.status != null and param.status != ''">
-                and #{param.status,jdbcType=VARCHAR} = t.status_
+            <if test="param.status != null ">
+                and #{param.status} = t.status_
             </if>
             <if test="param.search != null and param.search != ''">
                 and t.title_ like  concat('%',#{param.search},'%')
             </if>
             <if test="param.label != null">
-                and t.label_id_ = #{param.label,jdbcType=BIGINT}
+                and t.label_id_ = #{param.label}
             </if>
             <if test="param.userId != null" >
                 and t.user_id_ = #{param.userId}
@@ -74,7 +74,7 @@
                 and t.del_flag_ = #{param.delFlag}
             </if>
         </where>
-        order by
+        order by find_in_set(t.top_flag_,1),
             <if test="param.sort != null">
                 <choose>
                     <when test="param.sort == 'HOT'">

+ 11 - 1
cooleshow-bbs/src/main/resources/config/mybatis/BbsCollectMapper.xml

@@ -26,6 +26,16 @@
     <select id="selectPage" resultType="com.yonge.cooleshow.bbs.vo.BbsCollectVo">
 		SELECT         
         	<include refid="baseColumns" />
+        ,ba.title_ as title
+        ,ba.label_name_ as labelName
+        ,ba.label_id_ as labelId
 		FROM bbs_collect t
-	</select>
+        left join bbs_article ba on t.article_id_ = ba.id_
+        <where>
+            <if test="param.userId != null">
+                and #{param.userId,jdbcType=BIGINT} = t.collect_user_id_
+            </if>
+        </where>
+        order by t.created_time_ desc
+    </select>
 </mapper>

+ 24 - 0
cooleshow-bbs/src/main/resources/config/mybatis/BbsFollowMapper.xml

@@ -26,6 +26,30 @@
     <select id="selectPage" resultType="com.yonge.cooleshow.bbs.vo.BbsFollowVo">
 		SELECT         
         	<include refid="baseColumns" />
+        ,su.username_ as username
+        ,su.avatar_ as avatar
 		FROM bbs_follow t
+        left join sys_user su on
+        <choose>
+            <when test="param.type == 'FANS'">
+                t.user_id_ = su.id_
+            </when>
+            <when test="param.type == 'FOLLOW'">
+                t.friend_user_id = su.id_
+            </when>
+        </choose>
+
+        <where>
+            <if test="param.userId != null">
+                <choose>
+                    <when test="param.type == 'FANS'">
+                        t.friend_user_id = #{param.userId}
+                    </when>
+                    <when test="param.type == 'FOLLOW'">
+                        and t.user_id_ = #{param.userId}
+                    </when>
+                </choose>
+            </if>
+        </where>
 	</select>
 </mapper>

+ 7 - 0
cooleshow-bbs/src/main/resources/config/mybatis/BbsLikeMapper.xml

@@ -27,5 +27,12 @@
 		SELECT         
         	<include refid="baseColumns" />
 		FROM bbs_like t
+        left join bbs_article ba on t.article_id_ = ba.id_
+        <where>
+            <if test="param.userId != null">
+                t.like_user_id_ = #{param.userId}
+            </if>
+        </where>
+        order by t.created_time_ desc
 	</select>
 </mapper>

+ 49 - 0
cooleshow-bbs/src/main/resources/config/mybatis/BbsPrivateMessageMapper.xml

@@ -16,6 +16,7 @@
         , t.receiver_user_id_ as receiverUserId
         , t.message_content_ as messageContent
         , t.created_time_ as createdTime
+        , t.read_flag_ as readFlag
         </sql> 
     
     <select id="detail" resultType="com.yonge.cooleshow.bbs.vo.BbsPrivateMessageVo">
@@ -30,4 +31,52 @@
         	<include refid="baseColumns" />
 		FROM bbs_private_message t
 	</select>
+
+	<select id="selectPersonPage" resultType="com.yonge.cooleshow.bbs.dto.PrivateMessagePersonVo">
+
+        select
+            bpm.message_content_ as messageContext,
+            bpm.created_time_ as messageTime,
+            bpm.read_flag_ as readFlag,
+            if(bpm.send_user_id_ = #{query.userId},bpm.receiver_user_id_,bpm.send_user_id_) as messageUserId,
+            if(su.id_ = #{query.userId},su2.username_,su.username_) as username,
+            if(su.id_ = #{query.userId},su2.avatar_,su.avatar_) as avatar
+        from bbs_private_message bpm
+        left join sys_user su on bpm.send_user_id_ = su.id_
+        left  join sys_user su2 on su2.id_ = bpm.receiver_user_id_
+        <where>
+            <if test="query.userId != null">
+                and (#{query.userId} = bpm.send_user_id_ or #{query.userId} = bpm.receiver_user_id_)
+            </if>
+        </where>
+        group by bpm.send_user_id_
+
+    </select>
+
+	<update id="read">
+        update bbs_private_message bpm set bpm.read_flag_ = 1
+        where #{readDto.userId} = bpm.send_user_id_
+        and #{readDto.sendUserId} = bpm.receiver_user_id_
+        and #{readDto.readTime} &gt; bpm.created_time_
+    </update>
+
+	<select id="selectMessagePage" resultType="com.yonge.cooleshow.bbs.dto.BbsPrivateMessageDto">
+
+        select
+        bpm.id as id
+        , bpm.send_user_id_ as sendUserId
+        , bpm.receiver_user_id_ as receiverUserId
+        , bpm.message_content_ as messageContent
+        , bpm.created_time_ as createdTime
+        , bpm.read_flag_ as readFlag
+        from bbs_private_message bpm
+        <where>
+            <if test="query.userId != null and query.receiverUserId != null">
+                and ((#{query.userId} = bpm.send_user_id_ and #{query.receiverUserId} = bpm.receiver_user_id_)
+                or (#{query.userId} = bpm.receiver_user_id_ and #{query.receiverUserId} = bpm.send_user_id_))
+            </if>
+        </where>
+
+        order by bpm.created_time_ desc
+    </select>
 </mapper>

+ 6 - 0
cooleshow-bbs/src/main/resources/config/mybatis/BbsReplyAuthRecordMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.bbs.dao.BbsReplyAuthRecordDao">
+
+
+</mapper>

+ 79 - 0
cooleshow-bbs/src/main/resources/config/mybatis/BbsReplyMapper.xml

@@ -35,5 +35,84 @@
 		SELECT         
         	<include refid="baseColumns" />
 		FROM bbs_reply t
+        <where>
+            <if test="param.userId != null">
+                and #{param.userId} = t.user_id_
+            </if>
+        </where>
 	</select>
+
+	<select id="selectCommentPage" resultType="com.yonge.cooleshow.bbs.vo.BbsReplyVo">
+        select
+        br.id_ as id
+        , br.parent_id_ as parentId
+        , br.article_id as articleId
+        , br.user_id_ as userId
+        , br.content_ as content
+        , br.status_ as status
+        , br.created_time_ as createdTime
+        , br.updated_time_ as updatedTime
+        ,ba.title_ as articleTitle
+        from bbs_reply br
+        left join bbs_article ba on br.article_id = ba.id_
+        <where>
+            <if test="query.userId != null">
+                and  br.user_id_ = #{query.userId}
+            </if>
+        </where>
+        order by br.created_time_ desc
+    </select>
+
+	<select id="selectReplyPage" resultType="com.yonge.cooleshow.bbs.vo.BbsReplyVo">
+        select
+        br.id_ as id
+        , br.parent_id_ as parentId
+        , br.article_id as articleId
+        , br.user_id_ as userId
+        , br.content_ as content
+        , br.status_ as status
+        , br.created_time_ as createdTime
+        , br.updated_time_ as updatedTime
+        ,ba.title_ as articleTitle
+        from bbs_reply br
+        left join bbs_article ba on br.article_id = ba.id_
+        left join bbs_reply br2 on br.parent_id_ = br2.id_
+        <where>
+            ba.del_flag_ = 0
+            <if test="query.userId != null">
+                and  (ba.user_id_ = #{query.userId} or br2.user_id_ = #{query.userId})
+            </if>
+        </where>
+        order by br.created_time_ desc
+    </select>
+
+	<select id="selectAuditListPage" resultType="com.yonge.cooleshow.bbs.vo.BbsReplyAuditVo">
+        select
+        br.id_ as id
+        , br.parent_id_ as parentId
+        , br.article_id as articleId
+        , br.user_id_ as userId
+        , br.content_ as content
+        , br.status_ as status
+        , br.created_time_ as createdTime
+        , br.updated_time_ as updatedTime
+        ,ba.title_ as articleTitle
+        , su.username_ as userName
+        ,su.real_name_ as realName
+        ,su.phone_ as phone
+        ,verify.username_ as verifyName
+        ,brar.reason_ as reason
+        ,brar.update_time_ as verifyTime
+        from bbs_reply br
+        left join bbs_article ba on br.article_id = ba.id_
+        left join bbs_reply_auth_record brar on br.id_ = brar.reply_id_
+        left join sys_user su on br.user_id_ = su.id_
+        left join sys_user verify on verify.id_ = brar.verify_user_id_
+        <where>
+            ba.del_flag_ = 0
+            <if test="query.status != null">
+                and #{query.status} = brar.audit_state_
+            </if>
+        </where>
+    </select>
 </mapper>

+ 5 - 2
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/AppConstant.java

@@ -5,6 +5,7 @@ package com.yonge.cooleshow.common.constant;
  * @Data: 2022/5/5 10:02
  */
 public interface AppConstant {
+    String SERVER = "-server";
     /**
      * 网关
      */
@@ -49,6 +50,8 @@ public interface AppConstant {
      * 音频分析
      */
     String APPLICATION_AUDIO_ANALYSIS = "audio-analysis";
-
-    String SERVER = "-server";
+    /**
+     * 官网
+     */
+    String APPLICATION_WEBSITE = "website";
 }

+ 2 - 6
cooleshow-task/src/main/java/com/yonge/cooleshow/task/jobs/TeacherEarningTask.java

@@ -4,13 +4,9 @@ import com.yonge.cooleshow.api.feign.AdminFeignService;
 import com.yonge.cooleshow.task.core.BaseTask;
 import com.yonge.cooleshow.task.core.TaskException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
-/**
- * Description
- *
- * @author liujunchi
- * @date 2022-05-17
- */
+@Service
 public class TeacherEarningTask extends BaseTask {
 
 

+ 2 - 1
cooleshow-user/pom.xml

@@ -40,5 +40,6 @@
 		<module>user-classroom</module>
 		<module>user-admin</module>
 		<module>user-biz</module>
-	</modules>
+        <module>user-website</module>
+    </modules>
 </project>

+ 7 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicSheetAuthRecordService.java

@@ -19,4 +19,11 @@ public interface MusicSheetAuthRecordService extends IService<MusicSheetAuthReco
      * @return boolean
      */
     boolean audit(TeacherMusicSheetAuditReq param, Long userId);
+
+    /**
+     * 设置曲目审核中状态
+     *
+     * @param musicSheetId 曲目id
+     */
+    void setAuditDoing(Long musicSheetId);
 }

+ 22 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetAuthRecordServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yonge.cooleshow.biz.dal.dao.MusicSheetAuthRecordDao;
 import com.yonge.cooleshow.biz.dal.dto.req.TeacherMusicSheetAuditReq;
 import com.yonge.cooleshow.biz.dal.entity.MusicSheetAuthRecord;
+import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetAuthRecordService;
 import com.yonge.toolset.base.exception.BizException;
 import org.springframework.stereotype.Service;
@@ -22,6 +23,12 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
     @Transactional(rollbackFor = Exception.class)
     public boolean audit(TeacherMusicSheetAuditReq param, Long userId) {
 
+        // 删除审核中的状态
+        this.lambdaUpdate()
+                .eq(MusicSheetAuthRecord::getMusicSheetId,param.getMusicSheetId())
+                .eq(MusicSheetAuthRecord::getAuditState, AuthStatusEnum.DOING.getCode())
+                .remove();
+
         MusicSheetAuthRecord musicSheetAuthRecord = new MusicSheetAuthRecord();
         musicSheetAuthRecord.setMusicSheetId(param.getMusicSheetId());
         musicSheetAuthRecord.setCreateTime(new Date());
@@ -30,4 +37,19 @@ public class MusicSheetAuthRecordServiceImpl extends ServiceImpl<MusicSheetAuthR
         musicSheetAuthRecord.setVerifyUserId(userId);
         return this.saveOrUpdate(musicSheetAuthRecord);
     }
+
+    @Override
+    public void setAuditDoing(Long musicSheetId) {
+        List<MusicSheetAuthRecord> list = this.lambdaQuery()
+                                              .eq(MusicSheetAuthRecord::getMusicSheetId, musicSheetId)
+                                              .eq(MusicSheetAuthRecord::getAuditState, AuthStatusEnum.DOING.getCode())
+                                              .list();
+        if (!CollectionUtils.isEmpty(list)) {
+            return;
+        }
+        MusicSheetAuthRecord musicSheetAuthRecord = new MusicSheetAuthRecord();
+        musicSheetAuthRecord.setMusicSheetId(musicSheetId);
+        musicSheetAuthRecord.setAuditState(AuthStatusEnum.DOING);
+        this.saveOrUpdate(musicSheetAuthRecord);
+    }
 }

+ 10 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -109,6 +109,10 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao,MusicSheet>
         musicSheet.setState(YesOrNoEnum.NO);
         this.saveOrUpdate(musicSheet);
 
+        if (AuthStatusEnum.DOING.getCode().equals(musicSheet.getAuditStatus().getCode())) {
+            musicSheetAuthRecordService.setAuditDoing(musicSheet.getId());
+        }
+
         Long sheetId = musicSheet.getId();
         List<MusicSheetAccompaniment> list = musicSheetDto.getBackground();
         list.forEach(musicSheetAccompaniment -> musicSheetAccompaniment.setMusicSheetId(sheetId).setCreateBy(userId).setCreateTime(new Date()));
@@ -376,7 +380,12 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao,MusicSheet>
             musicSheet.setUpdateTime(new Date());
             musicSheet.setUpdateBy(userId);
             musicSheet.setState(YesOrNoEnum.NO);
-            return this.saveOrUpdate(musicSheet);
+            this.saveOrUpdate(musicSheet);
+            if (AuthStatusEnum.DOING.getCode().equals(musicSheet.getAuditStatus().getCode())) {
+                musicSheetAuthRecordService.setAuditDoing(musicSheet.getId());
+            }
+
+            return true;
         }
     }
 

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/MusicSheetDetailVo.java

@@ -37,6 +37,17 @@ public class MusicSheetDetailVo extends MusicSheet {
     @ApiModelProperty("声部名")
     private String subjectNames;
 
+    @ApiModelProperty("声部code")
+    private String code;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
     public String getUserAvatar() {
         return userAvatar;
     }

+ 2 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -808,14 +808,14 @@
         </foreach>)
     </update>
     <update id="updateEndTime">
-        UPDATE course_schedule SET status_='COMPLETE',settlement_time_=NOW() WHERE id_ IN(
+        UPDATE course_schedule SET status_='COMPLETE' WHERE id_ IN(
         <foreach collection="list" item="item" index="index" open="" close="" separator=",">
             #{item.courseId}
         </foreach>)
     </update>
     <update id="updateTeacherSalary" parameterType="java.util.List">
         UPDATE course_schedule_teacher_salary
-        SET status_='COMPLETE'
+        SET status_='COMPLETE',settlement_time_=NOW()
         WHERE course_schedule_id_ IN
         <foreach collection="list" item="item" open="(" separator="," close=")">
             #{item}

+ 5 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -178,11 +178,12 @@
         ,su.avatar_ as userAvatar
         ,(select group_concat(mt.name_) from music_tag mt
         where find_in_set(mt.id_,t.music_tag_) and mt.del_flag_ = 0) as musicTagNames
-        ,(select group_concat(s.name_) from subject s
-        where find_in_set(s.id_,t.music_subject_)  and s.del_flag_ = 0) as subjectNames
+        ,s2.name_ as subjectNames
+        ,s2.code_ as code
         FROM music_sheet t
         left join music_sheet_accompaniment msa on msa.music_sheet_id_ = t.id_
         left join sys_user su on t.create_by_ = su.id_
+        left join subject s2 on t.music_subject_ = s2.id_
         where t.id_ = #{id}
          order by  msa.sort_number_
     </select>
@@ -431,7 +432,7 @@
         ,ms.play_speed_ as playSpeed
         ,ms.music_price_ as musicPrice
         ,ms.create_time_ as createTime
-        ,ms.audit_status_ as auditStatus
+        ,msar.audit_state_ as auditStatus
         ,su2.username_ as auditName
         from music_sheet ms
         left join sys_user su on su.id_ = ms.create_by_
@@ -448,7 +449,7 @@
                 and su2.username_ like concat('%',#{param.auditName},'%')
             </if>
             <if test="param.authStatus != null">
-                and ms.audit_status_ = #{param.authStatus}
+                and msar.audit_state_ = #{param.authStatus}
             </if>
             <if test="param.startTime != null">
                 and ms.create_time_ &gt; #{param.startTime}

+ 0 - 1
cooleshow-user/user-teacher/pom.xml

@@ -17,7 +17,6 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
     <dependencies>
-
         <dependency>
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>

+ 2 - 1
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherCourseScheduleController.java

@@ -159,8 +159,9 @@ public class TeacherCourseScheduleController extends BaseController {
     //测试未约满课老师
     @GetMapping("/test")
     public HttpResponseResult<Object> test(Integer amount) {
+//        courseScheduleService.scheduleTask();
 //        return succeed(courseScheduleService.getTeacherId(amount));
-        courseScheduleService.scheduleTask();
+//        courseScheduleService.scheduleTask();
         return succeed();
     }
 

+ 78 - 0
cooleshow-user/user-website/pom.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>com.yonge.cooleshow</groupId>
+        <artifactId>cooleshow-user</artifactId>
+        <version>1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.yonge.cooleshow</groupId>
+    <artifactId>user-website</artifactId>
+    <version>1.0</version>
+    <name>user-website</name>
+    <url>http://maven.apache.org</url>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-security</artifactId>
+        </dependency>
+
+        <!-- swagger-spring-boot -->
+        <dependency>
+            <groupId>com.spring4all</groupId>
+            <artifactId>swagger-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.yonge.toolset</groupId>
+            <artifactId>audit-log</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.yonge.toolset</groupId>
+            <artifactId>thirdparty-component</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.yonge.cooleshow</groupId>
+            <artifactId>user-biz</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.whvcse</groupId>
+            <artifactId>easy-captcha</artifactId>
+            <version>1.6.2</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 29 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/WebsiteApplication.java

@@ -0,0 +1,29 @@
+package com.yonge.cooleshow.website;
+
+import com.spring4all.swagger.EnableSwagger2Doc;
+import com.yonge.cooleshow.common.constant.AppConstant;
+import com.yonge.toolset.base.BaseApplication;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022/3/15 15:19
+ */
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients("com.yonge.cooleshow")
+@MapperScan(basePackages = {"com.yonge.cooleshow.biz.dal.dao", "com.yonge.toolset.payment.core.dao"})
+@ComponentScan(basePackages = {"com.yonge.cooleshow","com.yonge.toolset"})
+@Configuration
+@EnableSwagger2Doc
+public class WebsiteApplication {
+    public static void main(String[] args) {
+        BaseApplication.run(AppConstant.APPLICATION_WEBSITE, WebsiteApplication.class, args);
+    }
+
+}

+ 44 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/config/ResourceServerConfig.java

@@ -0,0 +1,44 @@
+package com.yonge.cooleshow.website.config;
+
+import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
+import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
+import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
+import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
+
+@Configuration
+@EnableResourceServer
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
+
+    @Autowired
+    private BaseAccessDeniedHandler baseAccessDeniedHandler;
+
+    @Autowired
+    private BaseAuthenticationEntryPoint baseAuthenticationEntryPoint;
+
+    @Override
+    public void configure(HttpSecurity http) throws Exception {
+        http.csrf()
+                .disable()
+                .exceptionHandling()
+                .accessDeniedHandler(baseAccessDeniedHandler)
+                .authenticationEntryPoint(baseAuthenticationEntryPoint)
+                .and()
+                .authorizeRequests()
+                .antMatchers("/task/*").hasIpAddress("0.0.0.0/0")
+                .antMatchers("/v2/api-docs", "/code/*",
+                        "/liveRoom/test", "/liveRoom/syncUserStatus", "/courseGroup/getLockCache", "/open/**")
+                .permitAll().anyRequest().authenticated().and().httpBasic();
+    }
+
+    @Override
+    public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
+        resources.authenticationEntryPoint(baseAuthenticationEntryPoint).accessDeniedHandler(baseAccessDeniedHandler);
+    }
+
+}

+ 54 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/config/WebMvcConfig.java

@@ -0,0 +1,54 @@
+package com.yonge.cooleshow.website.config;
+
+import com.yonge.cooleshow.biz.dal.config.LocalFastJsonHttpMessageConverter;
+import com.yonge.cooleshow.common.config.EnumConverterFactory;
+import com.yonge.cooleshow.website.interceptor.MDCInterceptor;
+import com.yonge.cooleshow.website.interceptor.OperationLogInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.format.FormatterRegistry;
+import org.springframework.http.MediaType;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Configuration
+public class WebMvcConfig implements WebMvcConfigurer {
+
+	@Autowired
+	private MDCInterceptor mdcInterceptor;
+
+	@Autowired
+	private OperationLogInterceptor operationLogInterceptor;
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		List<String> includePathPatterns = new ArrayList<String>();
+		includePathPatterns.add("/**");
+		List<String> excludePathPatterns = new ArrayList<String>();
+		excludePathPatterns.add("/login");
+		registry.addInterceptor(mdcInterceptor).addPathPatterns(includePathPatterns).excludePathPatterns(excludePathPatterns);
+	}
+
+	/**
+	 * 枚举类的转换器 addConverterFactory
+	 */
+	@Override
+	public void addFormatters(FormatterRegistry registry) {
+		registry.addConverterFactory(new EnumConverterFactory());
+	}
+	
+	@Bean
+    public HttpMessageConverters fastJsonHttpMessageConverters(){
+		LocalFastJsonHttpMessageConverter converter = new LocalFastJsonHttpMessageConverter();
+        List<MediaType> fastMediaTypes =  new ArrayList<MediaType>();
+        fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
+        converter.setSupportedMediaTypes(fastMediaTypes);
+        return new HttpMessageConverters(converter);
+    }
+
+}

+ 41 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/interceptor/MDCInterceptor.java

@@ -0,0 +1,41 @@
+package com.yonge.cooleshow.website.interceptor;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.toolset.utils.web.WebUtil;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Component
+public class MDCInterceptor extends HandlerInterceptorAdapter {
+
+	private static final String IP = "ip";
+
+	private static final String USERNAME = "username";
+	
+	@Autowired
+	@Lazy
+	private SysUserFeignService sysUserFeignService;
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser != null && sysUser.getId() != null) {
+			// 存储userId以及IP
+			MDC.put(USERNAME, sysUser.getUsername() + "@" + sysUser.getId());
+		}
+		MDC.put(IP, WebUtil.getRemoteIp(request));
+
+		return true;
+	}
+
+	@Override
+	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
+	}
+}

+ 31 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/interceptor/OperationLogInterceptor.java

@@ -0,0 +1,31 @@
+package com.yonge.cooleshow.website.interceptor;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.toolset.log.interceptor.AuditLogInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@Component
+public class OperationLogInterceptor extends AuditLogInterceptor {
+
+	@Autowired
+	@Lazy
+	private SysUserFeignService sysUserFeignService;
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser != null && sysUser.getId() != null) {
+			setUsername(sysUser.getRealName(),sysUser.getId());
+		}
+		return true;
+	}
+
+}

+ 12 - 0
cooleshow-user/user-website/src/main/resources/bootstrap-prod.yml

@@ -0,0 +1,12 @@
+spring:
+  cloud:
+    nacos:
+      config:
+        server-addr: 47.114.1.200:8848
+        namespace: 6f8374a9-598f-4889-bb17-476070ffb8de
+        group: DEFAULT_GROUP
+        prefix: website
+        file-extension: yaml
+        refresh:
+          enabled: true
+        enabled: true