|
|
@@ -0,0 +1,104 @@
|
|
|
+package cn.iocoder.yudao.module.system.controller.admin.biz;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.JiashuNoticePageReqVO;
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.JiashuNoticeRespVO;
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.biz.vo.JiashuNoticeSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.miniapp.JiashuNoticeDO;
|
|
|
+import cn.iocoder.yudao.module.system.service.miniapp.JiashuNoticeService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.annotation.security.PermitAll;
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 管理后台 - 须知(yanglao-jiashu 数据源)
|
|
|
+ *
|
|
|
+ * @author system
|
|
|
+ */
|
|
|
+@Tag(name = "管理后台 - 须知")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/jiashu/notice")
|
|
|
+@Validated
|
|
|
+public class JiashuNoticeController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private JiashuNoticeService jiashuNoticeService;
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ @Operation(summary = "创建须知")
|
|
|
+ @PermitAll
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<Long> createNotice(@Valid @RequestBody JiashuNoticeSaveReqVO createReqVO) {
|
|
|
+ return success(jiashuNoticeService.createNotice(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/update")
|
|
|
+ @Operation(summary = "更新须知")
|
|
|
+ @PermitAll
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<Boolean> updateNotice(@Valid @RequestBody JiashuNoticeSaveReqVO updateReqVO) {
|
|
|
+ jiashuNoticeService.updateNotice(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete")
|
|
|
+ @Operation(summary = "删除须知")
|
|
|
+ @Parameter(name = "id", description = "须知编号", required = true, example = "1024")
|
|
|
+ @PermitAll
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<Boolean> deleteNotice(@RequestParam("id") Long id) {
|
|
|
+ jiashuNoticeService.deleteNotice(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/get")
|
|
|
+ @Operation(summary = "获得须知")
|
|
|
+ @Parameter(name = "id", description = "须知编号", required = true, example = "1024")
|
|
|
+ @PermitAll
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<JiashuNoticeRespVO> getNotice(@RequestParam("id") Long id) {
|
|
|
+ JiashuNoticeDO notice = jiashuNoticeService.getNotice(id);
|
|
|
+ return success(BeanUtils.toBean(notice, JiashuNoticeRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/page")
|
|
|
+ @Operation(summary = "获得须知分页")
|
|
|
+ @PermitAll
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<PageResult<JiashuNoticeRespVO>> getNoticePage(@Valid JiashuNoticePageReqVO pageReqVO) {
|
|
|
+ PageResult<JiashuNoticeDO> pageResult = jiashuNoticeService.getNoticePage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, JiashuNoticeRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/listByType")
|
|
|
+ @Operation(summary = "根据须知类型 + 机构id 查询须知列表")
|
|
|
+ @Parameter(name = "type", description = "须知类型:APPOINTMENT 或者 VISIT", required = true, example = "APPOINTMENT")
|
|
|
+ @Parameter(name = "tenantId", description = "机构id", required = true, example = "1024")
|
|
|
+ @PermitAll
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<List<JiashuNoticeRespVO>> getNoticeListByType(@RequestParam("type") String type,
|
|
|
+ @RequestParam("tenantId") Long tenantId) {
|
|
|
+ List<JiashuNoticeDO> list = jiashuNoticeService.getNoticeListByType(type, tenantId);
|
|
|
+ return success(BeanUtils.toBean(list, JiashuNoticeRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|