|
@@ -5,12 +5,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fdkk.sxz.annotation.auth.NoAuthentication;
|
|
|
import com.fdkk.sxz.annotation.log.AroundLog;
|
|
|
import com.fdkk.sxz.base.BaseController;
|
|
|
-import com.github.pagehelper.util.StringUtil;
|
|
|
+import com.fdkk.sxz.base.Result;
|
|
|
import com.fdkk.sxz.constant.CodeConstant;
|
|
|
import com.fdkk.sxz.entity.SceneLightStyleEntity;
|
|
|
-import com.fdkk.sxz.webApi.service.ISceneLightStyleService;
|
|
|
-import com.fdkk.sxz.base.Result;
|
|
|
import com.fdkk.sxz.vo.request.RequestSceneLightStyle;
|
|
|
+import com.fdkk.sxz.webApi.service.ISceneLightStyleService;
|
|
|
+import com.github.pagehelper.util.StringUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -30,14 +30,15 @@ import java.util.Date;
|
|
|
@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("/change/sceneLightStyle")
|
|
|
-@Api(tags = "灯光方案管理模块")
|
|
|
-public class SceneLightStyleController extends BaseController {
|
|
|
+@Api(tags = "灯光自定义方案管理模块")
|
|
|
+public class SceneLightStyleController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private ISceneLightStyleService sceneLightStyleService;
|
|
|
|
|
|
/**
|
|
|
* 保存或者修改
|
|
|
+ *
|
|
|
* @param lightStyle
|
|
|
* @return
|
|
|
*/
|
|
@@ -46,14 +47,14 @@ public class SceneLightStyleController extends BaseController {
|
|
|
@ApiImplicitParam(name = "id", value = "灯光方案id,有则修改,无则新增", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "sceneStyleId", value = "风格方案id", dataType = "String"),
|
|
|
@ApiImplicitParam(name = "lightStyleName", value = "灯光方案名称", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "proLightJson", value = "proLight.json的数据", dataType = "String")})
|
|
|
+ @ApiImplicitParam(name = "proLightJson", value = "json的数据", dataType = "String")})
|
|
|
@RequestMapping(value = "/saveOrUpdate", method = RequestMethod.POST)
|
|
|
@NoAuthentication
|
|
|
@AroundLog(name = "保存或者修改灯光方案")
|
|
|
- public Result saveOrUpdate(@RequestBody RequestSceneLightStyle lightStyle){
|
|
|
+ public Result saveOrUpdate(@RequestBody RequestSceneLightStyle lightStyle) {
|
|
|
|
|
|
- if(StringUtil.isEmpty(lightStyle.getLightStyleName()) || StringUtil.isEmpty(lightStyle.getProLightJson())
|
|
|
- || lightStyle.getSceneStyleId() == null){
|
|
|
+ if (StringUtil.isEmpty(lightStyle.getLightStyleName()) || StringUtil.isEmpty(lightStyle.getProLightJson())
|
|
|
+ || lightStyle.getSceneStyleId() == null) {
|
|
|
return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
|
|
|
}
|
|
|
|
|
@@ -61,7 +62,7 @@ public class SceneLightStyleController extends BaseController {
|
|
|
entity.setSceneStyleId(lightStyle.getSceneStyleId());
|
|
|
entity.setLightStyleName(lightStyle.getLightStyleName());
|
|
|
entity.setProLightJson(lightStyle.getProLightJson());
|
|
|
- if(lightStyle.getId() != null){
|
|
|
+ if (lightStyle.getId() != null) {
|
|
|
entity.setId(lightStyle.getId());
|
|
|
entity.setUpdateTime(new Date());
|
|
|
sceneLightStyleService.updateById(entity);
|
|
@@ -74,6 +75,7 @@ public class SceneLightStyleController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 根据风格id查询全部灯光方案
|
|
|
+ *
|
|
|
* @param lightStyle
|
|
|
* @return
|
|
|
*/
|
|
@@ -83,14 +85,14 @@ public class SceneLightStyleController extends BaseController {
|
|
|
@RequestMapping(value = "/findListByStyleId", method = RequestMethod.POST)
|
|
|
@NoAuthentication
|
|
|
@AroundLog(name = "根据风格id查询全部灯光方案")
|
|
|
- public Result findListByStyleId(@RequestBody RequestSceneLightStyle lightStyle){
|
|
|
+ public Result findListByStyleId(@RequestBody RequestSceneLightStyle lightStyle) {
|
|
|
|
|
|
- if(lightStyle.getSceneStyleId() == null){
|
|
|
+ if (lightStyle.getSceneStyleId() == null) {
|
|
|
return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
|
|
|
}
|
|
|
- LambdaQueryWrapper<SceneLightStyleEntity> wrapper = Wrappers.lambdaQuery();
|
|
|
+ LambdaQueryWrapper<SceneLightStyleEntity> wrapper = Wrappers.lambdaQuery();
|
|
|
wrapper.eq(SceneLightStyleEntity::getSceneStyleId, lightStyle.getSceneStyleId())
|
|
|
- .eq(SceneLightStyleEntity::getRecStatus,"A");
|
|
|
+ .eq(SceneLightStyleEntity::getRecStatus, "A");
|
|
|
wrapper.orderByDesc(SceneLightStyleEntity::getId);
|
|
|
|
|
|
return Result.success(sceneLightStyleService.list(wrapper));
|
|
@@ -98,6 +100,7 @@ public class SceneLightStyleController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 保存或者修改
|
|
|
+ *
|
|
|
* @param lightStyle
|
|
|
* @return
|
|
|
*/
|
|
@@ -107,9 +110,9 @@ public class SceneLightStyleController extends BaseController {
|
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
@NoAuthentication
|
|
|
@AroundLog(name = "保存或者修改")
|
|
|
- public Result delete(@RequestBody RequestSceneLightStyle lightStyle){
|
|
|
+ public Result delete(@RequestBody RequestSceneLightStyle lightStyle) {
|
|
|
|
|
|
- if(lightStyle.getId() == null){
|
|
|
+ if (lightStyle.getId() == null) {
|
|
|
return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
|
|
|
}
|
|
|
|
|
@@ -123,6 +126,7 @@ public class SceneLightStyleController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 根据id查询灯光方案
|
|
|
+ *
|
|
|
* @param lightStyle
|
|
|
* @return
|
|
|
*/
|
|
@@ -132,9 +136,9 @@ public class SceneLightStyleController extends BaseController {
|
|
|
@RequestMapping(value = "/findById", method = RequestMethod.POST)
|
|
|
@NoAuthentication
|
|
|
@AroundLog(name = "根据id查询灯光方案")
|
|
|
- public Result findById(@RequestBody RequestSceneLightStyle lightStyle){
|
|
|
+ public Result findById(@RequestBody RequestSceneLightStyle lightStyle) {
|
|
|
|
|
|
- if(lightStyle.getId() == null){
|
|
|
+ if (lightStyle.getId() == null) {
|
|
|
return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
|
|
|
}
|
|
|
|