init
This commit is contained in:
@@ -7,25 +7,22 @@ import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.xq.domain.Dynamic;
|
||||
import com.ruoyi.xq.dto.app.dynamic.AddDynamicReq;
|
||||
import com.ruoyi.xq.dto.app.dynamic.DynamicListVo;
|
||||
import com.ruoyi.xq.dto.app.dynamic.DynamicQuery;
|
||||
import com.ruoyi.xq.dto.app.dynamic.*;
|
||||
import com.ruoyi.xq.service.DynamicService;
|
||||
import com.ruoyi.xq.service.DynamicStarService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.Registration;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/dynamic")
|
||||
@Tag(name = "动态相关接口")
|
||||
public class DynamicAppController {
|
||||
@Autowired
|
||||
private DynamicService dynamicService;
|
||||
@Autowired
|
||||
private DynamicStarService dynamicStarService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增动态")
|
||||
@@ -36,11 +33,39 @@ public class DynamicAppController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/star")
|
||||
@Operation(summary = "点赞动态")
|
||||
@Log(title = "点赞动态", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<Void> starDynamic(@RequestBody DynamicStarReq req){
|
||||
Long userId = LoginHelper.getUserId();
|
||||
if(req.getStar() == null){
|
||||
return R.fail();
|
||||
}
|
||||
if(req.getStar() == 1){
|
||||
dynamicStarService.star(req.getDynamicId(),userId);
|
||||
return R.ok();
|
||||
}
|
||||
if(req.getStar() == 2){
|
||||
dynamicStarService.unStar(req.getDynamicId(),userId);
|
||||
return R.ok();
|
||||
}
|
||||
return R.fail();
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "动态列表-分页")
|
||||
@Log(title = "动态列表-分页", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<PageModel<DynamicListVo>> page(PageQuery pageQuery, DynamicQuery dynamicQuery){
|
||||
dynamicQuery.initBirthdayByAge();
|
||||
Page<DynamicListVo> page = dynamicService.pageApp(pageQuery, dynamicQuery);
|
||||
return R.ok(PageModel.build(page));
|
||||
}
|
||||
|
||||
@GetMapping("/myStarDynamic")
|
||||
@Operation(summary = "我收到的动态点赞-分页")
|
||||
@Log(title = "我收到的动态点赞-分页", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<PageModel<MyStarDynamicListVO>> myStarDynamic(PageQuery pageQuery, MyStarDynamicQuery dynamicQuery){
|
||||
Page<MyStarDynamicListVO> page = dynamicStarService.myStarDynamic(pageQuery, dynamicQuery);
|
||||
return R.ok(PageModel.build(page));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ public class HomeAppController {
|
||||
@Operation(summary = "首页查询用户-分页")
|
||||
@Log(title = "首页查询用户-分页", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<PageModel<HomeUserListVo>> userPage(@RequestBody HomePageReq homePageReq){
|
||||
homePageReq.initBirthdayByAge();
|
||||
Page<HomeUserListVo> vo = userService.homePage(homePageReq);
|
||||
return R.ok(PageModel.build(vo));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.xq.controller.app;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/invite")
|
||||
@Tag(name = "邀请推广接口")
|
||||
public class InviteAppController {
|
||||
|
||||
|
||||
}
|
||||
@@ -3,12 +3,16 @@ package com.ruoyi.xq.controller.app;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.xq.domain.UserExtend;
|
||||
import com.ruoyi.xq.dto.app.common.IdsReq;
|
||||
import com.ruoyi.xq.dto.app.user.*;
|
||||
import com.ruoyi.xq.dto.app.user.vo.AccountInfoVO;
|
||||
import com.ruoyi.xq.dto.app.user.vo.CurrentUserFullInfoVo;
|
||||
import com.ruoyi.xq.dto.app.user.vo.CurrentUserInfoVo;
|
||||
import com.ruoyi.xq.dto.app.user.vo.UserAuthInfoVo;
|
||||
import com.ruoyi.xq.manager.CurrentUserManager;
|
||||
import com.ruoyi.xq.service.UserExtendService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -24,6 +28,8 @@ import java.util.stream.Collectors;
|
||||
public class UserAppController {
|
||||
@Autowired
|
||||
private CurrentUserManager currentUserManager;
|
||||
@Autowired
|
||||
private UserExtendService userExtendService;
|
||||
|
||||
@GetMapping("/user/query/homeInfo")
|
||||
@Operation(summary = "当前用户信息")
|
||||
@@ -33,6 +39,18 @@ public class UserAppController {
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/user/account/info")
|
||||
@Operation(summary = "当前用户信息的账户余额情况")
|
||||
@Log(title = "当前用户信息的账户余额情况", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<AccountInfoVO> accountInfo(){
|
||||
UserExtend userExtend = userExtendService.getByUserId(LoginHelper.getUserId());
|
||||
AccountInfoVO accountInfoVO = new AccountInfoVO();
|
||||
accountInfoVO.setUserId(userExtend.getUserId());
|
||||
accountInfoVO.setIncomeCoin(userExtend.getIncomeCoin());
|
||||
accountInfoVO.setWxTransNum(userExtend.getWxTransNum());
|
||||
return R.ok(accountInfoVO);
|
||||
}
|
||||
|
||||
@GetMapping("/user/query/fullInfo")
|
||||
@Operation(summary = "当前用户的详细信息")
|
||||
@Log(title = "当前用户的详细信息", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
|
||||
Reference in New Issue
Block a user