ProjectKeywordController.java 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package cn.cslg.pas.controller;
  2. import cn.cslg.pas.common.core.base.Constants;
  3. import cn.cslg.pas.common.model.vo.ProjectKeywordVO;
  4. import cn.cslg.pas.common.utils.Response;
  5. import cn.cslg.pas.common.utils.auth.checkAuth;
  6. import cn.cslg.pas.domain.ProjectKeyword;
  7. import cn.cslg.pas.service.ProjectKeywordService;
  8. import io.swagger.v3.oas.annotations.Operation;
  9. import io.swagger.v3.oas.annotations.tags.Tag;
  10. import lombok.RequiredArgsConstructor;
  11. import org.springframework.context.annotation.Lazy;
  12. import org.springframework.web.bind.annotation.GetMapping;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. /**
  17. * <p>
  18. * 专题库关键词 前端控制器
  19. * </p>
  20. *
  21. * @author 王岩
  22. * @since 2021-12-24
  23. */
  24. @Tag(name = "专题库关键词")
  25. @RestController
  26. @RequestMapping(Constants.API_VERSION_V2 + "/project/keyword")
  27. @RequiredArgsConstructor(onConstructor_ = {@Lazy})
  28. public class ProjectKeywordController {
  29. private final ProjectKeywordService projectKeywordService;
  30. @GetMapping("list")
  31. @Operation(summary = "关键词列表")
  32. public String getPageList(ProjectKeywordVO params) {
  33. return Response.success(projectKeywordService.getPageList(params));
  34. }
  35. @PostMapping("add")
  36. @Operation(summary = "新增关键词")
  37. public String add(ProjectKeyword projectKeyword) {
  38. return projectKeywordService.add(projectKeyword);
  39. }
  40. @PostMapping("edit")
  41. @Operation(summary = "编辑关键词")
  42. public String edit(ProjectKeyword projectKeyword) {
  43. return projectKeywordService.edit(projectKeyword);
  44. }
  45. @PostMapping("delete")
  46. @Operation(summary = "删除关键词")
  47. public String delete(Integer id) {
  48. return projectKeywordService.delete(id);
  49. }
  50. }