|
@@ -1,5 +1,7 @@
|
|
|
package com.yonge.cooleshow.student.controller;
|
|
|
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
+import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.MemberPriceSettingsSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.MemberPriceSettings;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.SysConfig;
|
|
@@ -14,6 +16,8 @@ import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -33,6 +37,9 @@ public class MemberPriceSettingsController extends BaseController {
|
|
|
@Resource
|
|
|
private ActivityPlanService activityPlanService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
@GetMapping("/detail/{id}")
|
|
|
@ApiOperation(value = "详情", notes = "传入id")
|
|
|
public HttpResponseResult<MemberPriceSettingsVo> detail(@PathVariable("id") Long id) {
|
|
@@ -96,11 +103,12 @@ public class MemberPriceSettingsController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "获取畅学卡")
|
|
|
@GetMapping("/getDiscount")
|
|
|
- public HttpResponseResult<MemberPriceSettings> getDiscount() {
|
|
|
- return succeed(memberPriceSettingsService.lambdaQuery()
|
|
|
- .eq(MemberPriceSettings::getVipType, "DISCOUNT")
|
|
|
- .eq(MemberPriceSettings::getStatus, true)
|
|
|
- .orderByDesc(MemberPriceSettings::getCreateTime)
|
|
|
- .last("limit 1").one());
|
|
|
+ public HttpResponseResult<MemberPriceSettingsWrapper.UserDiscount> getDiscount() {
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+ Long userId = null;
|
|
|
+ if (user != null ){
|
|
|
+ userId = user.getId();
|
|
|
+ }
|
|
|
+ return succeed(memberPriceSettingsService.getDiscount(userId));
|
|
|
}
|
|
|
}
|