Commit 97ed5b01 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

直接新增场景&删除场景

See merge request !406
parents 49bff061 7a5a407b
...@@ -25,4 +25,9 @@ public interface ReviewSceneService extends IService<ReviewScene> { ...@@ -25,4 +25,9 @@ public interface ReviewSceneService extends IService<ReviewScene> {
List<ReviewScene> findList(ReviewSceneFindListRequest request); List<ReviewScene> findList(ReviewSceneFindListRequest request);
/**
* 新增场景
* @param reviewScene
*/
void addReviewScene(ReviewScene reviewScene);
} }
...@@ -39,4 +39,13 @@ public class ReviewSceneServiceImpl extends ServiceImpl<ReviewSceneMapper, Revie ...@@ -39,4 +39,13 @@ public class ReviewSceneServiceImpl extends ServiceImpl<ReviewSceneMapper, Revie
return reviewSceneMapper.findList(request); return reviewSceneMapper.findList(request);
} }
/**
* 新增场景
* @param reviewScene
*/
@Override
public void addReviewScene(ReviewScene reviewScene) {
save(reviewScene);
}
} }
package com.ruoyi.web; package com.ruoyi.web;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.ReviewScene; import com.ruoyi.domain.ReviewScene;
import com.ruoyi.service.ReviewSceneService; import com.ruoyi.service.ReviewSceneService;
import com.ruoyi.web.request.*; import com.ruoyi.web.request.*;
...@@ -34,4 +37,28 @@ public class ReviewSceneController extends BaseController { ...@@ -34,4 +37,28 @@ public class ReviewSceneController extends BaseController {
return getDataTable(reviewSceneService.findList(request)); return getDataTable(reviewSceneService.findList(request));
} }
@ApiOperation("新建场景")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "新建场景", businessType = BusinessType.INSERT)
@RequestMapping(method = RequestMethod.POST, value = "/add")
public R<String> add(@Validated @RequestBody ReviewScene reviewScene) {
reviewSceneService.addReviewScene(reviewScene);
return R.ok();
}
@ApiOperation("删除场景")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "删除场景", businessType = BusinessType.DELETE)
@RequestMapping(method = RequestMethod.POST, value = "/remove")
public R<String> remove(@Validated @RequestBody ReviewSceneDelRequest request) {
reviewSceneService.removeById(request.getId());
return R.ok();
}
} }
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewSceneDelResult", description = "删除场景")
@Data
public class ReviewSceneDelRequest {
@ApiModelProperty("ID")
private Long id;
}
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