From 980d0d6571f4b50b51502ee60094a3dbdf1fb2f7 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期三, 07 八月 2024 16:40:21 +0800 Subject: [PATCH] 8.7.1 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java index 2871d37..1ce47ac 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TUserTagController.java @@ -1,9 +1,18 @@ package com.ruoyi.other.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.account.api.dto.TagListQueryDto; +import com.ruoyi.account.api.dto.UnitListQueryDto; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.other.api.domain.TCompany; +import com.ruoyi.other.api.domain.TUserTag; +import com.ruoyi.other.mapper.TUserTagMapper; +import com.ruoyi.other.service.TUserTagService; +import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import java.time.LocalDateTime; /** * <p> @@ -16,6 +25,32 @@ @RestController @RequestMapping("/t-user-tag") public class TUserTagController { + @Resource + private TUserTagService tUserTagService; + + @PostMapping(value = "/page") + public R<Page<TUserTag>> page(@RequestBody TagListQueryDto tagListQueryDto) { + Page<TUserTag> page = tUserTagService.lambdaQuery() + .orderByDesc(TUserTag::getCreateTime) + .like(tagListQueryDto.getTagName()!=null&& tagListQueryDto.getTagName().isEmpty(), TUserTag::getName, tagListQueryDto.getTagName()) + .page(Page.of(tagListQueryDto.getPageCurr(), tagListQueryDto.getPageSize())); + return R.ok(page); + + } + + @PostMapping(value = "/addorUpdateTag") + public R addorUpdateTag(@RequestBody TUserTag tUserTag) { + tUserTag.setCreateTime(LocalDateTime.now()); + tUserTagService.saveOrUpdate(tUserTag); + return R.ok(); + } + + @PostMapping(value = "/delete") + public R delete(@RequestParam Integer id) { + tUserTagService.removeById(id); + return R.ok(); + } + } -- Gitblit v1.7.1