|
@@ -1,46 +1,54 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.service.SysUserCashAccountService;
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
-import com.ym.mec.common.page.QueryInfo;
|
|
|
-
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.service.SysUserCashAccountService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.page.QueryInfo;
|
|
|
+
|
|
|
@RequestMapping("userCashAccount")
|
|
|
@Api(tags = "用户账户服务")
|
|
|
@RestController
|
|
|
public class SysUserCashAccountController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private SysUserCashAccountService sysUserCashAccountService;
|
|
|
- @Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
-
|
|
|
- @ApiOperation(value = "获取用户账户信息")
|
|
|
- @GetMapping("/get")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('userCashAccount/get')")
|
|
|
- public Object add() {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("请重新登录");
|
|
|
- }
|
|
|
- return succeed(sysUserCashAccountService.get(sysUser.getId()));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "分页查询收费类型列表")
|
|
|
- @GetMapping("/queryPage")
|
|
|
- @PreAuthorize("@pcs.hasPermissions('userCashAccount/queryPage')")
|
|
|
- public Object queryPage(QueryInfo queryInfo) {
|
|
|
- return succeed(sysUserCashAccountService.queryPage(queryInfo));
|
|
|
- }
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private SysUserCashAccountService sysUserCashAccountService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取用户账户信息")
|
|
|
+ @GetMapping("/get")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('userCashAccount/get')")
|
|
|
+ public Object add() {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("请重新登录");
|
|
|
+ }
|
|
|
+ return succeed(sysUserCashAccountService.get(sysUser.getId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分页查询收费类型列表")
|
|
|
+ @GetMapping("/queryPage")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('userCashAccount/queryPage')")
|
|
|
+ public Object queryPage(QueryInfo queryInfo) {
|
|
|
+ return succeed(sysUserCashAccountService.queryPage(queryInfo));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分页查询收费类型列表")
|
|
|
+ @PostMapping("/transferCourseBalanceToBalance")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('userCashAccount/transferCourseBalanceToBalance')")
|
|
|
+ public Object transferCourseBalanceToBalance(Integer userId) {
|
|
|
+ sysUserCashAccountService.transferCourseBalanceToBalance(userId);
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
}
|