用户经验值设置

This commit is contained in:
lifenlong
2021-06-05 17:13:04 +08:00
parent e379a2eb34
commit bbe01e9e67
9 changed files with 30 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
@@ -45,6 +46,18 @@ public class MemberGradeManagerController {
return ResultUtil.data(memberGradeService.page(PageUtil.initPage(page)));
}
@ApiOperation(value = "添加会员等级")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "会员等级ID", required = true, paramType = "path")
})
@GetMapping(value = "/add")
public ResultMessage<Object> daa(@Validated MemberGrade memberGrade) {
if (memberGradeService.updateById(memberGrade)) {
return ResultUtil.success(ResultCode.SUCCESS);
}
throw new ServiceException(ResultCode.ERROR);
}
@ApiOperation(value = "修改会员等级")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "会员等级ID", required = true, paramType = "path")
@@ -57,9 +70,11 @@ public class MemberGradeManagerController {
throw new ServiceException(ResultCode.ERROR);
}
@ApiOperation(value = "删除会员等级")
@ApiImplicitParam(name = "id", value = "会员等级ID", required = true, dataType = "String", paramType = "path")
@PutMapping(value = "/delete/{id}")
@DeleteMapping(value = "/delete/{id}")
public ResultMessage<IPage<Object>> delete(@PathVariable String id) {
if(memberGradeService.getById(id).getIsDefault()){
throw new ServiceException(ResultCode.USER_GRADE_IS_DEFAULT);

View File

@@ -36,11 +36,10 @@ public class PointsGoodsManagerController {
@PostMapping(consumes = "application/json", produces = "application/json")
@ApiOperation(value = "添加积分商品")
public ResultMessage<Object> addPointsGoods(@RequestBody List<PointsGoodsVO> pointsGoodsList) {
AuthUser currentUser = UserContext.getCurrentUser();
List<PointsGoodsVO> collect = new ArrayList<>();
for (PointsGoodsVO i : pointsGoodsList) {
i.setStoreName(i.getGoodsSku().getStoreName());
i.setStoreId(currentUser.getId());
i.setStoreId(UserContext.getCurrentUser().getStoreId());
collect.add(i);
}
pointsGoodsService.addPointsGoods(collect);

View File

@@ -46,7 +46,7 @@ public class SettingManagerController {
"WECHAT_PC_CONNECT,WECHAT_WAP_CONNECT,WECHAT_APP_CONNECT,WECHAT_MP_CONNECT," +
"QQ_WEB_CONNECT,QQ_APP_CONNECT," +
"QQ_WEB_CONNECT,QQ_APP_CONNECT,WEIBO_CONNECT,ALIPAY_CONNECT," +
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING")
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING")
public ResultMessage saveConfig(@PathVariable String key, @RequestBody String configValue) {
SettingEnum settingEnum = SettingEnum.valueOf(key);
//获取系统配置
@@ -92,7 +92,7 @@ public class SettingManagerController {
"WECHAT_PC_CONNECT,WECHAT_WAP_CONNECT,WECHAT_APP_CONNECT,WECHAT_MP_CONNECT," +
"QQ_WEB_CONNECT,QQ_APP_CONNECT," +
"QQ_WEB_CONNECT,QQ_APP_CONNECT,WEIBO_CONNECT,ALIPAY_CONNECT," +
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING"
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING"
)
public ResultMessage settingGet(@PathVariable String key) {
return createSetting(key);
@@ -175,6 +175,10 @@ public class SettingManagerController {
return setting == null ?
ResultUtil.data(new SeckillSetting()) :
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), SeckillSetting.class));
case EXPERIENCE_SETTING:
return setting == null ?
ResultUtil.data(new ExperienceSetting()) :
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), ExperienceSetting.class));
default:
throw new ServiceException(ResultCode.SETTING_NOT_TO_SET);
}