123
This commit is contained in:
@@ -4,6 +4,7 @@ import com.ruoyi.cai.domain.User;
|
||||
import com.ruoyi.cai.domain.UserGreet;
|
||||
import com.ruoyi.cai.dto.app.query.IdRes;
|
||||
import com.ruoyi.cai.dto.app.query.user.UserGreetAddReq;
|
||||
import com.ruoyi.cai.dto.app.vo.user.UserGreetListVo;
|
||||
import com.ruoyi.cai.dto.app.vo.user.UserGreetVo;
|
||||
import com.ruoyi.cai.service.UserGreetService;
|
||||
import com.ruoyi.cai.service.UserService;
|
||||
@@ -33,14 +34,19 @@ public class UserGreetAppController {
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取当前用户打招呼列表")
|
||||
@Log(title = "获取当前用户打招呼列表", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<List<UserGreetVo>> list(){
|
||||
public R<List<UserGreetListVo>> list(){
|
||||
Long userId = LoginHelper.getUserId();
|
||||
User user = userService.getById(userId);
|
||||
if(user == null || user.getIsAnchor() == 0){
|
||||
return R.fail(600, "您不是女神,无法群打招呼,快去申请吧!");
|
||||
}
|
||||
UserGreetVo vo = new UserGreetVo();
|
||||
List<UserGreet> userGreet = userGreetService.listByUserId(userId);
|
||||
return R.ok(BeanConvertUtil.convertListTo(userGreet,UserGreetVo::new));
|
||||
List<UserGreetListVo> list = BeanConvertUtil.convertListTo(userGreet, UserGreetListVo::new);
|
||||
vo.setList(list);
|
||||
vo.setCount(20);
|
||||
vo.setAllowSend(1);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.cai.dto.app.vo.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "群打招呼")
|
||||
public class UserGreetListVo {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "内容")
|
||||
private String title;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@Schema(description = "审核状态 1 审核中, 2 审核通过, 3 审核不通过")
|
||||
private Integer auditStatus;
|
||||
|
||||
}
|
||||
@@ -1,28 +1,14 @@
|
||||
package com.ruoyi.cai.dto.app.vo.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "群打招呼")
|
||||
public class UserGreetVo {
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@Schema(description = "内容")
|
||||
private String title;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@Schema(description = "审核状态 1 审核中, 2 审核通过, 3 审核不通过")
|
||||
private Integer auditStatus;
|
||||
@Data
|
||||
public class UserGreetVo {
|
||||
private Integer allowSend;
|
||||
private Integer count;
|
||||
|
||||
private List<UserGreetListVo> list;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user