Commit 16e45ee4 by lanpingxiong

Merge branch 'dev/lanpingxiong' into 'master'

# 商家端优惠行程修改接口

See merge request hewei/Jumeirah!61
parents c41cfb42 7751572e
...@@ -18,7 +18,6 @@ import io.geekidea.springbootplus.framework.shiro.util.JwtUtil; ...@@ -18,7 +18,6 @@ import io.geekidea.springbootplus.framework.shiro.util.JwtUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -26,6 +25,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -26,6 +25,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
......
...@@ -9,6 +9,7 @@ import io.geekidea.springbootplus.framework.common.api.ApiResult; ...@@ -9,6 +9,7 @@ import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController; import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging; import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add; import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog; import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType; import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken; import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
...@@ -50,7 +51,7 @@ public class McStrokeDiscountController extends BaseController { ...@@ -50,7 +51,7 @@ public class McStrokeDiscountController extends BaseController {
@RequiresPermissions("merchant:aircraft:management:edit") @RequiresPermissions("merchant:aircraft:management:edit")
public ApiResult<Boolean> addStrokeDiscount(@Validated(Add.class) @RequestBody McStrokeDiscountAddParam mcStrokeDiscountAddParam) throws Exception { public ApiResult<Boolean> addStrokeDiscount(@Validated(Add.class) @RequestBody McStrokeDiscountAddParam mcStrokeDiscountAddParam) throws Exception {
StrokeDiscount strokeDiscount = new StrokeDiscount(); StrokeDiscount strokeDiscount = new StrokeDiscount();
BeanUtils.copyProperties(mcStrokeDiscountAddParam,strokeDiscount); BeanUtils.copyProperties(mcStrokeDiscountAddParam, strokeDiscount);
JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal(); JwtToken jwtToken = (JwtToken) SecurityUtils.getSubject().getPrincipal();
strokeDiscount.setMcId(jwtToken.getMcId()); strokeDiscount.setMcId(jwtToken.getMcId());
boolean flag = strokeDiscountService.saveStrokeDiscount(strokeDiscount); boolean flag = strokeDiscountService.saveStrokeDiscount(strokeDiscount);
...@@ -60,13 +61,15 @@ public class McStrokeDiscountController extends BaseController { ...@@ -60,13 +61,15 @@ public class McStrokeDiscountController extends BaseController {
/** /**
* 修改优惠行程表 * 修改优惠行程表
*/ */
/* @PostMapping("/update") @PostMapping("/update")
@OperationLog(name = "修改优惠行程表", type = OperationLogType.UPDATE) @OperationLog(name = "修改优惠行程表", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改优惠行程表") @ApiOperation(value = "修改优惠行程表")
public ApiResult<Boolean> updateStrokeDiscount(@Validated(Update.class) @RequestBody StrokeDiscount strokeDiscount) throws Exception { public ApiResult<Boolean> updateStrokeDiscount(@Validated(Update.class) @RequestBody McStrokeDiscountAddParam mcStrokeDiscountAddParam) throws Exception {
StrokeDiscount strokeDiscount = new StrokeDiscount();
BeanUtils.copyProperties(mcStrokeDiscountAddParam, strokeDiscount);
boolean flag = strokeDiscountService.updateStrokeDiscount(strokeDiscount); boolean flag = strokeDiscountService.updateStrokeDiscount(strokeDiscount);
return ApiResult.result(flag); return ApiResult.result(flag);
}*/ }
/** /**
* 删除优惠行程表 * 删除优惠行程表
......
package com.jumeirah.api.merchant.entity.param; package com.jumeirah.api.merchant.entity.param;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity; import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -23,6 +24,10 @@ import java.math.BigDecimal; ...@@ -23,6 +24,10 @@ import java.math.BigDecimal;
public class McStrokeDiscountAddParam extends BaseEntity { public class McStrokeDiscountAddParam extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键ID")
private Long id;
@NotNull(message = "出发城市id不能为空") @NotNull(message = "出发城市id不能为空")
@ApiModelProperty("出发城市id") @ApiModelProperty("出发城市id")
private Long cityOutsetId; private Long cityOutsetId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment