|
|
@ -3,9 +3,11 @@ package org.jeecg.modules.api.workorderController; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.modules.apiBean.PageBean; |
|
|
|
import org.jeecg.modules.apiService.CollectionService; |
|
|
|
import org.springframework.web.bind.annotation.RequestHeader; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
@ -25,8 +27,35 @@ public class CollectionController { |
|
|
|
|
|
|
|
@ApiOperation(value="收藏信息-我的收藏", notes="收藏信息-我的收藏") |
|
|
|
@RequestMapping(value = "/queryCollectionList", method = {RequestMethod.GET}) |
|
|
|
public Result<?> queryCollectionList(String userId, PageBean pageBean){ |
|
|
|
public Result<?> queryCollectionList(@RequestHeader("X-Access-Token") String userId, PageBean pageBean){ |
|
|
|
return collectionService.queryCollectionList(userId, pageBean); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value="收藏信息-添加收藏", notes="收藏信息-添加收藏") |
|
|
|
@RequestMapping(value = "/addCollection", method = {RequestMethod.GET}) |
|
|
|
public Result<?> addCollection(@RequestHeader("X-Access-Token") String userId, String templateId){ |
|
|
|
String message; |
|
|
|
|
|
|
|
if(StringUtils.isEmpty(templateId)){ |
|
|
|
message = "工单编号不存在,请输入templateId!"; |
|
|
|
}else { |
|
|
|
return collectionService.addCollection(userId, templateId); |
|
|
|
} |
|
|
|
return Result.error(message); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value="收藏信息-取消收藏", notes="收藏信息-取消收藏") |
|
|
|
@RequestMapping(value = "/deleteCollection", method = {RequestMethod.GET}) |
|
|
|
public Result<?> deleteCollection(@RequestHeader("X-Access-Token") String userId, String collectionId){ |
|
|
|
String message; |
|
|
|
|
|
|
|
if(StringUtils.isEmpty(collectionId)){ |
|
|
|
message = "收藏编号不存在,请输入collectionId!"; |
|
|
|
}else { |
|
|
|
return collectionService.deleteCollection(userId, collectionId); |
|
|
|
} |
|
|
|
return Result.error(message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |