|
|
|
@ -41,6 +41,9 @@ public class ManagerService { |
|
|
|
|
@Autowired |
|
|
|
|
private ActivityMapper activityMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ImageService imageService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 登录 |
|
|
|
|
* @param managerLoginForm 登录表单 |
|
|
|
@ -153,7 +156,18 @@ public class ManagerService { |
|
|
|
|
* @return 返回更新结果 |
|
|
|
|
*/ |
|
|
|
|
public JSONResponse<DefaultRes, Void> updateActivity(UpdateActivityForm updateActivityForm) { |
|
|
|
|
if(activityMapper.updateActivity(updateActivityForm.getActivityId(),updateActivityForm.getTitle(),updateActivityForm.getContent())){ |
|
|
|
|
|
|
|
|
|
String imageName = null; |
|
|
|
|
if(updateActivityForm.getActivityImgFile()!=null) { |
|
|
|
|
//保存活动背景图
|
|
|
|
|
imageName = imageService.saveImg(updateActivityForm.getActivityImgFile()); |
|
|
|
|
if (imageName == null) { |
|
|
|
|
logger.error("活动背景图保存失败"); |
|
|
|
|
return new JSONResponse<>(DefaultRes.fail, Result.FAIL); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(activityMapper.updateActivity(updateActivityForm.getActivityId(),updateActivityForm.getTitle(),updateActivityForm.getContent(),imageName)){ |
|
|
|
|
return new JSONResponse<>(DefaultRes.ok,Result.OK); |
|
|
|
|
}else{ |
|
|
|
|
return new JSONResponse<>(DefaultRes.fail,Result.FAIL); |
|
|
|
|