|
|
@ -0,0 +1,47 @@ |
|
|
|
|
|
package com.qniao.dam.api.command.prc.user; |
|
|
|
|
|
|
|
|
|
|
|
import com.qniao.dam.api.command.prc.user.request.*; |
|
|
|
|
|
import com.qniao.dam.application.service.prc.PointRewardConfigApplicationService; |
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
|
|
|
|
|
|
|
@Api(tags = "积分奖励配置") |
|
|
|
|
|
@RestController |
|
|
|
|
|
@RequestMapping("user") |
|
|
|
|
|
public class PointRewardConfigUserCommandController { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private PointRewardConfigApplicationService pointRewardConfigApplicationService; |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户创建积分奖励配置") |
|
|
|
|
|
@PostMapping("create/point-reward-config") |
|
|
|
|
|
public void userCreatePointRewardConfig(@RequestBody @Valid UserCreatePointRewardConfigDto dto, |
|
|
|
|
|
@RequestParam("userId") Long userId) { |
|
|
|
|
|
pointRewardConfigApplicationService.create(dto.trans2Domain()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户编辑积分奖励配置") |
|
|
|
|
|
@PostMapping("edit/point-reward-config") |
|
|
|
|
|
public void userEditPointRewardConfig(@RequestBody @Valid UserEditPointRewardConfigDto dto, |
|
|
|
|
|
@RequestParam("userId") Long userId) { |
|
|
|
|
|
pointRewardConfigApplicationService.edit(dto.trans2Domain()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户删除积分奖励配置") |
|
|
|
|
|
@PostMapping("delete/point-reward-config") |
|
|
|
|
|
public void userDeletePointRewardConfig(@RequestBody @Valid UserDeletePointRewardConfigDto dto, |
|
|
|
|
|
@RequestParam("userId") Long userId) { |
|
|
|
|
|
pointRewardConfigApplicationService.delete(dto.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户启停积分奖励配置") |
|
|
|
|
|
@PostMapping("enable/point-reward-config") |
|
|
|
|
|
public void userEnablePointRewardConfig(@RequestBody @Valid UserEnablePointRewardConfigDto dto, |
|
|
|
|
|
@RequestParam("userId") Long userId) { |
|
|
|
|
|
pointRewardConfigApplicationService.enable(dto.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |