| | |
| | | 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> |
| | |
| | | @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(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |