Commit 652c8f95 authored by liqin's avatar liqin 💬

bug fixed

parent 730274bc
......@@ -48,7 +48,7 @@ public class LearningContent implements Serializable {
@NotBlank(message = "学习内容宣传图不能为空", groups = {Add.class, Update.class})
private String cover;
@ApiModelProperty("适用范围")
@ApiModelProperty(value = "适用范围", allowableValues = "ALL_PLAT, THIS_ORGAN, THIS_ORGAN_SUB")
@TableField("applicable_scope")
@NotBlank(message = "适用范围不能为空", groups = {Add.class, Update.class})
private String applicableScope;
......
......@@ -95,8 +95,7 @@ public class CopyrightOwnerController extends BaseController {
@PutMapping("/update")
@RequiresPermissions("copyright:owner:update")
@ApiOperation(value = "修改版权方信息", notes = "修改版权方信息")
public Map<String, Object> updateCopyrightOwner(@Validated(value = {Update.class}) CopyrightOwner copyrightOwner, @RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum) {
copyrightOwner.setOwnerType(copyrightOwnerTypeEnum.name());
public Map<String, Object> updateCopyrightOwner(@Validated(value = {Update.class}) CopyrightOwner copyrightOwner) {
boolean flag = copyrightOwnerService.updateById(copyrightOwner);
List<String> assetTypeIdList = copyrightOwner.getAssetTypeIdList();
......
......@@ -5,10 +5,12 @@ import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.LearningContent;
import cn.wisenergy.chnmuseum.party.service.LearningContentBoardCatService;
import cn.wisenergy.chnmuseum.party.service.LearningContentBoardService;
import cn.wisenergy.chnmuseum.party.service.LearningContentCopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.LearningContentService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
......@@ -22,7 +24,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
......@@ -42,21 +43,12 @@ public class LearningContentController extends BaseController {
@Resource
private LearningContentService learningContentService;
@PostMapping("/batchSave")
@RequiresPermissions("learning:content:batch:save")
@ApiOperation(value = "批量添加学习内容", notes = "批量添加学习内容")
public Map<String, Object> batchSaveLearningContent(@Validated(value = {Add.class}) List<LearningContent> learningContentList) {
// 保存业务节点信息
boolean result = learningContentService.saveBatch(learningContentList);
// 返回操作结果
if (result) {
return getSuccessResult();
} else {
// 保存失败
return getFailResult();
}
}
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@PostMapping("/save")
@RequiresPermissions("learning:content:save")
......@@ -64,6 +56,17 @@ public class LearningContentController extends BaseController {
public Map<String, Object> saveLearningContent(@Validated(value = {Add.class}) LearningContent learningContent) {
// 保存业务节点信息
boolean result = learningContentService.save(learningContent);
// 返回操作结果
if (result) {
return getSuccessResult();
......@@ -84,24 +87,6 @@ public class LearningContentController extends BaseController {
return getFailResult();
}
@PutMapping("/updateAuditStatus/{id}")
@RequiresPermissions("learning:content:update:audit:status")
@ApiOperation(value = "更新学习内容审核状态", notes = "更新学习内容审核状态")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String")
})
public Map<String, Object> updateStatus(@NotNull(message = "学习内容ID不能为空") @PathVariable("id") String id, @RequestParam("status") AuditStatusEnum status) {
UpdateWrapper<LearningContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id);
updateWrapper.eq("audit_status", status.name());
boolean flag = learningContentService.update(updateWrapper);
if (flag) {
return getSuccessResult();
}
return getFailResult();
}
@DeleteMapping("/delete/{id}")
@RequiresPermissions("learning:content:delete")
@ApiOperation(value = "根据ID删除学习内容", notes = "根据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