WaterMarkController.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.zhixinghe1.ots.service.controller;
  2. import com.zhixinghe1.ots.atomic.service.IAttachmentService;
  3. import com.zhixinghe1.ots.config.BizConfig;
  4. import com.zhixinghe1.ots.domain.dto.AttachmentDto;
  5. import com.zhixinghe1.ots.domain.dto.WaterMarkRequest;
  6. import com.zhixinghe1.ots.service.manager.IWaterMarkManager;
  7. import io.swagger.v3.oas.annotations.tags.Tag;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.GetMapping;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. import java.io.UnsupportedEncodingException;
  13. @Tag(name = "水印")
  14. @RestController
  15. @RequestMapping("/watermark")
  16. public class WaterMarkController {
  17. @Autowired
  18. private BizConfig bizConfig;
  19. @Autowired
  20. private IWaterMarkManager waterMarkManager;
  21. @Autowired
  22. private IAttachmentService attachmentService;
  23. @GetMapping(value = "/make")
  24. public WaterMarkRequest make(WaterMarkRequest request) throws UnsupportedEncodingException {
  25. waterMarkManager.make(request);
  26. return null;
  27. }
  28. @GetMapping("test2")
  29. public AttachmentDto test2(Long id) {
  30. System.out.println(("----- selectAll method test ------"));
  31. AttachmentDto attachmentDto = attachmentService.selectById(id);
  32. return attachmentDto;
  33. }
  34. @GetMapping("test3")
  35. public Integer test3() {
  36. AttachmentDto attachmentDto = new AttachmentDto();
  37. attachmentDto.setPath("/12342");
  38. attachmentDto.setStatus(true);
  39. attachmentDto.setName("测试.jpg");
  40. return attachmentService.addAttachment(attachmentDto);
  41. }
  42. }