|
|
@ -0,0 +1,43 @@ |
|
|
|
|
|
package com.qniao.dam.api.command.odc.user; |
|
|
|
|
|
|
|
|
|
|
|
import com.qniao.dam.api.command.odc.user.request.*; |
|
|
|
|
|
import com.qniao.dam.application.service.odc.OrderDiscountConfigApplicationService; |
|
|
|
|
|
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 OrderDiscountConfigUserCommandController { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private OrderDiscountConfigApplicationService orderDiscountConfigApplicationService; |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户创建订单优惠配置") |
|
|
|
|
|
@PostMapping("create/order-discount-config") |
|
|
|
|
|
public void userCreateOrderDiscountConfig(@RequestBody @Valid UserCreateOrderDiscountConfigDto dto) { |
|
|
|
|
|
orderDiscountConfigApplicationService.create(dto.trans2Domain()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户编辑订单优惠配置") |
|
|
|
|
|
@PostMapping("edit/order-discount-config") |
|
|
|
|
|
public void userEditOrderDiscountConfig(@RequestBody @Valid UserEditOrderDiscountConfigDto dto) { |
|
|
|
|
|
orderDiscountConfigApplicationService.edit(dto.trans2Domain()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户删除订单优惠配置") |
|
|
|
|
|
@PostMapping("delete/order-discount-config") |
|
|
|
|
|
public void userDeleteOrderDiscountConfig(@RequestBody @Valid UserDeleteOrderDiscountConfigDto dto) { |
|
|
|
|
|
orderDiscountConfigApplicationService.delete(dto.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户启停订单优惠配置") |
|
|
|
|
|
@PostMapping("enable/order-discount-config") |
|
|
|
|
|
public void userEnableOrderDiscountConfig(@RequestBody @Valid UserEnableOrderDiscountConfigDto dto) { |
|
|
|
|
|
orderDiscountConfigApplicationService.enable(dto.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |